Merge lp:~oem-solutions-releng/live-build/lb-sg-2.x-add-support-for-xz-and-bzip2-compression into lp:~ce-infrastructure/live-build/lb-sg-2.x

Proposed by Timothy R. Chavez
Status: Merged
Approved by: Kevin McDermott
Approved revision: 1607
Merged at revision: 1604
Proposed branch: lp:~oem-solutions-releng/live-build/lb-sg-2.x-add-support-for-xz-and-bzip2-compression
Merge into: lp:~ce-infrastructure/live-build/lb-sg-2.x
Diff against target: 160 lines (+68/-8)
5 files modified
debian/changelog (+11/-0)
functions/defaults.sh (+7/-0)
scripts/build/lb_binary_tar (+18/-2)
scripts/build/lb_config (+10/-0)
scripts/build/lb_source_tar (+22/-6)
To merge this branch: bzr merge lp:~oem-solutions-releng/live-build/lb-sg-2.x-add-support-for-xz-and-bzip2-compression
Reviewer Review Type Date Requested Status
Kevin McDermott (community) Approve
Review via email: mp+143373@code.launchpad.net

Description of the change

Add support for compressing tar images (binary and source) with 'xz' or 'bzip2'. This work adds the LB_COMPRESSION variable (which is compatible with live-build 3.x) as a way to specify which compression type is desired. If LB_COMPRESSION is not specified, it will default to 'gzip', which is the default compression type used today. Functional verification testing has been done for the following scenarios:

 - Default (not specifying LB_COMPRESSION)
 - LB_COMPRESSION="xz"
 - LB_COMPRESSION="bzip2"

Premium team confirmed that one of their images compress with xz could be decompressed and flashed to a system successfully.

To post a comment you must log in.
1607. By Timothy R. Chavez

Remove the bit of changelog that is no longer relevant, since the functionality was removed.

Revision history for this message
Kevin McDermott (bigkevmcd) wrote :

