diff options
Diffstat (limited to 'meta-fsl-arm/classes/sdcard_image.bbclass')
| -rw-r--r-- | meta-fsl-arm/classes/sdcard_image.bbclass | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/meta-fsl-arm/classes/sdcard_image.bbclass b/meta-fsl-arm/classes/sdcard_image.bbclass deleted file mode 100644 index 96f70808a..000000000 --- a/meta-fsl-arm/classes/sdcard_image.bbclass +++ /dev/null | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | # | ||
| 2 | # Create an image that can by written onto a SD card using dd. | ||
| 3 | # | ||
| 4 | # External variables needed: | ||
| 5 | # ${ROOTFS} - the rootfs image to incorporate | ||
| 6 | # ${IMAGE_BOOTLOADER} - bootloader to use {u-boot, barebox}x | ||
| 7 | |||
| 8 | inherit image | ||
| 9 | |||
| 10 | IMAGE_BOOTLOADER ?= "u-boot" | ||
| 11 | |||
| 12 | do_rootfs[depends] += "parted-native:do_populate_sysroot \ | ||
| 13 | virtual/kernel:do_deploy \ | ||
| 14 | ${IMAGE_BOOTLOADER}:do_deploy" | ||
| 15 | |||
| 16 | # Add the fstypes we need | ||
| 17 | IMAGE_FSTYPES += "sdimg" | ||
| 18 | |||
| 19 | # Default to 3.4GiB images | ||
| 20 | SDIMG_SIZE ?= "3400" | ||
| 21 | |||
| 22 | # Addional space for boot partition | ||
| 23 | BOOT_SPACE ?= "10M" | ||
| 24 | |||
| 25 | IMAGE_CMD_sdimg () { | ||
| 26 | TMP=${WORKDIR}/tmp | ||
| 27 | SDIMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.sdimg | ||
| 28 | |||
| 29 | dd if=/dev/zero of=${SDIMG} bs=$(expr 1000 \* 1000) count=${SDIMG_SIZE} | ||
| 30 | |||
| 31 | # Create partition table | ||
| 32 | parted -s ${SDIMG} mklabel msdos | ||
| 33 | parted -s ${SDIMG} mkpart primary ${BOOT_SPACE} 100% | ||
| 34 | parted ${SDIMG} print | ||
| 35 | |||
| 36 | case "${IMAGE_BOOTLOADER}" in | ||
| 37 | u-boot) | ||
| 38 | dd if=${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.bin of=${SDIMG} conv=notrunc seek=1 skip=1 bs=512 | ||
| 39 | dd if=${DEPLOY_DIR_IMAGE}/uImage-${MACHINE}.bin of=${SDIMG} conv=notrunc seek=1 bs=1M | ||
| 40 | ;; | ||
| 41 | barebox) | ||
| 42 | dd if=${DEPLOY_DIR_IMAGE}/barebox-${MACHINE}.bin of=${SDIMG} conv=notrunc seek=1 skip=1 bs=512 | ||
| 43 | dd if=${DEPLOY_DIR_IMAGE}/bareboxenv-${MACHINE}.bin of=${SDIMG} conv=notrunc seek=1 bs=512k | ||
| 44 | ;; | ||
| 45 | *) | ||
| 46 | bberror "Unkown IMAGE_BOOTLOADER value" | ||
| 47 | exit 1 | ||
| 48 | ;; | ||
| 49 | esac | ||
| 50 | |||
| 51 | dd if=${ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=${BOOT_SPACE} | ||
| 52 | |||
| 53 | cd ${DEPLOY_DIR_IMAGE} | ||
| 54 | ln -sf ${IMAGE_NAME}.sdimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.sdimg | ||
| 55 | } | ||
