From 7c79311c4fc6beff9da929f3fab92970cd0f7d4a Mon Sep 17 00:00:00 2001 From: CloudBuilder Date: Thu, 6 Jun 2019 21:26:04 +0000 Subject: [PATCH] Imported 2.578.5 No reason for CPC update specified. --- debian/changelog | 12 ++++ debian/control | 1 + live-build/auto/build | 7 +++ .../ubuntu-cpc/hooks.d/base/series/base | 1 + live-build/ubuntu-cpc/hooks.d/base/series/wsl | 2 + live-build/ubuntu-cpc/hooks.d/base/wsl.binary | 56 +++++++++++++++++++ 6 files changed, 79 insertions(+) create mode 100644 live-build/ubuntu-cpc/hooks.d/base/series/wsl create mode 100755 live-build/ubuntu-cpc/hooks.d/base/wsl.binary diff --git a/debian/changelog b/debian/changelog index da3f522e..d0475190 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +livecd-rootfs (2.578.5) disco; urgency=medium + + [ Balint Reczey ] + * Build WSL rootfs tarball (LP: #1827930) + + [ Steve Langasek ] + * Strip translation files out of the minimal images, another thing that + goes unused when there is no human console user (and we already don't + have the locales themselves present on a minimal image). LP: #1829333. + + -- Steve Langasek Thu, 30 May 2019 12:13:55 -0700 + livecd-rootfs (2.578.4) disco; urgency=medium [ Robert C Jennings ] 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/auto/build b/live-build/auto/build index b07caad7..96811213 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -131,6 +131,9 @@ Expire-Date: 0 # Drop all man pages path-exclude=/usr/share/man/* +# Drop all translations +path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo + # Drop all documentation ... path-exclude=/usr/share/doc/* @@ -191,6 +194,10 @@ if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dp # This step processes the packages which still have missing documentation dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \ | xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y + echo "Restoring system translations..." + # This step processes the packages which still have missing translations + dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/locale/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \ + | xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y if dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {exit 1}'; then echo "Documentation has been restored successfully." rm /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp 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..05f51e30 --- /dev/null +++ b/live-build/ubuntu-cpc/hooks.d/base/wsl.binary @@ -0,0 +1,56 @@ +#!/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 + +# The reason not using just tar .. -C $rootfs_dir . is that using '.' was found +# not working once and checking if using the simpler command is safe needs +# verification of the app installation on all Windows 10 builds we support +# with WSL. +cd $rootfs_dir +tar --xattrs --sort=name -czf ../livecd.ubuntu-cpc.wsl.rootfs.tar.gz * +cd .. + +rm -rf $rootfs_dir