diff options
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | classes/sdcard_image-rpi.bbclass | 20 |
2 files changed, 22 insertions, 0 deletions
@@ -112,6 +112,8 @@ How to use it: | |||
112 | IMAGE_FSTYPES = "tar.bz2 ext3.xz rpi-sdimg.xz | 112 | IMAGE_FSTYPES = "tar.bz2 ext3.xz rpi-sdimg.xz |
113 | 2. Overwrite SDIMG_ROOTFS_TYPE in local.conf | 113 | 2. Overwrite SDIMG_ROOTFS_TYPE in local.conf |
114 | SDIMG_ROOTFS_TYPE = "ext3.xz" | 114 | SDIMG_ROOTFS_TYPE = "ext3.xz" |
115 | 3. Overwrite SDIMG_COMPRESSION in local.conf | ||
116 | SDIMG_COMPRESSION = "xz" | ||
115 | *Accommodate the values above to your own needs (ex: ext3 / ext4). | 117 | *Accommodate the values above to your own needs (ex: ext3 / ext4). |
116 | 118 | ||
117 | 2.B. Optional - GPU memory: | 119 | 2.B. Optional - GPU memory: |
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 |
51 | SDIMG = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.rpi-sdimg" | 51 | SDIMG = "${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. |
54 | FATPAYLOAD ?= "" | 61 | FATPAYLOAD ?= "" |
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 | ||
112 | ROOTFS_POSTPROCESS_COMMAND += " rpi_generate_sysctl_config ; " | 132 | ROOTFS_POSTPROCESS_COMMAND += " rpi_generate_sysctl_config ; " |