index 9aed4f846b40391772206f373d9881961c0faf47..2bbf4c47cf61fa6e9f8ae3ccb524fa8080f8dda8 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 ?= "${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/{user.txt,uEnv.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