Separate WSL from CPC

Create a separate WSL image than CPC so it can be managed independently.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
jammy-iotg-bump
Jean-Baptiste Lallement 3 years ago
parent 68b26a790b
commit 80ccea8d63

@ -155,7 +155,7 @@ Expire-Date: 0
lb bootstrap "$@" lb bootstrap "$@"
case $PROJECT:${SUBPROJECT:-} in case $PROJECT:${SUBPROJECT:-} in
ubuntu-server:*|ubuntu-cpc:*|ubuntu:desktop-preinstalled) ubuntu-server:*|ubuntu-cpc:*|ubuntu:desktop-preinstalled|ubuntu-wsl:*)
# Set locale to C.UTF-8 by default. We should # Set locale to C.UTF-8 by default. We should
# probably do this for all images early in the # probably do this for all images early in the
# 18.10 cycle but for now just do it for # 18.10 cycle but for now just do it for

@ -331,7 +331,7 @@ _get_live_passes ()
if [ -z "${IMAGEFORMAT:-}" ]; then if [ -z "${IMAGEFORMAT:-}" ]; then
case $PROJECT:${SUBPROJECT:-} in case $PROJECT:${SUBPROJECT:-} in
ubuntu-cpc:*|ubuntu:desktop-preinstalled) ubuntu-cpc:*|ubuntu:desktop-preinstalled|ubuntu-wsl:*)
case $SUBARCH in case $SUBARCH in
raspi|intel-iot) raspi|intel-iot)
IMAGEFORMAT=ubuntu-image IMAGEFORMAT=ubuntu-image
@ -548,6 +548,8 @@ case $IMAGEFORMAT in
case $PROJECT in case $PROJECT in
ubuntu-server) ubuntu-server)
;; ;;
ubuntu-wsl)
;;
ubuntu) ubuntu)
if [ "$SUBPROJECT" != "canary" ]; then if [ "$SUBPROJECT" != "canary" ]; then
add_package live casper add_package live casper
@ -584,7 +586,7 @@ if [ "$PREINSTALLED" = "true" ]; then
ubuntu-server) ubuntu-server)
add_package live oem-config-debconf ubiquity-frontend-debconf add_package live oem-config-debconf ubiquity-frontend-debconf
;; ;;
ubuntu-base|ubuntu-oci|ubuntu-cpc) ubuntu-base|ubuntu-oci|ubuntu-cpc|ubuntu-wsl)
;; ;;
ubuntu) ubuntu)
add_package live oem-config-gtk ubiquity-frontend-gtk add_package live oem-config-gtk ubiquity-frontend-gtk
@ -892,6 +894,13 @@ case $PROJECT in
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
;; ;;
ubuntu-wsl)
add_task install minimal standard ubuntu-wsl
OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none"
KERNEL_FLAVOURS=none
BINARY_REMOVE_LINUX=false
;;
ubuntu-cpc) ubuntu-cpc)
KERNEL_FLAVOURS=virtual KERNEL_FLAVOURS=virtual
@ -989,6 +998,9 @@ case $PROJECT:${SUBPROJECT:-} in
ubuntu:*|kubuntu*:*|lubuntu*:*|xubuntu*:*|ubuntu-mate*:*|ubuntustudio*:*|ubuntukylin*:*|ubuntu-budgie*:*) ubuntu:*|kubuntu*:*|lubuntu*:*|xubuntu*:*|ubuntu-mate*:*|ubuntustudio*:*|ubuntukylin*:*|ubuntu-budgie*:*)
BASE_SEED='desktop' BASE_SEED='desktop'
;; ;;
ubuntu-wsl:*)
BASE_SEED='wsl'
;;
ubuntu-cpc:*) ubuntu-cpc:*)
BASE_SEED='server' BASE_SEED='server'
;; ;;
@ -1151,7 +1163,7 @@ if [ "${IMAGE_HAS_HARDCODED_PASSWORD:-}" = "1" ]; then
fi fi
case $PROJECT in case $PROJECT in
ubuntu-cpc|ubuntu-core|ubuntu-base|ubuntu-oci) ubuntu-cpc|ubuntu-core|ubuntu-base|ubuntu-oci|ubuntu-wsl)
# ubuntu-cpc gets this added in 025-create-groups.chroot, and we do # ubuntu-cpc gets this added in 025-create-groups.chroot, and we do
# not want this group in projects that are effectively just chroots # not want this group in projects that are effectively just chroots
;; ;;
@ -1310,7 +1322,7 @@ EOF
fi fi
;; ;;
ubuntu-cpc:*|ubuntu-server:live|ubuntu:desktop-preinstalled) ubuntu-cpc:*|ubuntu-server:live|ubuntu:desktop-preinstalled|ubuntu-wsl:*)
# Ensure that most things e.g. includes.chroot are copied as is # Ensure that most things e.g. includes.chroot are copied as is
for entry in /usr/share/livecd-rootfs/live-build/${PROJECT}/*; do for entry in /usr/share/livecd-rootfs/live-build/${PROJECT}/*; do
case $entry in case $entry in

@ -1,64 +0,0 @@
#!/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
env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get autoremove --purge --assume-yes
# Install snap manually for now as config on cpc always assume the same base seed for every flavors
env UBUNTU_STORE_ARCH=${ARCH:-} SNAPPY_STORE_NO_CDN=1 chroot $rootfs_dir snap download --target-directory=/var/lib/snapd/snaps core20
env UBUNTU_STORE_ARCH=${ARCH:-} SNAPPY_STORE_NO_CDN=1 chroot $rootfs_dir snap download --target-directory=/var/lib/snapd/snaps gtk-common-themes
env UBUNTU_STORE_ARCH=${ARCH:-} SNAPPY_STORE_NO_CDN=1 chroot $rootfs_dir snap download --target-directory=/var/lib/snapd/snaps --channel=latest/edge ubuntu-desktop-installer
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

@ -0,0 +1,24 @@
#!/bin/bash -eux
# vi: ts=4 expandtab
#
# Generate the compressed root directory for WSL manually.
# Type "plain" unfortunately does not execute lb_binary_* helpers.
case $ARCH in
amd64|arm64)
;;
*)
echo "WSL root tarballs are not generated for $ARCH."
exit 0;;
esac
# The reason not using just tar .. -C chroot . 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 chroot
tar --xattrs --sort=name -czf ../livecd.ubuntu-wsl.rootfs.tar.gz *
cd ..
# Remove initial ext4-formatted fs
rm -f binary/boot/filesystem.ext4
Loading…
Cancel
Save