diff options
Diffstat (limited to 'meta-fsl-arm/classes/sdcard_image.bbclass')
| -rw-r--r-- | meta-fsl-arm/classes/sdcard_image.bbclass | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/meta-fsl-arm/classes/sdcard_image.bbclass b/meta-fsl-arm/classes/sdcard_image.bbclass index 5887240ae..96f70808a 100644 --- a/meta-fsl-arm/classes/sdcard_image.bbclass +++ b/meta-fsl-arm/classes/sdcard_image.bbclass | |||
| @@ -3,15 +3,19 @@ | |||
| 3 | # | 3 | # |
| 4 | # External variables needed: | 4 | # External variables needed: |
| 5 | # ${ROOTFS} - the rootfs image to incorporate | 5 | # ${ROOTFS} - the rootfs image to incorporate |
| 6 | # ${IMAGE_BOOTLOADER} - bootloader to use {u-boot, barebox}x | ||
| 6 | 7 | ||
| 7 | inherit image | 8 | inherit image |
| 8 | 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 | |||
| 9 | # Add the fstypes we need | 16 | # Add the fstypes we need |
| 10 | IMAGE_FSTYPES += "sdimg" | 17 | IMAGE_FSTYPES += "sdimg" |
| 11 | 18 | ||
| 12 | # Ensure required utilities are present | ||
| 13 | IMAGE_DEPENDS_sdimg = "parted-native" | ||
| 14 | |||
| 15 | # Default to 3.4GiB images | 19 | # Default to 3.4GiB images |
| 16 | SDIMG_SIZE ?= "3400" | 20 | SDIMG_SIZE ?= "3400" |
| 17 | 21 | ||
| @@ -29,8 +33,21 @@ IMAGE_CMD_sdimg () { | |||
| 29 | parted -s ${SDIMG} mkpart primary ${BOOT_SPACE} 100% | 33 | parted -s ${SDIMG} mkpart primary ${BOOT_SPACE} 100% |
| 30 | parted ${SDIMG} print | 34 | parted ${SDIMG} print |
| 31 | 35 | ||
| 32 | dd if=${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.bin of=${SDIMG} conv=notrunc seek=1 skip=1 bs=512 | 36 | case "${IMAGE_BOOTLOADER}" in |
| 33 | dd if=${DEPLOY_DIR_IMAGE}/uImage-${MACHINE}.bin of=${SDIMG} conv=notrunc seek=1 bs=1M | 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 | |||
| 34 | dd if=${ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=${BOOT_SPACE} | 51 | dd if=${ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=${BOOT_SPACE} |
| 35 | 52 | ||
| 36 | cd ${DEPLOY_DIR_IMAGE} | 53 | cd ${DEPLOY_DIR_IMAGE} |
