summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorMatthew McClintock <msm-oss@mcclintock.net>2017-06-14 13:24:20 -0500
committerMatthew McClintock <msm-oss@mcclintock.net>2017-06-21 10:54:32 -0500
commita6bb80c935f23dc96a0ca4725fd554d92f637452 (patch)
treeae5d4b595bd07edf9a84a1148d4d3fd684e55d4b /classes
parent11fec461330982ee15b4ac6dca5014fabe59198f (diff)
downloadmeta-raspberrypi-a6bb80c935f23dc96a0ca4725fd554d92f637452.tar.gz
sdcard_image-rpi.bbclass: deploy vfat partition
This is useful to update the bootloader/vfat partition from u-boot when you don't want to update everything: U-Boot> tftpboot 0x1000000 tmp/0VXje Waiting for Ethernet connection... done. Using sms0 device TFTP from server 192.168.0.1; our IP address is 192.168.0.26 Filename 'image.vfat'. Load address: 0x1000000 Loading: ################################################## 40 MiB 2.1 MiB/s done Bytes transferred = 41943040 (2800000 hex) U-Boot> mmc part Partition Map for MMC device 0 -- Partition Type: DOS Part Start Sector Num Sectors UUID Type 1 8192 81920 a63a4fbc-01 0c Boot 2 90112 163840 a63a4fbc-02 83 U-Boot> mmc erase 0x2000 0x14000 MMC erase: dev # 0, block # 8192, count 81920 ... 81920 blocks erased: OK U-Boot> mmc write 0x1000000 0x2000 0x14000 MMC write: dev # 0, block # 8192, count 81920 ... 81920 blocks written: OK U-Boot> Signed-off-by: Matthew McClintock <msm-oss@mcclintock.net>
Diffstat (limited to 'classes')
-rw-r--r--classes/sdcard_image-rpi.bbclass14
1 files changed, 14 insertions, 0 deletions
diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass
index af3e807..56f96f5 100644
--- a/classes/sdcard_image-rpi.bbclass
+++ b/classes/sdcard_image-rpi.bbclass
@@ -72,6 +72,10 @@ SDIMG = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.rpi-sdimg"
72# Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS. 72# Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS.
73FATPAYLOAD ?= "" 73FATPAYLOAD ?= ""
74 74
75# SD card vfat partition image name
76SDIMG_VFAT = "${IMGDEPLOYDIR}/${IMAGE_NAME}.vfat"
77SDIMG_LINK_VFAT = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.vfat"
78
75IMAGE_CMD_rpi-sdimg () { 79IMAGE_CMD_rpi-sdimg () {
76 80
77 # Align partitions 81 # Align partitions
@@ -145,6 +149,16 @@ IMAGE_CMD_rpi-sdimg () {
145 echo "${IMAGE_NAME}" > ${WORKDIR}/image-version-info 149 echo "${IMAGE_NAME}" > ${WORKDIR}/image-version-info
146 mcopy -i ${WORKDIR}/boot.img -v ${WORKDIR}/image-version-info :: 150 mcopy -i ${WORKDIR}/boot.img -v ${WORKDIR}/image-version-info ::
147 151
152 # Deploy vfat partition (for u-boot case only)
153 case "${KERNEL_IMAGETYPE}" in
154 "uImage")
155 cp ${WORKDIR}/boot.img ${SDIMG_VFAT}
156 ln -sf ${SDIMG_VFAT} ${SDIMG_LINK_VFAT}
157 ;;
158 *)
159 ;;
160 esac
161
148 # Burn Partitions 162 # Burn Partitions
149 dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync 163 dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
150 # If SDIMG_ROOTFS_TYPE is a .xz file use xzcat 164 # If SDIMG_ROOTFS_TYPE is a .xz file use xzcat