index 7ab565a609ad3dcd9c1600dd05cfe4f547892064..0c9f4574dcb8d5881ae0d0a82a049d7eecc3e5e0 100644 (file)
LOSETUP ?= "/sbin/losetup"
# Since these need to go in /etc/fstab we can hardcode them
+# Since the vars are weakly assigned, you can override them from your local.conf
LOOPDEV ?= "/dev/loop1"
LOOPDEV_BOOT ?= "/dev/loop2"
LOOPDEV_FS ?= "/dev/loop3"
+# Default to 4GiB images, but use 2GiB images for beaglebone
+SDIMG_SIZE ?= "444"
+SDIMG_SIZE_beaglebone = "222"
+
+BOOTPARTNAME_beaglebone = "BEAGLE_BONE"
+BOOTPARTNAME ?= "${MACHINE}"
+
IMAGE_CMD_sdimg () {
SDIMG=${WORKDIR}/sd.img
# If an SD image is already present, reuse and reformat it
if [ ! -e ${SDIMG} ] ; then
- dd if=/dev/zero of=${SDIMG} bs=$(echo '255 * 63 * 512' | bc) count=444
+ dd if=/dev/zero of=${SDIMG} bs=$(echo '255 * 63 * 512' | bc) count=${SDIMG_SIZE}
fi
${LOSETUP} ${LOOPDEV} ${SDIMG}
${LOSETUP} ${LOOPDEV_BOOT} ${SDIMG} -o ${BOOT_OFFSET}
- /sbin/mkfs.msdos ${LOOPDEV_BOOT} -n boot $LOOPDEV_BLOCKS
+ /sbin/mkfs.msdos ${LOOPDEV_BOOT} -n ${BOOTPARTNAME} $LOOPDEV_BLOCKS
# Prepare filesystem partition
# Copy ubi used by flashing scripts
suffix=bin
fi
+ #cp -v ${IMAGE_ROOTFS}/boot/uEnv.txt ${WORKDIR}/tmp-mnt-boot || true
+ cp -v ${IMAGE_ROOTFS}/boot/user.txt ${WORKDIR}/tmp-mnt-boot || true
+
if [ -e ${IMAGE_ROOTFS}/boot/u-boot.$suffix ] ; then
- cp -v ${IMAGE_ROOTFS}/boot/{u-boot.$suffix,user.txt,uEnv.txt} ${WORKDIR}/tmp-mnt-boot || true
+ cp -v ${IMAGE_ROOTFS}/boot/{u-boot.$suffix} ${WORKDIR}/tmp-mnt-boot || true
else
cp -v ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.$suffix ${WORKDIR}/tmp-mnt-boot/u-boot.$suffix
fi
- # Deprecated, u-boot should load it from ext3 instead
- if [ -e ${IMAGE_ROOTFS}/boot/uImage ] ; then
- cp -v ${IMAGE_ROOTFS}/boot/uImage ${WORKDIR}/tmp-mnt-boot
- else
- cp -v ${DEPLOY_DIR_IMAGE}/uImage-${MACHINE}.bin ${WORKDIR}/tmp-mnt-boot/uImage
- fi
-
# Cleanup VFAT mount
echo "Cleaning up VFAT mount"
umount ${WORKDIR}/tmp-mnt-boot