From 1c8e0a527c2ec87ad915f7a83262b60dc9302a97 Mon Sep 17 00:00:00 2001 From: CloudBuilder Date: Mon, 20 May 2019 14:47:04 +0000 Subject: [PATCH] Imported 2.525.24 No reason for CPC update specified. --- debian/changelog | 6 ++ debian/control | 1 + .../ubuntu-cpc/hooks/031-3-wsl-gz.binary | 56 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100755 live-build/ubuntu-cpc/hooks/031-3-wsl-gz.binary diff --git a/debian/changelog b/debian/changelog index a0d7b61d..a7b86fd1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.525.24) bionic; urgency=medium + + * Build WSL rootfs tarball (LP: #1827930) + + -- Balint Reczey Fri, 17 May 2019 15:11:42 +0200 + livecd-rootfs (2.525.23) bionic; urgency=medium * Backport two minimizations for the docker images: remove apt lists that diff --git a/debian/control b/debian/control index f7f315de..6358738e 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/031-3-wsl-gz.binary b/live-build/ubuntu-cpc/hooks/031-3-wsl-gz.binary new file mode 100755 index 00000000..05f51e30 --- /dev/null +++ b/live-build/ubuntu-cpc/hooks/031-3-wsl-gz.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