diff options
author | Thore Sommer <debian@thson.de> | 2020-10-07 23:25:22 +0200 |
---|---|---|
committer | Luca Boccassi <bluca@debian.org> | 2020-10-12 13:35:16 +0000 |
commit | 9a26533a06a8892b4014d86fe0c9d9e3b08ae1e5 (patch) | |
tree | b7a9a535c5bcd3b66a6a4d8d21f64e103f78922e /scripts | |
parent | ce39f3e507a8d03b1c986c400d797f13f82ae9d5 (diff) | |
download | vyos-live-build-9a26533a06a8892b4014d86fe0c9d9e3b08ae1e5.tar.gz vyos-live-build-9a26533a06a8892b4014d86fe0c9d9e3b08ae1e5.zip |
Add option to change compression algorithm and level for squashfs.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/binary_rootfs | 13 | ||||
-rwxr-xr-x | scripts/build/config | 23 |
2 files changed, 33 insertions, 3 deletions
diff --git a/scripts/build/binary_rootfs b/scripts/build/binary_rootfs index a81c21fd5..5934ad672 100755 --- a/scripts/build/binary_rootfs +++ b/scripts/build/binary_rootfs @@ -287,7 +287,18 @@ case "${LB_CHROOT_FILESYSTEM}" in esac fi - MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -comp xz" + # Set squashfs compression type or default to xz + if [ -n "${LB_CHROOT_SQUASHFS_COMPRESSION_TYPE}" ] + then + MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -comp ${LB_CHROOT_SQUASHFS_COMPRESSION_TYPE}" + else + MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -comp xz" + fi + + if [ -n "${LB_CHROOT_SQUASHFS_COMPRESSION_LEVEL}" ] + then + MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -Xcompression-level ${LB_CHROOT_SQUASHFS_COMPRESSION_LEVEL}" + fi case "${LB_BUILD_WITH_CHROOT}" in true) diff --git a/scripts/build/config b/scripts/build/config index 2bd929bc1..4f2a53538 100755 --- a/scripts/build/config +++ b/scripts/build/config @@ -46,6 +46,8 @@ USAGE="${PROGRAM} [--apt apt|apt-get|aptitude]\n\ \t [--cache-stages STAGE|\"STAGES\"]\n\ \t [--checksums md5|sha1|sha224|sha256|sha384|sha512|none]\n\ \t [--chroot-filesystem ext2|ext3|ext4|squashfs|jffs2|none]\n\ +\t [--chroot-squashfs-compression-level LEVEL]\n\ +\t [--chroot-squashfs-compression-type gzip|lzma|lzo|lz4|xz|zstd]\n\ \t [--clean]\n\ \t [--color]\n\ \t [--compression bzip2|gzip|lzip|xz|none]\n\ @@ -138,8 +140,9 @@ Local_arguments () bootloader:,bootloaders:,bootstrap-qemu-arch:,bootstrap-qemu-exclude:, bootstrap-qemu-static:,breakpoints,build-with-chroot:, cache:,cache-indices:,cache-packages:,cache-stages:,checksums:, - chroot-filesystem:,clean,color,compression:,conffile:,config:, - debconf-frontend:,debconf-priority:,debian-installer:, + chroot-filesystem:,chroot-squashfs-compression-level:, + chroot-squashfs-compression-type:,clean,color,compression:,conffile:, + config:,debconf-frontend:,debconf-priority:,debian-installer:, debian-installer-distribution:,debian-installer-gui:, debian-installer-preseedfile:,debootstrap-options:,debootstrap-script:, debug,distribution:,distribution-binary:,distribution-chroot:,dump, @@ -419,6 +422,16 @@ Local_arguments () shift 2 ;; + --chroot-squashfs-compression-level) + LB_CHROOT_SQUASHFS_COMPRESSION_LEVEL="${2}" + shift 2 + ;; + + --chroot-squashfs-compression-type) + LB_CHROOT_SQUASHFS_COMPRESSION_TYPE="${2}" + shift 2 + ;; + --compression) LB_COMPRESSION="${2}" shift 2 @@ -1136,6 +1149,12 @@ cat > config/chroot << EOF # Set chroot filesystem LB_CHROOT_FILESYSTEM="${LB_CHROOT_FILESYSTEM}" +# Set chroot squashfs compression level +LB_CHROOT_SQUASHFS_COMPRESSION_LEVEL="${LB_CHROOT_SQUASHFS_COMPRESSION_LEVEL}" + +# Set chroot squashfs compression type +LB_CHROOT_SQUASHFS_COMPRESSION_TYPE="${LB_CHROOT_SQUASHFS_COMPRESSION_TYPE}" + # Set union filesystem LB_UNION_FILESYSTEM="${LB_UNION_FILESYSTEM}" |