You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
livecd-rootfs/live-build/ubuntu/hooks/020-canary-live.binary

97 lines
3.1 KiB

#! /bin/sh
set -eux
case ${PASS:-} in
minimal.standard.live)
;;
*)
exit 0
;;
esac
case ${SUBPROJECT:-} in
canary)
;;
*)
echo "We don't run canary hooks for this project."
exit 0
;;
esac
# env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 brand-id=canonical model=ubuntu-server-installer-classic-2304-amd64 > config/classic-model-installer.model
cat <<EOF > config/classic-model-installer.model
type: model
authority-id: canonical
series: 16
brand-id: canonical
model: ubuntu-server-installer-classic-2304-amd64
architecture: amd64
base: core22
classic: true
distribution: ubuntu
grade: signed
snaps:
-
default-channel: latest/stable
id: amcUKQILKXHHTlmSa7NMdnXSx02dNeeT
name: core22
type: base
-
default-channel: latest/stable
id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4
name: snapd
type: snapd
-
classic: true
default-channel: latest/stable/canary-23.04
id: ba2aj8guta0zSRlT3QM5aJNAUXPlBtf9
name: subiquity
type: app
timestamp: 2023-03-19T12:00:00.0Z
sign-key-sha3-384: 9tydnLa6MTJ-jaQTFUXEwHl1yRx7ZS4K5cyFDhYDcPzhS7uyEkDxdUjg9g08BtNn
AcLBXAQAAQoABgUCZCT4iAAKCRDgT5vottzAEkmPD/46nms8edTFkoiiH/SjAdyo8MW2FhR3tW03
CyH1NQwrNJtHiqb7EcWQHDPexM3Wxvwj2iPN04IWlGugge7Fw12AmhVsYYCnCjYjDL8uBa9ixBj3
kghOsFlVbDBk+f5tLmNGNncQfPbV6TvywK9a+2zgVEdRdLlmNeorX3b7P0woCIWg9wEikX+vcLi/
q1GvWtI4Gb/rAIN+/OaD4DFgbJSUdSaayGX90hbNtvsZc0K7KPTeNlF0IGKg72yvqBGDX/0m2IDb
6HozMxGg7xcq+WwHU3hucBNqw6kWKKDd1gzZJICrJf9kLEZ7GoGa8Oj9eET+bp2KYVHzjNzHvQbd
v4odCG3Wn7m5ogpPmt/mUoTOhVtY/RNGnk46eHAFHuFcPAjR1BnIfLLmh4EmEnkIboTrlBKFgHMW
ddFSOFYonboYu7R9Gad3J+9VD5IyyNqJNpCrEqLfw81QaFz1+KM00XD+wns2+ZqnI90a6olXcmUH
t1Fv0QIDNCG0x8Lf+My/gJycNCEbUj+TA6xOL9NH0EFU6myKyR74sC5tlMZPMN2RKdZglOZUnkyC
lpuhRVI3fcNZL2sVGwmvoKUDj7QaLrETpCUqDXMzNw73NOS3zA8+gQr/X438KpEFscszS1g+FtJ4
LVOcgLrDw/S61ciBuOBeOaskqZdZ4xYmm1wKMzecXg==
EOF
env SNAPPY_STORE_NO_CDN=1 snap prepare-image --classic config/classic-model-installer.model chroot
mv chroot/system-seed/systems/* chroot/system-seed/systems/classic-installer
rsync -a chroot/system-seed/ chroot/var/lib/snapd/seed
rm -rf chroot/system-seed/
cat <<EOF > chroot/var/lib/snapd/modeenv
mode=run
recovery_system=classic-installer
EOF
# Temporary while we still use the subiquity TUI for the live system
cat > chroot/usr/lib/systemd/user/subiquity-tui.service << EOF
[Unit]
Description=subiquity tui
PartOf=graphical-session.target
After=graphical-session.target
# Never run in GDM
Conflicts=gnome-session@gnome-login.target
[Service]
Type=simple
ExecStart=/usr/bin/gnome-terminal --wait -- sudo sh -c 'echo waiting for snapd; snap wait system seed.loaded; sleep 5; snap run subiquity'
Restart=no
EOF
mkdir chroot/etc/systemd/user/graphical-session.target.wants/
ln -vs /usr/lib/systemd/user/subiquity-tui.service chroot/etc/systemd/user/graphical-session.target.wants/
mv chroot/boot/initrd.img-* ${PWD}/livecd.${PROJECT}.initrd-generic
mv chroot/boot/vmlinu?-* ${PWD}/livecd.${PROJECT}.kernel-generic
chmod a+r ${PWD}/livecd.${PROJECT}.initrd-generic ${PWD}/livecd.${PROJECT}.kernel-generic