From 0538667468e233012001e9dc03da9815d425b515 Mon Sep 17 00:00:00 2001 From: Marcos Mello Date: Tue, 5 Oct 2021 21:07:21 -0300 Subject: [PATCH] Add dostartx boot option Fixes systemrescue/systemrescue-sources#222 --- airootfs/etc/systemd/scripts/sysrescue-initialize | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/airootfs/etc/systemd/scripts/sysrescue-initialize b/airootfs/etc/systemd/scripts/sysrescue-initialize index 88f0bc2..830954a 100755 --- a/airootfs/etc/systemd/scripts/sysrescue-initialize +++ b/airootfs/etc/systemd/scripts/sysrescue-initialize @@ -46,10 +46,17 @@ do # Option to allow user to disable the firewall nofirewall) - echo "Found option 'nofirewall' on the boot command line" + echo "Found option '${curopt}' on the boot command line" # the firewall service(s) must be in the Before-section of sysrescue-initialize.service systemctl disable --now iptables.service ip6tables.service ;; + + # Auto-start the graphical environment (tty1 only) + dostartx) + echo "Found option '${curopt}' on the boot command line" + echo '[[ ! $DISPLAY ]] && [[ ! $SSH_TTY ]] && [[ $XDG_VTNR == 1 ]] && startx' | \ + tee -a /root/.bash_profile > /root/.zlogin + ;; esac done