diff --git a/package/harvester-os/files/system/oem/91_installer.yaml b/package/harvester-os/files/system/oem/91_installer.yaml index 7a929108c..9e946d5a1 100644 --- a/package/harvester-os/files/system/oem/91_installer.yaml +++ b/package/harvester-os/files/system/oem/91_installer.yaml @@ -1,11 +1,10 @@ name: "Setup installer" stages: - boot: + initramfs: - commands: - setup-installer.sh # reference: https://github.com/harvester/harvester/issues/2663, thanks @Ernad's enhancement if: '! grep -q "harvester.installer.disable=true" /proc/cmdline' - initramfs: - environment_file: "/etc/rancher/installer/env" environment: HARVESTER_DASHBOARD: "true" diff --git a/package/harvester-os/files/usr/bin/setup-installer.sh b/package/harvester-os/files/usr/bin/setup-installer.sh index b7f0dee10..bcb2fa8a2 100755 --- a/package/harvester-os/files/usr/bin/setup-installer.sh +++ b/package/harvester-os/files/usr/bin/setup-installer.sh @@ -37,13 +37,20 @@ EOF } +echo "Remove the getty service..." +rm -rf "/etc/systemd/system/getty*" + +echo "Remove the serial-getty service..." +rm -rf "/etc/systemd/system/serial-getty*" + # reverse the ttys to start from the last one for TTY in $(cat /sys/class/tty/console/active); do tty_num=${TTY#tty} # tty1 ~ tty64 if [[ $tty_num =~ ^[0-9]+$ ]]; then - create_drop_in "/run/systemd/system/getty@${TTY}.service.d" + create_drop_in "/etc/systemd/system/getty@${TTY}.service.d" + break fi @@ -55,9 +62,6 @@ for TTY in $(cat /sys/class/tty/console/active); do continue fi - create_drop_in "/run/systemd/system/serial-getty@${TTY}.service.d" + create_drop_in "/etc/systemd/system/serial-getty@${TTY}.service.d" break done - - -systemctl daemon-reload