mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-11-06 11:54:23 +00:00
Implement WSL hooks for Focal
The same hooks used to build Jammy and later
This commit is contained in:
parent
53ccadc770
commit
beb2bf1565
10
live-build/ubuntu-wsl/hooks/00-enable-systemd.chroot
Executable file
10
live-build/ubuntu-wsl/hooks/00-enable-systemd.chroot
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash -eu
|
||||||
|
# vi: ts=4 expandtab
|
||||||
|
#
|
||||||
|
# Enable systemd by default on our WSL image
|
||||||
|
#
|
||||||
|
|
||||||
|
cat <<EOF >/etc/wsl.conf
|
||||||
|
[boot]
|
||||||
|
systemd=true
|
||||||
|
EOF
|
||||||
20
live-build/ubuntu-wsl/hooks/01-distribution-conf.chroot
Executable file
20
live-build/ubuntu-wsl/hooks/01-distribution-conf.chroot
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash -eu
|
||||||
|
# vi: ts=4 expandtab
|
||||||
|
#
|
||||||
|
# Create wsl-distribution.conf for WSL setup
|
||||||
|
#
|
||||||
|
|
||||||
|
source /etc/os-release
|
||||||
|
|
||||||
|
cat <<EOF >/etc/wsl-distribution.conf
|
||||||
|
[oobe]
|
||||||
|
command = /usr/lib/wsl/wsl-setup
|
||||||
|
defaultUid = 1000
|
||||||
|
defaultName = ${NAME}-${VERSION_ID}
|
||||||
|
|
||||||
|
[shortcut]
|
||||||
|
icon = /usr/share/wsl/ubuntu.ico
|
||||||
|
|
||||||
|
[windowsterminal]
|
||||||
|
ProfileTemplate = /usr/share/wsl/terminal-profile.json
|
||||||
|
EOF
|
||||||
10
live-build/ubuntu-wsl/hooks/10-create-groups.chroot
Executable file
10
live-build/ubuntu-wsl/hooks/10-create-groups.chroot
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Create the necessary groups
|
||||||
|
#
|
||||||
|
|
||||||
|
echo "Adding admin group..."
|
||||||
|
addgroup --system --quiet admin
|
||||||
|
|
||||||
|
echo "Adding netdev group..."
|
||||||
|
addgroup --system --quiet netdev
|
||||||
25
live-build/ubuntu-wsl/hooks/99-tar.binary
Executable file
25
live-build/ubuntu-wsl/hooks/99-tar.binary
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash -eu
|
||||||
|
# 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
|
||||||
|
|
||||||
|
## remove attributes not supported by WSL's tar
|
||||||
|
setfattr -x system.posix_acl_access chroot/var/log/journal
|
||||||
|
setfattr -x system.posix_acl_default chroot/var/log/journal
|
||||||
|
|
||||||
|
# Create the rootfs as a .wsl extension
|
||||||
|
cd chroot
|
||||||
|
tar --xattrs --sort=name -czf ../livecd.$PROJECT${SUBARCH:+-$SUBARCH}.wsl *
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Remove initial ext4-formatted fs
|
||||||
|
rm -f binary/boot/filesystem.ext4
|
||||||
Loading…
x
Reference in New Issue
Block a user