Merge pull request #1091 from canonical/wsl_oobe_autoinstall

WSL OOBE - properly setup autoinstall
This commit is contained in:
Didier Roche 2021-10-11 09:34:59 +02:00 committed by GitHub
commit deab1b0859
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 64 additions and 14 deletions

View File

@ -0,0 +1,28 @@
version: 1
early-commands:
- echo a
- ["sleep", "1"]
- echo a
locale: en_US
identity:
realname: Ubuntu
username: ubuntu
# ubuntu
password: '$6$wdAcoXrU039hKYPd$508Qvbe7ObUnxoj15DRCkzC3qO7edjH0VV7BPNRDYK4QR8ofJaEEF2heacn0QgD.f8pO8SNp83XNdWG6tocBM1'
wslconfbase:
automount_root: '/custom_mnt_path'
automount_options: 'metadata'
network_generatehosts: false
network_generateresolvconf: false
wslconfadvanced:
interop_enabled: false
interop_appendwindowspath: false
gui_theme: 'light'
gui_followwintheme: true
interop_guiintegration: true
interop_audiointegration: true
interop_advancedipdetection: true
motd_wslnewsenabled: false
automount_enabled: false
automount_mountfstab: false
shutdown: 'reboot'

View File

@ -14,15 +14,4 @@ wslconfbase:
automount_options: 'metadata'
network_generatehosts: false
network_generateresolvconf: false
wslconfadvanced:
interop_enabled: false
interop_appendwindowspath: false
gui_theme: 'light'
gui_followwintheme: true
interop_guiintegration: true
interop_audiointegration: true
interop_advancedipdetection: true
motd_wslnewsenabled: false
automount_enabled: false
automount_mountfstab: false
shutdown: 'reboot'

View File

@ -116,13 +116,14 @@ grep -q 'finish: subiquity/Install/install/postinstall/run_unattended_upgrades:
# The OOBE doesn't exist in WSL < 20.04
if [ "${RELEASE%.*}" -ge 20 ]; then
# NOTE:
# This test doesnt do much ATM but it will be useful when we have more complex scenarios to test with the server and client code.
# Like generating a wsl.conf file and comparing it to the oracle.
clean
timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m system_setup.cmd.tui --autoinstall examples/autoinstall-system-setup.yaml --dry-run"
validate "system_setup" "autoinstall"
clean
timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m system_setup.cmd.tui --autoinstall examples/autoinstall-system-setup-full.yaml --dry-run"
validate "system_setup" "autoinstall-full"
python3 -m system_setup.cmd.schema > "$testschema"
scripts/schema-cmp.py "autoinstall-system-setup-schema.json" "$testschema" --ignore-tz
fi

View File

@ -99,6 +99,12 @@ class ConfigureController(SubiquityController):
wsl_config_update(self.model.wslconfadvanced.wslconfadvanced,
root_dir)
# update advanced config when it is in autoinstall mode
if self.app.opts.autoinstall is not None and \
self.model.wslconfadvanced.wslconfadvanced is not None:
wsl_config_update(self.model.wslconfadvanced.wslconfadvanced,
root_dir)
wsl_config_update(self.model.wslconfbase.wslconfbase, root_dir)
self.app.update_state(ApplicationState.DONE)

View File

@ -0,0 +1,12 @@
[GUI]
followwintheme = true
theme = light
[Interop]
advancedipdetection = true
audiointegration = true
guiintegration = true
[Motd]
wslnewsenabled = false

View File

@ -0,0 +1,14 @@
[automount]
enabled = false
mountfstab = false
options = metadata
root = /custom_mnt_path
[interop]
appendwindowspath = false
enabled = false
[network]
generatehosts = false
generateresolvconf = false