mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-23 03:11:12 +00:00
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>
This commit is contained in:
parent
68b26a790b
commit
80ccea8d63
@ -155,7 +155,7 @@ Expire-Date: 0
|
||||
lb bootstrap "$@"
|
||||
|
||||
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
|
||||
# probably do this for all images early in the
|
||||
# 18.10 cycle but for now just do it for
|
||||
|
@ -331,7 +331,7 @@ _get_live_passes ()
|
||||
|
||||
if [ -z "${IMAGEFORMAT:-}" ]; then
|
||||
case $PROJECT:${SUBPROJECT:-} in
|
||||
ubuntu-cpc:*|ubuntu:desktop-preinstalled)
|
||||
ubuntu-cpc:*|ubuntu:desktop-preinstalled|ubuntu-wsl:*)
|
||||
case $SUBARCH in
|
||||
raspi|intel-iot)
|
||||
IMAGEFORMAT=ubuntu-image
|
||||
@ -548,6 +548,8 @@ case $IMAGEFORMAT in
|
||||
case $PROJECT in
|
||||
ubuntu-server)
|
||||
;;
|
||||
ubuntu-wsl)
|
||||
;;
|
||||
ubuntu)
|
||||
if [ "$SUBPROJECT" != "canary" ]; then
|
||||
add_package live casper
|
||||
@ -584,7 +586,7 @@ if [ "$PREINSTALLED" = "true" ]; then
|
||||
ubuntu-server)
|
||||
add_package live oem-config-debconf ubiquity-frontend-debconf
|
||||
;;
|
||||
ubuntu-base|ubuntu-oci|ubuntu-cpc)
|
||||
ubuntu-base|ubuntu-oci|ubuntu-cpc|ubuntu-wsl)
|
||||
;;
|
||||
ubuntu)
|
||||
add_package live oem-config-gtk ubiquity-frontend-gtk
|
||||
@ -892,6 +894,13 @@ case $PROJECT in
|
||||
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)
|
||||
KERNEL_FLAVOURS=virtual
|
||||
|
||||
@ -989,6 +998,9 @@ case $PROJECT:${SUBPROJECT:-} in
|
||||
ubuntu:*|kubuntu*:*|lubuntu*:*|xubuntu*:*|ubuntu-mate*:*|ubuntustudio*:*|ubuntukylin*:*|ubuntu-budgie*:*)
|
||||
BASE_SEED='desktop'
|
||||
;;
|
||||
ubuntu-wsl:*)
|
||||
BASE_SEED='wsl'
|
||||
;;
|
||||
ubuntu-cpc:*)
|
||||
BASE_SEED='server'
|
||||
;;
|
||||
@ -1151,7 +1163,7 @@ if [ "${IMAGE_HAS_HARDCODED_PASSWORD:-}" = "1" ]; then
|
||||
fi
|
||||
|
||||
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
|
||||
# not want this group in projects that are effectively just chroots
|
||||
;;
|
||||
@ -1310,7 +1322,7 @@ EOF
|
||||
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
|
||||
for entry in /usr/share/livecd-rootfs/live-build/${PROJECT}/*; do
|
||||
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
|
24
live-build/ubuntu-wsl/hooks/99-tar.binary
Executable file
24
live-build/ubuntu-wsl/hooks/99-tar.binary
Executable file
@ -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…
x
Reference in New Issue
Block a user