mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
kvmd-bootconfig: improved oled handling
This commit is contained in:
parent
6ef1645e93
commit
018f33533d
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=PiKVM - Boot configuration
|
Description=PiKVM - Boot configuration
|
||||||
After=systemd-modules-load.service
|
After=systemd-modules-load.service kvmd-oled.service
|
||||||
Before=network-pre.target kvmd-otg.service kvmd-nginx.service kvmd.service sshd.service pikvm-bootconfig.service
|
Before=network-pre.target kvmd-otg.service kvmd-nginx.service kvmd.service sshd.service pikvm-bootconfig.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|||||||
@ -39,6 +39,14 @@ fi
|
|||||||
if [ ! -f /boot/pikvm.txt ]; then
|
if [ ! -f /boot/pikvm.txt ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if systemctl is-enabled -q kvmd-oled; then
|
||||||
|
# Stop regular kvmd-oled service and show first time setup status in oled
|
||||||
|
systemctl stop kvmd-oled || true
|
||||||
|
kvmd-oled --interval=0 --text="On-boot setup...\nDO NOT INTERRUPT!\nPlease wait" || true
|
||||||
|
has_oled=1
|
||||||
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
source <(dos2unix < /boot/pikvm.txt)
|
source <(dos2unix < /boot/pikvm.txt)
|
||||||
|
|
||||||
@ -48,10 +56,6 @@ rw
|
|||||||
# ========== First boot configuration ==========
|
# ========== First boot configuration ==========
|
||||||
|
|
||||||
if [ -n "$FIRSTBOOT$FIRST_BOOT" ]; then
|
if [ -n "$FIRSTBOOT$FIRST_BOOT" ]; then
|
||||||
### stop regular kvmd-oled service and show first time setup status in oled
|
|
||||||
systemctl stop kvmd-oled
|
|
||||||
/usr/bin/kvmd-oled --interval=0 --text="First time setup\nDo NOT interrupt\nPlease Wait...\n"
|
|
||||||
|
|
||||||
( \
|
( \
|
||||||
(umount /etc/machine-id || true) \
|
(umount /etc/machine-id || true) \
|
||||||
&& echo -n > /etc/machine-id \
|
&& echo -n > /etc/machine-id \
|
||||||
@ -211,6 +215,8 @@ if [ -f /boot/pikvm-reboot.txt ]; then
|
|||||||
sleep 3
|
sleep 3
|
||||||
else
|
else
|
||||||
ro
|
ro
|
||||||
# critical tasks have completed so start kvmd-oled service as an indicator that first boot tasks are complete
|
if [ -n "$has_oled" ]; then
|
||||||
systemctl restart kvmd-oled
|
# Critical tasks have completed so start kvmd-oled service as an indicator that on-boot tasks are complete
|
||||||
|
systemctl start kvmd-oled || true
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user