sdcard_image-rpi: Add support for u-boot and uImage

If KERNEL_IMAGETYPE is uImage, use u-boot image as kernel.img and copy uImage
too. Otherwise, use kernel image as kernel.img (as we did until now
unconditionally).

Change-Id: Iac46a57e4266299f2fe5746cb6957dcfc0e90443
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
This commit is contained in:
Andrei Gherzan 2014-01-20 01:00:52 +02:00
parent 7b1791f45f
commit d9ce376660

View File

@ -45,6 +45,7 @@ IMAGE_DEPENDS_rpi-sdimg = " \
dosfstools-native \
virtual/kernel \
${IMAGE_BOOTLOADER} \
${@base_contains("KERNEL_IMAGETYPE", "uImage", "u-boot", "",d)} \
"
# SD card image name
@ -91,7 +92,15 @@ IMAGE_CMD_rpi-sdimg () {
BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }')
mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::kernel.img
case "${KERNEL_IMAGETYPE}" in
"uImage")
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/u-boot.img ::kernel.img
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::uImage
;;
*)
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::kernel.img
;;
esac
if [ -n ${FATPAYLOAD} ] ; then
echo "Copying payload into VFAT"