summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/sdcard_image-rpi.bbclass20
1 files changed, 20 insertions, 0 deletions
diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass
index a2fcd52..3ee4e94 100644
--- a/classes/sdcard_image-rpi.bbclass
+++ b/classes/sdcard_image-rpi.bbclass
@@ -50,6 +50,13 @@ IMAGE_DEPENDS_rpi-sdimg = " \
50# SD card image name 50# SD card image name
51SDIMG = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.rpi-sdimg" 51SDIMG = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.rpi-sdimg"
52 52
53# Compression method to apply to SDIMG after it has been created. Supported
54# compression formats are "gzip", "bzip2" or "xz". The original .rpi-sdimg file
55# is kept and a new compressed file is created if one of these compression
56# formats is chosen. If SDIMG_COMPRESSION is set to any other value it is
57# silently ignored.
58#SDIMG_COMPRESSION ?= ""
59
53# Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS. 60# Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS.
54FATPAYLOAD ?= "" 61FATPAYLOAD ?= ""
55 62
@@ -107,6 +114,19 @@ IMAGE_CMD_rpi-sdimg () {
107 else 114 else
108 dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync 115 dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
109 fi 116 fi
117
118 # Optionally apply compression
119 case "${SDIMG_COMPRESSION}" in
120 "gzip")
121 gzip -k9 "${SDIMG}"
122 ;;
123 "bzip2")
124 bzip2 -k9 "${SDIMG}"
125 ;;
126 "xz")
127 xz -k "${SDIMG}"
128 ;;
129 esac
110} 130}
111 131
112ROOTFS_POSTPROCESS_COMMAND += " rpi_generate_sysctl_config ; " 132ROOTFS_POSTPROCESS_COMMAND += " rpi_generate_sysctl_config ; "