Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installer: reorder the patch operation for tty service #588

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package/harvester-os/files/system/oem/91_installer.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
14 changes: 9 additions & 5 deletions package/harvester-os/files/usr/bin/setup-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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