diff options
| author | Andrei Gherzan <andrei@gherzan.ro> | 2013-11-13 13:51:28 +0000 |
|---|---|---|
| committer | Gherzan Code Review <gerrit2@gherzan.ro> | 2013-11-13 13:51:28 +0000 |
| commit | 184fa20444607c0422e0e36550a03c69f7de2493 (patch) | |
| tree | 9b438137e5e1c2f6aa9ccba964d4ec781b665c31 /classes/sdcard_image-rpi.bbclass | |
| parent | fef11f98cf62a9f21472a42382d1ebab37eee806 (diff) | |
| parent | 164e87c29133b58450e218c596ebd3a9d2bace5e (diff) | |
| download | meta-raspberrypi-184fa20444607c0422e0e36550a03c69f7de2493.tar.gz | |
Merge "sdcard_image-rpi.bbclass: Allow optional compression"
Diffstat (limited to 'classes/sdcard_image-rpi.bbclass')
| -rw-r--r-- | classes/sdcard_image-rpi.bbclass | 20 |
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 |
| 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 ; " |
