Compare commits

...

15 Commits

Author SHA1 Message Date
Steve Langasek
8191cbfa4a releasing package livecd-rootfs version 2.441.7 2017-09-13 12:48:31 -07:00
Steve Langasek
81b7fc6862 Restore the call to 'umount -R $mountpoint' from umount_partition,
accidentally dropped in previous upload.
2017-09-13 12:48:27 -07:00
Steve Langasek
6919b668ae releasing package livecd-rootfs version 2.441.6 2017-09-13 12:13:12 -07:00
Steve Langasek
e513917862 Also adjust live-build/ubuntu-server/hooks/032-installer-squashfs.binary
to use teardown_mountpoint.
2017-09-13 12:13:08 -07:00
Steve Langasek
9165a7dd8a Merge lp:~rcj/livecd-rootfs/zesty-proposed 2017-09-13 12:11:15 -07:00
Robert C Jennings
5089e589ef live-build/ubuntu-cpc/functions: Add teardown_mountpoint to reverse setup_mountpoint
* live-build/ubuntu-cpc/functions: Add a function, teardown_mountpoint,
  to reverse the work done in setup_mountpoint.  Lack of this function
  has forced users of setup_mountpoint to implement this separately
  and the implementations have diverged. (LP: #1716992)
* live-build/ubuntu-cpc/functions: Remove umount_settle function.
  The was only used where teardown_mountpoint was lacking.
2017-09-13 13:37:25 -05:00
Steve Langasek
0259fee5dc releasing package livecd-rootfs version 2.441.5 2017-09-11 12:00:02 -07:00
Steve Langasek
91bde498cb Fix suppression of kpartx error. LP: #1684090. 2017-09-11 11:59:56 -07:00
Steve Langasek
af5510caf9 Mount and unmount /dev recursively, to cope with setups where there are
interesting bind-mounts under /dev (e.g. loop devices bind-mounted by
LXD).  LP: #1716465.
2017-09-11 11:51:09 -07:00
Steve Langasek
0129af508b releasing package livecd-rootfs version 2.441.4 2017-06-06 23:09:32 -07:00
Steve Langasek
60971f3ed3 changelog cleanup for SRU 2017-06-06 23:08:28 -07:00
Steve Langasek
5a068b569d Merge lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix-for-zesty 2017-05-12 11:58:54 -07:00
Robert C Jennings
8c0354d18c live-build/ubuntu-cpc/hooks/999-extras.binary: Exit on first failure.
(LP: #1687752)
2017-05-12 11:56:40 -07:00
Steve Langasek
1b95302ef7 Resurrect Balint's fix from
lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix to wrap kpartx
and trap spurious errors, since the problem is still being seen
intermittently on i386 despite us calling sync before kpartx. (LP: #1684090)
2017-05-11 15:31:29 +02:00
Steve Langasek
8b141ef85a Mark autopkgtests isolation-machine since debootstrap won't work in a
container.
2017-05-08 21:04:47 +02:00
6 changed files with 91 additions and 34 deletions

54
debian/changelog vendored
View File

@ -1,3 +1,57 @@
livecd-rootfs (2.441.7) zesty; urgency=medium
* Restore the call to 'umount -R $mountpoint' from umount_partition,
accidentally dropped in previous upload.
-- Steve Langasek <steve.langasek@ubuntu.com> Wed, 13 Sep 2017 12:48:29 -0700
livecd-rootfs (2.441.6) zesty; urgency=medium
[ Robert C Jennings ]
* live-build/ubuntu-cpc/functions: Add a function, teardown_mountpoint,
to reverse the work done in setup_mountpoint. Lack of this function
has forced users of setup_mountpoint to implement this separately
and the implementations have diverged. (LP: #1716992)
* live-build/ubuntu-cpc/functions: Remove umount_settle function.
The was only used where teardown_mountpoint was lacking.
[ Steve Langasek ]
* Also adjust live-build/ubuntu-server/hooks/032-installer-squashfs.binary
to use teardown_mountpoint.
-- Steve Langasek <steve.langasek@ubuntu.com> Wed, 13 Sep 2017 12:13:10 -0700
livecd-rootfs (2.441.5) zesty; urgency=medium
[ Colin Watson ]
* Mount and unmount /dev recursively, to cope with setups where there are
interesting bind-mounts under /dev (e.g. loop devices bind-mounted by
LXD). LP: #1716465.
[ Balint Reczey ]
* Fix suppression of kpartx error. LP: #1684090.
-- Steve Langasek <steve.langasek@ubuntu.com> Mon, 11 Sep 2017 11:59:59 -0700
livecd-rootfs (2.441.4) zesty; urgency=medium
[ Balint Reczey ]
* wrap kpartx and trap spurious errors, to work around kpartx
unreliability as seen in autopkgtests. (LP: #1684090)
[ Steve Langasek ]
* Mark autopkgtests isolation-machine since debootstrap won't work in a
container.
-- Steve Langasek <steve.langasek@ubuntu.com> Tue, 06 Jun 2017 23:09:10 -0700
livecd-rootfs (2.441.3) zesty; urgency=medium
* live-build/ubuntu-cpc/hooks/999-extras.binary: Exit on first failure.
(LP: #1687752)
-- Robert C Jennings <robert.jennings@canonical.com> Tue, 09 May 2017 13:46:01 -0700
livecd-rootfs (2.441.2) zesty; urgency=medium livecd-rootfs (2.441.2) zesty; urgency=medium
* The ubuntu-server:live should use a casper-based initramfs to work * The ubuntu-server:live should use a casper-based initramfs to work

View File

@ -1,3 +1,3 @@
Tests: default-bootstraps Tests: default-bootstraps
Depends: @, lsb-release Depends: @, lsb-release
Restrictions: needs-root Restrictions: needs-root isolation-machine

View File

@ -11,9 +11,22 @@ backing_img=
apt-get -qqy install dosfstools gdisk apt-get -qqy install dosfstools gdisk
clean_loops() { clean_loops() {
local kpartx_ret
local kpartx_stdout
if [ -n "${backing_img}" ]; then if [ -n "${backing_img}" ]; then
kpartx -v -d "${backing_img}" # sync before removing loop to avoid "Device or resource busy" errors
sync
kpartx_ret=""
kpartx_stdout=$(kpartx -v -d "${backing_img}") || kpartx_ret=$?
echo "$kpartx_stdout"
if [ -n "$kpartx_ret" ]; then
if echo "$kpartx_stdout" | grep -q "loop deleted"; then
echo "Suppressing kpartx returning error (#860894)"
else
exit $kpartx_ret
fi
fi
unset backing_img unset backing_img
fi fi
@ -69,8 +82,7 @@ mount_image() {
setup_mountpoint() { setup_mountpoint() {
local mountpoint="$1" local mountpoint="$1"
mount --bind /dev "$mountpoint/dev" mount --rbind /dev "$mountpoint/dev"
mount devpts-live -t proc "$mountpoint/dev/pts"
mount proc-live -t proc "$mountpoint/proc" mount proc-live -t proc "$mountpoint/proc"
mount sysfs-live -t sysfs "$mountpoint/sys" mount sysfs-live -t sysfs "$mountpoint/sys"
mount -t tmpfs none "$mountpoint/tmp" mount -t tmpfs none "$mountpoint/tmp"
@ -79,6 +91,19 @@ setup_mountpoint() {
} }
teardown_mountpoint() {
# Reverse the operations from setup_mountpoint
local mountpoint="$1"
umount "$mountpoint/tmp"
umount "$mountpoint/sys"
umount "$mountpoint/proc"
umount -R "$mountpoint/dev"
udevadm settle
sleep 3
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
}
mount_partition() { mount_partition() {
partition="$1" partition="$1"
mountpoint="$2" mountpoint="$2"
@ -122,20 +147,10 @@ EOF
} }
umount_settle() {
# Unmount device, and let it settle
umount $1
udevadm settle
}
umount_partition() { umount_partition() {
local mountpoint=${1} local mountpoint=${1}
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf" teardown_mountpoint $mountpoint
for submnt in proc sys dev/pts dev tmp; umount -R $mountpoint
do
umount $mountpoint/$submnt
done
umount $mountpoint
udevadm settle udevadm settle
if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then

View File

@ -36,12 +36,7 @@ chroot binary/boot/squashfs.dir mkdir /lib/modules
chroot binary/boot/squashfs.dir rm /usr/sbin/grub-probe chroot binary/boot/squashfs.dir rm /usr/sbin/grub-probe
chroot binary/boot/squashfs.dir dpkg-divert --remove --local --rename /usr/sbin/grub-probe chroot binary/boot/squashfs.dir dpkg-divert --remove --local --rename /usr/sbin/grub-probe
mv resolv.conf.tmp "binary/boot/squashfs.dir/etc/resolv.conf" teardown_mountpoint binary/boot/squashfs.dir
umount "binary/boot/squashfs.dir/proc"
umount "binary/boot/squashfs.dir/sys"
umount "binary/boot/squashfs.dir/dev/pts"
umount "binary/boot/squashfs.dir/dev"
umount "binary/boot/squashfs.dir/tmp"
apt-get -qqy install squashfs-tools apt-get -qqy install squashfs-tools

View File

@ -13,4 +13,4 @@ export CLOUD_IMG_STR="$IMAGE_STR"
export FS_LABEL="cloudimg-rootfs" export FS_LABEL="cloudimg-rootfs"
# Cleaner execution # Cleaner execution
/bin/run-parts --regex ".*\.binary" "${extra_d}" /bin/run-parts --exit-on-error --regex ".*\.binary" "${extra_d}"

View File

@ -28,11 +28,11 @@ OVERLAY_ROOT=binary/boot/overlay.dir
mkdir -p "$OVERLAY_ROOT" mkdir -p "$OVERLAY_ROOT"
setup_mountpoint binary/boot/squashfs.dir
# Create an installer squashfs layer # Create an installer squashfs layer
mount_overlay "$SQUASH_ROOT/" "$OVERLAY_ROOT/" "$SQUASH_ROOT/" mount_overlay "$SQUASH_ROOT/" "$OVERLAY_ROOT/" "$SQUASH_ROOT/"
setup_mountpoint binary/boot/squashfs.dir
# Prepare installer layer. # Prepare installer layer.
# Install any requirements for the installer, for things we don't want # Install any requirements for the installer, for things we don't want
@ -147,18 +147,11 @@ AAHP0AEiHQ7zN0yLl7+fkYIMy64xQJqamH1Z2BFN0GWMPwTjpXpszOC+ev7Bpbg0xoldQ1tBHHxH
J4Weia71DnXOnt8cj1VhebVMlyv7B/TGAbGwgprgmQ== J4Weia71DnXOnt8cj1VhebVMlyv7B/TGAbGwgprgmQ==
EOF EOF
mv resolv.conf.tmp "binary/boot/squashfs.dir/etc/resolv.conf" teardown_mountpoint "$SQUASH_ROOT"
# Unmount the overlay first, where it is mounted: # Then unmount the overlay
umount "$SQUASH_ROOT" umount "$SQUASH_ROOT"
# Then we can start unmounting the "real" root:
umount "binary/boot/squashfs.dir/proc"
umount "binary/boot/squashfs.dir/sys"
umount "binary/boot/squashfs.dir/dev/pts"
umount "binary/boot/squashfs.dir/dev"
umount "binary/boot/squashfs.dir/tmp"
apt-get -qqy install squashfs-tools apt-get -qqy install squashfs-tools
squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs" squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs"