Merge lp:~oem-solutions-releng/live-build/lb-sg-2.x-add-ext4-support into lp:~ce-infrastructure/live-build/lb-sg-2.x

Proposed by Timothy R. Chavez
Status: Merged
Merge reported by: Timothy R. Chavez
Merged at revision: not available
Proposed branch: lp:~oem-solutions-releng/live-build/lb-sg-2.x-add-ext4-support
Merge into: lp:~ce-infrastructure/live-build/lb-sg-2.x
Diff against target: 117 lines (+54/-7)
3 files modified
debian/changelog (+8/-1)
scripts/build/lb_binary_rootfs (+45/-5)
scripts/build/lb_config (+1/-1)
To merge this branch: bzr merge lp:~oem-solutions-releng/live-build/lb-sg-2.x-add-ext4-support
Reviewer Review Type Date Requested Status
Nicola Heald (community) Approve
Review via email: mp+150727@code.launchpad.net

Description of the change

Gives projects the ability to use ext4 (and implicitly ext3) filesystems via the LB_CHROOT_FILESYSTEM config setting.

To post a comment you must log in.
Revision history for this message
Nicola Heald (notnownikki) wrote :

Looks good to me, generated an ext4 fs when I tried it, so +1

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 2013-02-26 17:39:22 +0000
+++ debian/changelog 2013-02-27 06:33:20 +0000
@@ -1,10 +1,17 @@
1live-build (2.0.12-2cesg14) lucid; urgency=low1live-build (2.0.12-2cesg14) lucid; urgency=low
22
3 [ Mike Heald ]
3 * scripts/build/lb_binary_zsync4 * scripts/build/lb_binary_zsync
4 - Backported from live-build 3.x and added support for virtual-hdd, net, and tar5 - Backported from live-build 3.x and added support for virtual-hdd, net, and tar
5 binary images6 binary images
67
7 -- Mike Heald <mike.heald@canonical.com> Tue, 26 Feb 2013 16:46:46 -00008 [ Timothy Chavez ]
9 * scripts/build/lb_binary_rootfs:
10 - Added ext4 support by backporting it from 3.0.1-1
11 * scripts/build/lb_config:
12 - Added ext4 to --chroot-filesystem options list
13
14 -- Timothy Chavez <timothy.chavez@canonical.com> Wed, 27 Feb 2013 06:14:30 +0000
815
9live-build (2.0.12-2cesg13) lucid; urgency=low16live-build (2.0.12-2cesg13) lucid; urgency=low
1017
1118
=== modified file 'scripts/build/lb_binary_rootfs'
--- scripts/build/lb_binary_rootfs 2011-05-30 18:27:29 +0000
+++ scripts/build/lb_binary_rootfs 2013-02-27 06:33:20 +0000
@@ -79,9 +79,9 @@
79done79done
8080
81case "${LB_CHROOT_FILESYSTEM}" in81case "${LB_CHROOT_FILESYSTEM}" in
82 ext2|ext3)82 ext2|ext3|ext4)
83 # Checking depends83 # Checking depends
84 Check_package chroot/usr/bin/genext2fs genext2fs84 Check_package chroot/sbin/mkfs.${LB_CHROOT_FILESYSTEM} e2fsprogs
8585
86 # Restoring cache86 # Restoring cache
87 Restore_cache cache/packages_binary87 Restore_cache cache/packages_binary
@@ -95,14 +95,46 @@
95 rm -f binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}95 rm -f binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}
96 fi96 fi
9797
98 DU_DIM="$(du -ks chroot/chroot | cut -f1)"98 case "${LB_BUILD_WITH_CHROOT}" in
99 true)
100 DU_DIM="$(du -ms chroot/chroot | cut -f1)"
101 INODES="$(find chroot/chroot | wc -l)"
102 ;;
103
104 false)
105 DU_DIM="$(du -ms chroot | cut -f1)"
106 INODES="$(find chroot | wc -l)"
107 ;;
108 esac
109
99 REAL_DIM="$(Calculate_partition_size ${DU_DIM} ${LB_CHROOT_FILESYSTEM})"110 REAL_DIM="$(Calculate_partition_size ${DU_DIM} ${LB_CHROOT_FILESYSTEM})"
111 REAL_INODES="$(Calculate_partition_size ${INODES} ${LB_CHROOT_FILESYSTEM})"
100112
101 RESERVED_PERCENTAGE="--reserved-percentage"113 RESERVED_PERCENTAGE="--reserved-percentage"
102114
103 case "${LB_BUILD_WITH_CHROOT}" in115 case "${LB_BUILD_WITH_CHROOT}" in
104 true)116 true)
105 Chroot chroot "genext2fs --size-in-blocks=${REAL_DIM} ${RESERVED_PERCENTAGE}=0 --root=chroot filesystem.${LB_CHROOT_FILESYSTEM}"117 dd if=/dev/zero of=chroot/filesystem.${LB_CHROOT_FILESYSTEM} bs=1024k count=0 seek=${REAL_DIM}
118
119 if ! Chroot chroot "test -s /etc/mtab"
120 then
121 Chroot chroot "ln -s /proc/mounts/mtab /etc/mtab"
122 FAKE_MTAB="true"
123 fi
124
125 Chroot chroot "mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -N ${REAL_INODES} -m 0 filesystem.${LB_CHROOT_FILESYSTEM}"
126
127 mkdir -p filesystem.tmp
128 ${LB_ROOT_COMMAND} mount -o loop chroot/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
129 cp -a chroot/chroot/* filesystem.tmp
130
131 if [ "${FAKE_MTAB}" = "true" ]
132 then
133 Chroot chroot "rm -f /etc/mtab"
134 fi
135
136 ${LB_ROOT_COMMAND} umount filesystem.tmp
137 rmdir filesystem.tmp
106138
107 # Move image139 # Move image
108 mv chroot/filesystem.${LB_CHROOT_FILESYSTEM} binary/${INITFS}140 mv chroot/filesystem.${LB_CHROOT_FILESYSTEM} binary/${INITFS}
@@ -161,7 +193,15 @@
161 ;;193 ;;
162194
163 false)195 false)
164 genext2fs --size-in-blocks=${REAL_DIM} ${RESERVED_PERCENTAGE}=0 --root=chroot binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}196 dd if=/dev/zero of=binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM} bs=1024k count=0 seek=${REAL_DIM}
197 mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -N ${REAL_INODES} -m 0 binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}
198
199 mkdir -p filesystem.tmp
200 ${LB_ROOT_COMMAND} mount -o loop binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
201 cp -a chroot/* filesystem.tmp
202
203 ${LB_ROOT_COMMAND} umount filesystem.tmp
204 rmdir filesystem.tmp
165 ;;205 ;;
166 esac206 esac
167207
168208
=== modified file 'scripts/build/lb_config'
--- scripts/build/lb_config 2013-02-22 17:38:29 +0000
+++ scripts/build/lb_config 2013-02-27 06:33:20 +0000
@@ -57,7 +57,7 @@
57\t [--compression bzip2|gzip|xz|none]\n\57\t [--compression bzip2|gzip|xz|none]\n\
58\t [--zsync true|false]\n\58\t [--zsync true|false]\n\
59\t [--build-with-chroot true|false]\n\59\t [--build-with-chroot true|false]\n\
60\t [--chroot-filesystem ext2|ext3|squashfs|plain|jffs2]\n\60\t [--chroot-filesystem ext2|ext3|ext4|squashfs|plain|jffs2]\n\
61\t [--clean]\n\61\t [--clean]\n\
62\t [-c|--conffile FILE]\n\62\t [-c|--conffile FILE]\n\
63\t [--debconf-frontend dialog|editor|noninteractive|readline]\n\63\t [--debconf-frontend dialog|editor|noninteractive|readline]\n\

Subscribers

People subscribed via source and target branches