diff --git a/debian/changelog b/debian/changelog index 720a7eed..44cf3fdd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +livecd-rootfs (2.584) eoan; urgency=medium + + * Build WSL rootfs tarball (LP: #1827930) + + -- Balint Reczey Thu, 16 May 2019 23:01:13 +0200 + +livecd-rootfs (2.583) eoan; urgency=medium + + * Use snap-tool to seed subiquity snap. + * Drop maas hook from server-live. + + -- Dimitri John Ledkov Thu, 16 May 2019 15:23:22 +0200 + livecd-rootfs (2.582) eoan; urgency=medium * Don't purge busybox-static in minimized, no longer installed diff --git a/debian/control b/debian/control index 9a9c1a69..7e84d2d5 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,7 @@ Package: livecd-rootfs Architecture: any Depends: ${misc:Depends}, apt-utils, + attr, debootstrap, distro-info, dosfstools, diff --git a/live-build/ubuntu-cpc/hooks.d/base/series/base b/live-build/ubuntu-cpc/hooks.d/base/series/base index 43262570..f04bdec7 100644 --- a/live-build/ubuntu-cpc/hooks.d/base/series/base +++ b/live-build/ubuntu-cpc/hooks.d/base/series/base @@ -5,3 +5,4 @@ depends disk-image depends qcow2 depends vmdk depends vagrant +depends wsl diff --git a/live-build/ubuntu-cpc/hooks.d/base/series/wsl b/live-build/ubuntu-cpc/hooks.d/base/series/wsl new file mode 100644 index 00000000..34915a31 --- /dev/null +++ b/live-build/ubuntu-cpc/hooks.d/base/series/wsl @@ -0,0 +1,2 @@ +depends root-dir +base/wsl.binary diff --git a/live-build/ubuntu-cpc/hooks.d/base/wsl.binary b/live-build/ubuntu-cpc/hooks.d/base/wsl.binary new file mode 100755 index 00000000..4bf42800 --- /dev/null +++ b/live-build/ubuntu-cpc/hooks.d/base/wsl.binary @@ -0,0 +1,52 @@ +#!/bin/bash -eux +# vi: ts=4 expandtab +# +# Generate the compressed root directory for WSL + +case ${SUBPROJECT:-} in + minimized) + echo "Skipping minimized $0 build as WSL systems are designed to be interactive" + exit 0 + ;; + *) + ;; +esac + +case $ARCH in + amd64|arm64) + ;; + *) + echo "WSL root tarballs are not generated for $ARCH." + exit 0;; +esac + +if [ -n "${SUBARCH:-}" ]; then + echo "Skipping rootfs build for subarch flavor build" + exit 0 +fi + +. config/functions + +rootfs_dir=wslroot.dir + +# This is the directory created by create-root-dir.binary +cp -a rootfs.dir $rootfs_dir + +setup_mountpoint $rootfs_dir + +env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get -y -qq install ubuntu-wsl + +create_manifest $rootfs_dir livecd.ubuntu-cpc.wsl.rootfs.manifest +teardown_mountpoint $rootfs_dir + +# remove attributes not supported by WSL's tar +if [ -d $rootfs_dir/var/log/journal ]; then + setfattr -x system.posix_acl_access $rootfs_dir/var/log/journal + setfattr -x system.posix_acl_default $rootfs_dir/var/log/journal +fi + +cd $rootfs_dir +tar --xattrs --sort=name -czf ../livecd.ubuntu-cpc.wsl.rootfs.tar.gz * +cd .. + +rm -rf $rootfs_dir diff --git a/live-build/ubuntu-server/hooks/031-maas-squashfs.binary b/live-build/ubuntu-server/hooks/031-maas-squashfs.binary deleted file mode 100755 index edbd20ba..00000000 --- a/live-build/ubuntu-server/hooks/031-maas-squashfs.binary +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -ex -# vi: ts=4 noexpandtab -# -# Generate a squashfs root and manifest - -set -x - -echo "031-maas-squashfs.binary" - -case $IMAGE_TARGETS in - ""|*squashfs*) - ;; - *) - echo "Skipping squashfs build" - exit 0 - ;; -esac - -if [ -n "$SUBARCH" ]; then - echo "Skipping rootfs build for subarch flavor build" - exit 0 -fi - -. config/functions -. config/common - -SQUASH_ROOT=binary/boot/squashfs.dir - -RACK_ROOT=binary/boot/squashfs-rack.dir -REGION_ROOT=binary/boot/squashfs-region.dir - -OVERLAY_RACK_ROOT=binary/overlay-maas-rack -OVERLAY_REGION_ROOT=binary/overlay-maas-region - -mkdir -p "$RACK_ROOT" -mkdir -p "$REGION_ROOT" - -mkdir -p "$OVERLAY_RACK_ROOT" -mkdir -p "$OVERLAY_REGION_ROOT" - -# RACK is on top of the regular squashfs - -mount_overlay "$SQUASH_ROOT/" "$OVERLAY_RACK_ROOT/" "$RACK_ROOT/" - -setup_mountpoint $RACK_ROOT -env DEBIAN_FRONTEND=noninteractive chroot $RACK_ROOT apt-get -y install maas-rack-controller -rm -f $RACK_ROOT/etc/maas/rackd.conf -chroot $RACK_ROOT sh -c 'echo RESET maas/default-maas-url | debconf-communicate maas-common' -chroot $RACK_ROOT sh -c 'echo RESET maas-rack-controller/maas-url | debconf-communicate maas-common' -chroot $RACK_ROOT sh -c 'echo RESET maas-rack-controller/maas-url | debconf-communicate maas-rack-controller' -teardown_mountpoint $RACK_ROOT - -umount "$RACK_ROOT" - -# Full MAAS (Region) is on top of the rack -# in overlayfs lowerdir are mounted right to left, colon separated -mount_overlay "$OVERLAY_RACK_ROOT/:$SQUASH_ROOT/" "$OVERLAY_REGION_ROOT/" "$REGION_ROOT/" - -setup_mountpoint $REGION_ROOT - -env DEBIAN_FRONTEND=noninteractive chroot $REGION_ROOT apt-get -y install maas - -# Forget how things had to be configured -chroot $REGION_ROOT debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.prerm remove -chroot $REGION_ROOT debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.postrm remove -chroot $REGION_ROOT debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.postrm purge -chroot $REGION_ROOT sh -c 'echo RESET maas/default-maas-url | debconf-communicate maas-common' -chroot $REGION_ROOT sudo -u postgres psql -c 'alter role maas password null;' -rm -f $REGION_ROOT/etc/maas/rackd.conf -rm -f $REGION_ROOT/etc/maas/regiond.conf -chroot $REGION_ROOT pg_ctlcluster $(/bin/ls $REGION_ROOT/var/lib/postgresql/) main stop || : - -# After the install, one may call the below to "reconfigure" maas-region-controller -## debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.config configure -## debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.postinst configure - -teardown_mountpoint "$REGION_ROOT" - -umount "$REGION_ROOT" - -squashfs_rack_f="${PWD}/livecd.${PROJECT}.maas-rack.squashfs" - -(cd "$OVERLAY_RACK_ROOT/" && - mksquashfs . ${squashfs_rack_f} \ - -no-progress -xattrs -comp xz ) - -squashfs_region_f="${PWD}/livecd.${PROJECT}.maas-region.squashfs" - -(cd "$OVERLAY_REGION_ROOT/" && - mksquashfs . ${squashfs_region_f} \ - -no-progress -xattrs -comp xz ) diff --git a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary index cff32321..9da75381 100755 --- a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary +++ b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary @@ -23,6 +23,8 @@ fi . config/functions . config/common +# somehow i don't have LB_DISTRIBUTION set ?! +. config/bootstrap FILESYSTEM_ROOT=binary/boot/squashfs.dir INSTALLER_ROOT=binary/boot/installer.squashfs.dir @@ -61,33 +63,11 @@ rm -f $INSTALLER_ROOT/usr/share/initramfs-tools/scripts/casper-bottom/*swap # Don't let cloud-init run in the live session. touch $INSTALLER_ROOT/etc/cloud/cloud-init.disabled -# Do the snap seeding dance. -chroot $INSTALLER_ROOT mkdir -p /var/lib/snapd/seed/snaps /var/lib/snapd/seed/assertions -chroot $INSTALLER_ROOT sh -c ' -set -x; -mkdir -p /var/lib/snapd/seed/snaps/ -cd /var/lib/snapd/seed/snaps/; -if [ ! -e core_*.snap ]; then - SNAPPY_STORE_NO_CDN=1 snap download core -fi -SNAPPY_STORE_NO_CDN=1 snap download subiquity; - -CORE_SNAP=$(ls -1 core_*.snap); -SUBIQUITY_SNAP=$(ls -1 subiquity*.snap); - -mv *.assert /var/lib/snapd/seed/assertions/; - -cat < /var/lib/snapd/seed/seed.yaml -snaps: - - name: core - channel: stable - file: ${CORE_SNAP} - - name: subiquity - channel: stable - classic: true - file: ${SUBIQUITY_SNAP} -EOF -' +# Preseed subiquity into installer layer +snap_prepare $INSTALLER_ROOT +snap_preseed $INSTALLER_ROOT subiquity/classic +# Drop lxd from the installer layer preseed +sed -i -e'N;/name: lxd/,+2d' $INSTALLER_ROOT/var/lib/snapd/seed/seed.yaml teardown_mountpoint "$INSTALLER_ROOT" diff --git a/live-build/ubuntu-server/hooks/033-kernel-bits.binary b/live-build/ubuntu-server/hooks/033-kernel-bits.binary old mode 100644 new mode 100755