Looks ok to me, bash syntax notwithstanding :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2012-12-04 07:41:01 +0000
+++ debian/changelog 2013-01-15 18:13:28 +0000
@@ -1,3 +1,14 @@
1live-build (2.0.12-2cesg12) lucid; urgency=low
2
3 * functions/defaults.sh,
4 scripts/build/lb_binary_tar,
5 scripts/build/lb_config,
6 scripts/build/lb_source_tar
7 - Backport LB_COMPRESSION from live-build-3.0~b5-1 to support bzip2 and xz
8 compression
9
10 -- Timothy Chavez <timothy.chavez@canonical.com> Thu, 10 Jan 2013 09:36:13 -0600
11
1live-build (2.0.12-2cesg11) lucid; urgency=low12live-build (2.0.12-2cesg11) lucid; urgency=low
213
3 * scripts/build/lb_config: Avoid GENISOIMAGE_OPTIONS_EXTRA being erased when14 * scripts/build/lb_config: Avoid GENISOIMAGE_OPTIONS_EXTRA being erased when
415
=== modified file 'functions/defaults.sh'
--- functions/defaults.sh 2012-11-15 15:34:57 +0000
+++ functions/defaults.sh 2013-01-15 18:13:28 +0000
@@ -72,6 +72,8 @@
72 APT_OPTIONS="${APT_OPTIONS:---yes}"72 APT_OPTIONS="${APT_OPTIONS:---yes}"
73 APTITUDE_OPTIONS="${APTITUDE_OPTIONS:---assume-yes}"73 APTITUDE_OPTIONS="${APTITUDE_OPTIONS:---assume-yes}"
7474
75 BZIP2_OPTIONS="${BZIP2_OPTIONS:--6}"
76
75 GZIP_OPTIONS="${GZIP_OPTIONS:---fast}"77 GZIP_OPTIONS="${GZIP_OPTIONS:---fast}"
7678
77 if gzip --help | grep -qs "\-\-rsyncable"79 if gzip --help | grep -qs "\-\-rsyncable"
@@ -79,6 +81,8 @@
79 GZIP_OPTIONS="$(echo ${GZIP_OPTIONS} | sed -e 's|--rsyncable||') --rsyncable"81 GZIP_OPTIONS="$(echo ${GZIP_OPTIONS} | sed -e 's|--rsyncable||') --rsyncable"
80 fi82 fi
8183
84 XZ_OPTIONS="${XZ_OPTIONS:--6}"
85
82 # Setting apt recommends86 # Setting apt recommends
83 case "${LB_MODE}" in87 case "${LB_MODE}" in
84 debian|debian-release|ubuntu)88 debian|debian-release|ubuntu)
@@ -870,6 +874,9 @@
870 # Setting checksums874 # Setting checksums
871 LB_CHECKSUMS="${LB_CHECKSUMS:-md5}"875 LB_CHECKSUMS="${LB_CHECKSUMS:-md5}"
872876
877 # Setting compression type
878 LB_COMPRESSION="${LB_COMPRESSION:-gzip}"
879
873 # Setting chroot option880 # Setting chroot option
874 LB_BUILD_WITH_CHROOT="${LB_BUILD_WITH_CHROOT:-true}"881 LB_BUILD_WITH_CHROOT="${LB_BUILD_WITH_CHROOT:-true}"
875882
876883
=== modified file 'scripts/build/lb_binary_tar'
--- scripts/build/lb_binary_tar 2011-03-09 18:17:33 +0000
+++ scripts/build/lb_binary_tar 2013-01-15 18:13:28 +0000
@@ -44,10 +44,26 @@
44Create_lockfile .lock44Create_lockfile .lock
4545
46# Remove old binary46# Remove old binary
47rm -f binary.tar.gz47rm -f binary.tar.bz2 binary.tar.gz binary.tar.xz binary.tar
4848
49tar cf binary-tar.tar binary49tar cf binary-tar.tar binary
50gzip ${GZIP_OPTIONS} binary-tar.tar50
51case "${LB_COMPRESSION}" in
52 bzip2)
53 bzip2 ${BZIP2_OPTIONS} binary-tar.tar
54 ;;
55
56 gzip)
57 gzip ${GZIP_OPTIONS} binary-tar.tar
58 ;;
59
60 xz)
61 xz ${XZ_OPTIONS} binary-tar.tar
62 ;;
63
64 none)
65 ;;
66esac
5167
52# Creating stage file68# Creating stage file
53Create_stagefile .stage/binary_tar69Create_stagefile .stage/binary_tar
5470
=== modified file 'scripts/build/lb_config'
--- scripts/build/lb_config 2012-12-04 07:41:01 +0000
+++ scripts/build/lb_config 2013-01-15 18:13:28 +0000
@@ -54,6 +54,7 @@
54\t [--cache-packages true|false]\n\54\t [--cache-packages true|false]\n\
55\t [--cache-stages STAGE|\"STAGES\"]\n\55\t [--cache-stages STAGE|\"STAGES\"]\n\
56\t [--checksums md5|sha1|sha256|none]\n\56\t [--checksums md5|sha1|sha256|none]\n\
57\t [--compression bzip2|gzip|xz|none]\n\
57\t [--build-with-chroot true|false]\n\58\t [--build-with-chroot true|false]\n\
58\t [--chroot-filesystem ext2|ext3|squashfs|plain|jffs2]\n\59\t [--chroot-filesystem ext2|ext3|squashfs|plain|jffs2]\n\
59\t [--clean]\n\60\t [--clean]\n\
@@ -573,6 +574,11 @@
573 shift 2574 shift 2
574 ;;575 ;;
575576
577 --compression)
578 LB_COMPRESSION="${2}"
579 shift 2
580 ;;
581
576 --build-with-chroot)582 --build-with-chroot)
577 LB_BUILD_WITH_CHROOT="${2}"583 LB_BUILD_WITH_CHROOT="${2}"
578 shift 2584 shift 2
@@ -1185,6 +1191,10 @@
1185# (Default: ${LB_CHECKSUMS})1191# (Default: ${LB_CHECKSUMS})
1186LB_CHECKSUMS="${LB_CHECKSUMS}"1192LB_CHECKSUMS="${LB_CHECKSUMS}"
11871193
1194# \$LB_COMPRESSION: set compression
1195# (Default: ${LB_COMPRESSION})
1196LB_COMPRESSION="${LB_COMPRESSION}"
1197
1188# \${LB_BUILD_WITH_CHROOT: control if we build binary images chrooted1198# \${LB_BUILD_WITH_CHROOT: control if we build binary images chrooted
1189# (Default: ${LB_BUILD_WITH_CHROOT})1199# (Default: ${LB_BUILD_WITH_CHROOT})
1190# DO NEVER, *NEVER*, *N*E*V*E*R* SET THIS OPTION to false.1200# DO NEVER, *NEVER*, *N*E*V*E*R* SET THIS OPTION to false.
11911201
=== modified file 'scripts/build/lb_source_tar'
--- scripts/build/lb_source_tar 2011-03-09 18:17:33 +0000
+++ scripts/build/lb_source_tar 2013-01-15 18:13:28 +0000
@@ -50,15 +50,31 @@
50Create_lockfile .lock50Create_lockfile .lock
5151
52# Remove old source52# Remove old source
53rm -f source.debian.tar.gz53rm -f source.debian.tar.bz2 source.debian.tar.gz source.debian.tar.xz source.debian.tar
54rm -f source.debian-live.tar.gz54rm -f source.debian-live.tar.bz2 source.debian-live.tar.gz source.debian-live.tar.xz source.debian-live.tar
5555
56# Create tarballs
57tar cf source.debian.tar source/debian56tar cf source.debian.tar source/debian
58gzip ${GZIP_OPTIONS} source.debian.tar
59
60tar cf source.debian-live.tar source/debian-live57tar cf source.debian-live.tar source/debian-live
61gzip ${GZIP_OPTIONS} source.debian-live.tar58
59case "${LB_COMPRESSION}" in
60 bzip2)
61 bzip2 ${BZIP2_OPTIONS} source.debian.tar
62 bzip2 ${BZIP2_OPTIONS} source.debian-live.tar
63 ;;
64
65 gzip)
66 gzip ${GZIP_OPTIONS} source.debian.tar
67 gzip ${GZIP_OPTIONS} source.debian-live.tar
68 ;;
69
70 xz)
71 xz ${XZ_OPTIONS} source.debian.tar
72 xz ${XZ_OPTIONS} source.debian-live.tar
73 ;;
74
75 none)
76 ;;
77esac
6278
63# Creating stage file79# Creating stage file
64Create_stagefile .stage/source_tar80Create_stagefile .stage/source_tar

Subscribers

People subscribed via source and target branches