Merge "sdcard_image-rpi.bbclass: Allow optional compression"

This commit is contained in:
Andrei Gherzan 2013-11-13 13:51:28 +00:00 committed by Gherzan Code Review
commit 184fa20444
2 changed files with 22 additions and 0 deletions

2
README
View File

@ -112,6 +112,8 @@ How to use it:
IMAGE_FSTYPES = "tar.bz2 ext3.xz rpi-sdimg.xz
2. Overwrite SDIMG_ROOTFS_TYPE in local.conf
SDIMG_ROOTFS_TYPE = "ext3.xz"
3. Overwrite SDIMG_COMPRESSION in local.conf
SDIMG_COMPRESSION = "xz"
*Accommodate the values above to your own needs (ex: ext3 / ext4).
2.B. Optional - GPU memory:

View File

@ -50,6 +50,13 @@ IMAGE_DEPENDS_rpi-sdimg = " \
# SD card image name
SDIMG = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.rpi-sdimg"
# Compression method to apply to SDIMG after it has been created. Supported
# compression formats are "gzip", "bzip2" or "xz". The original .rpi-sdimg file
# is kept and a new compressed file is created if one of these compression
# formats is chosen. If SDIMG_COMPRESSION is set to any other value it is
# silently ignored.
#SDIMG_COMPRESSION ?= ""
# Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS.
FATPAYLOAD ?= ""
@ -107,6 +114,19 @@ IMAGE_CMD_rpi-sdimg () {
else
dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
fi
# Optionally apply compression
case "${SDIMG_COMPRESSION}" in
"gzip")
gzip -k9 "${SDIMG}"
;;
"bzip2")
bzip2 -k9 "${SDIMG}"
;;
"xz")
xz -k "${SDIMG}"
;;
esac
}
ROOTFS_POSTPROCESS_COMMAND += " rpi_generate_sysctl_config ; "