Switch first boot setup to console wizard
This commit is contained in:
1 parent
686691fff7
commit
33f60af92a
2 files changed
+52
-27
No files matched your search
+28
-22
@@ -50,6 +50,7 @@ autoinstall:
|
||||
- curl
|
||||
- wget
|
||||
- python3
|
||||
- whiptail
|
||||
- avahi-daemon
|
||||
- openssh-server
|
||||
|
||||
@@ -63,25 +64,22 @@ autoinstall:
|
||||
- echo "cezen ALL=(ALL) NOPASSWD:ALL" > /target/etc/sudoers.d/cezen
|
||||
- chmod 440 /target/etc/sudoers.d/cezen
|
||||
|
||||
# Replace the installer-generated network config with the final static
|
||||
# Cezen network so the installed system always has the expected route.
|
||||
# Replace the installer-generated network config with a simple DHCP target
|
||||
# config. The console wizard can later switch this to static if desired.
|
||||
- rm -f /target/etc/netplan/50-cloud-init.yaml /target/etc/netplan/00-installer-config.yaml || true
|
||||
- |
|
||||
cat > /target/etc/netplan/99-cezen-static.yaml << 'EOF'
|
||||
cat > /target/etc/netplan/99-cezen-dhcp.yaml << 'EOF'
|
||||
network:
|
||||
version: 2
|
||||
ethernets:
|
||||
ens18:
|
||||
dhcp4: false
|
||||
addresses:
|
||||
- 172.16.10.181/23
|
||||
routes:
|
||||
- to: default
|
||||
via: 172.16.10.1
|
||||
nameservers:
|
||||
addresses:
|
||||
- 8.8.8.8
|
||||
- 1.1.1.1
|
||||
any-en:
|
||||
dhcp4: true
|
||||
match:
|
||||
name: "en*"
|
||||
any-eth:
|
||||
dhcp4: true
|
||||
match:
|
||||
name: "eth*"
|
||||
EOF
|
||||
|
||||
# Disable the installer media APT source so post-install apt uses network
|
||||
@@ -93,29 +91,37 @@ autoinstall:
|
||||
- mkdir -p /target/opt/aipackage
|
||||
- cp -a /cdrom/cezen-aipackage/. /target/opt/aipackage/ || git clone https://cgit.cezentech.com/jinojose/aipackage.git /target/opt/aipackage
|
||||
|
||||
# Deploy the web setup server
|
||||
# Deploy the console setup wizard
|
||||
- mkdir -p /target/opt/cezen
|
||||
- cp /target/opt/aipackage/autoinstall/websetup/server.py /target/opt/cezen/websetup.py
|
||||
- chmod +x /target/opt/cezen/websetup.py
|
||||
- cp /target/opt/aipackage/autoinstall/firstboot-setup.sh /target/opt/cezen/firstboot-setup.sh
|
||||
- chmod +x /target/opt/cezen/firstboot-setup.sh
|
||||
|
||||
# Set hostname to cezenai so it's reachable as cezenai.local via mDNS
|
||||
- echo "cezenai" > /target/etc/hostname
|
||||
- sed -i 's/aiserver/cezenai/g' /target/etc/hosts || true
|
||||
|
||||
# Create cezen-setup web UI systemd service
|
||||
# Create cezen-setup console UI systemd service on tty1
|
||||
- |
|
||||
cat > /target/etc/systemd/system/cezen-setup.service << 'EOF'
|
||||
[Unit]
|
||||
Description=Cezen AI Suite — Web Setup UI
|
||||
Description=Cezen AI Suite — Console Setup Wizard
|
||||
After=network-online.target avahi-daemon.service
|
||||
Wants=network-online.target
|
||||
Before=getty@tty1.service
|
||||
Conflicts=getty@tty1.service
|
||||
ConditionPathExists=!/opt/cezen/.setup-done
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/python3 /opt/cezen/websetup.py
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
ExecStart=/opt/cezen/firstboot-setup.sh
|
||||
StandardInput=tty
|
||||
StandardOutput=tty
|
||||
StandardError=tty
|
||||
TTYPath=/dev/tty1
|
||||
TTYReset=yes
|
||||
TTYVHangup=yes
|
||||
TTYVTDisallocate=yes
|
||||
Restart=no
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in new issue
Block a user