diff options
Diffstat (limited to 'classes/sdcard_image-rpi-ota.bbclass')
-rw-r--r-- | classes/sdcard_image-rpi-ota.bbclass | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/classes/sdcard_image-rpi-ota.bbclass b/classes/sdcard_image-rpi-ota.bbclass index cb0c597..f5c35a2 100644 --- a/classes/sdcard_image-rpi-ota.bbclass +++ b/classes/sdcard_image-rpi-ota.bbclass | |||
@@ -72,6 +72,8 @@ SDIMG_OTA = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.rpi-sdimg-ota" | |||
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. |
73 | FATPAYLOAD ?= "" | 73 | FATPAYLOAD ?= "" |
74 | 74 | ||
75 | IMAGEDATESTAMP = "${@time.strftime('%Y.%m.%d',time.gmtime())}" | ||
76 | IMAGE_CMD_rpi-sdimg-ota[vardepsexclude] += "IMAGEDATESTAMP" | ||
75 | IMAGE_CMD_rpi-sdimg-ota[vardepsexclude] += "DATETIME" | 77 | IMAGE_CMD_rpi-sdimg-ota[vardepsexclude] += "DATETIME" |
76 | 78 | ||
77 | IMAGE_CMD_rpi-sdimg-ota () { | 79 | IMAGE_CMD_rpi-sdimg-ota () { |
@@ -123,8 +125,10 @@ IMAGE_CMD_rpi-sdimg-ota () { | |||
123 | # Copy device tree overlays to dedicated folder | 125 | # Copy device tree overlays to dedicated folder |
124 | mmd -i ${WORKDIR}/boot.img overlays | 126 | mmd -i ${WORKDIR}/boot.img overlays |
125 | for DTB in ${DT_OVERLAYS}; do | 127 | for DTB in ${DT_OVERLAYS}; do |
126 | DTB_BASE_NAME=`basename ${DTB} .dtb` | 128 | DTB_EXT=${DTB##*.} |
127 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::overlays/${DTB_BASE_NAME}.dtbo | 129 | DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"` |
130 | |||
131 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.${DTB_EXT} ::overlays/${DTB_BASE_NAME}.${DTB_EXT} | ||
128 | done | 132 | done |
129 | fi | 133 | fi |
130 | 134 | ||
@@ -145,6 +149,10 @@ IMAGE_CMD_rpi-sdimg-ota () { | |||
145 | done | 149 | done |
146 | fi | 150 | fi |
147 | 151 | ||
152 | # Add stamp file | ||
153 | echo "${IMAGE_NAME}-${IMAGEDATESTAMP}" > ${WORKDIR}/image-version-info | ||
154 | mcopy -i ${WORKDIR}/boot.img -v ${WORKDIR}//image-version-info :: | ||
155 | |||
148 | # Burn Partitions | 156 | # Burn Partitions |
149 | sync | 157 | sync |
150 | dd if=${WORKDIR}/boot.img of=${SDIMG_OTA} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync | 158 | dd if=${WORKDIR}/boot.img of=${SDIMG_OTA} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync |
@@ -171,6 +179,9 @@ IMAGE_CMD_rpi-sdimg-ota () { | |||
171 | xz -k "${SDIMG_OTA}" | 179 | xz -k "${SDIMG_OTA}" |
172 | ;; | 180 | ;; |
173 | esac | 181 | esac |
182 | |||
183 | rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.rpi-sdimg-ota | ||
184 | ln -s ${IMAGE_NAME}.rootfs.rpi-sdimg-ota ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.rpi-sdimg-ota | ||
174 | } | 185 | } |
175 | 186 | ||
176 | ROOTFS_POSTPROCESS_COMMAND += " rpi_generate_sysctl_config ; " | 187 | ROOTFS_POSTPROCESS_COMMAND += " rpi_generate_sysctl_config ; " |