}
# }}}
+# {{{ secure boot
+config_secureboot(){
+ if [ -x /usr/bin/mokutil ] ; then
+ local secstate=$(mokutil --sb-state 2>/dev/null) # "SecureBoot enabled"
+ if [ -n "$secstate" ] ; then
+ einfo "SecureBoot is enabled" ; eend 0
+ else
+ ewarn "SecureBoot not detected" ; eend 0
+ fi
+ else
+ if modprobe efivars &>/dev/null ; then
+ if od -An -t u1 /sys/firmware/efi/vars/SecureBoot-*/data 2>/dev/null | grep -q 1 ; then
+ einfo "SecureBoot is enabled" ; eend 0
+ else
+ ewarn "SecureBoot not detected" ; eend 0
+ fi
+ fi
+ fi
+}
+# }}}
+
# {{{ timezone
config_timezone(){
# don't touch the files if running from harddisk:
# activate serial console {{{
config_console(){
if checkbootparam 'console'; then
+ # this hack is no longer necessary with systemd
+ if $SYSTEMD ; then
+ return
+ fi
+
local line
local ws
ws=' '
# {{{ gpm
config_gpm(){
- if checkbootparam 'nogpm'; then
- ewarn "Not starting GPM as requested on boot commandline." ; eend 0
- else
- if ! [ -r /dev/input/mice ] ; then
+ if checkbootparam 'nogpm'; then
+ ewarn "Not starting GPM as requested on boot commandline." ; eend 0
+ else
+ if ! [ -r /dev/input/mice ] ; then
eerror "No mouse found - not starting GPM." ; eend 1
- else
+ else
einfo "Starting gpm in background."
service_wrapper gpm start >>$DEBUG &
# ( while [ ! -e /dev/psaux ]; do sleep 5; done; /etc/init.d/gpm start >>$DEBUG ) &
eend 0
- fi
- fi
+ fi
+ fi
}
# }}}
# {{{ start X window system via grml-x
config_x_startup(){
- if $SYSTEMD ; then
- ewarn "The startx boot option isn't yet supported via systemd, sorry." ; eend 0
- return
- fi
# make sure we start X only if startx is used *before* a nostartx option
# so it's possible to disable automatic X startup using nostart
fi
einfo "Setting up and invoking grml-x ${WINDOWMANAGER}. Just exit X windows system to get full featured consoles."
config_userlocal
- cat>|/etc/init.d/xstartup<<EOF
+ if $SYSTEMD ; then
+ cat>|/etc/init.d/startx<<EOF
+#!/bin/sh
+chgrp tty \${TTY}
+chmod g=rw \${TTY}
+sudo -u "${localuser}" /usr/bin/grml-x ${WINDOWMANAGER}
+EOF
+ chmod 755 /etc/init.d/startx
+ chvt 6
+ return
+ fi
+ cat>|/etc/init.d/startx<<EOF
#!/bin/sh
-su $localuser -c "/usr/bin/grml-x ${WINDOWMANAGER}"
+su "${localuser}" -c "/usr/bin/grml-x ${WINDOWMANAGER}"
EOF
- chmod 755 /etc/init.d/xstartup
+ chmod 755 /etc/init.d/startx
- # adjust inittab for xstartup
+ # adjust inittab for startx
if grep -q '^6:' /etc/inittab ; then
- sed -i 's|^6:.*|6:2345:respawn:/bin/zsh --login -c "/etc/init.d/xstartup ; /usr/share/grml-scripts/run-welcome" >/dev/tty6 2>\&1 </dev/tty6|' /etc/inittab
+ sed -i 's|^6:.*|6:2345:respawn:/bin/zsh --login -c "/etc/init.d/startx ; /usr/share/grml-scripts/run-welcome" >/dev/tty6 2>\&1 </dev/tty6|' /etc/inittab
else # just append tty6 to inittab if no definition is present:
- echo '6:2345:respawn:/bin/zsh --login -c "/etc/init.d/xstartup ; /usr/share/grml-scripts/run-welcome" >/dev/tty6 2>&1 < /dev/tty6' >> /etc/inittab
+ echo '6:2345:respawn:/bin/zsh --login -c "/etc/init.d/startx ; /usr/share/grml-scripts/run-welcome" >/dev/tty6 2>&1 < /dev/tty6' >> /etc/inittab
fi
/sbin/telinit q ; eend $?
if ! checkbootparam 'swraid' ; then
eindent
- einfo "Just run 'Start mdadm-raid' to assemble md arrays or boot using 'swraid' as bootoption for autostart."
+ if $SYSTEMD ; then
+ einfo "Just run 'Start mdmonitor' to assemble md arrays or boot using 'swraid' as bootoption for autostart."
+ else
+ einfo "Just run 'Start mdadm-raid' to assemble md arrays or boot using 'swraid' as bootoption for autostart."
+ fi
eoutdent
else
einfo "Bootoption swraid found. Searching for software RAID arrays:"
if lvdisplay 2>&1 | grep -v 'No volume groups found' >/dev/null 2>&1 ; then
einfo "You seem to have logical volumes (LVM) on your system."
eindent
- einfo "Just run 'Start lvm2' to activate them or boot using 'lvm' as bootoption for autostart."
+ if $SYSTEMD ; then
+ einfo "Just run 'Start lvm2-lvmetad' to activate them or boot using 'lvm' as bootoption for autostart."
+ else
+ einfo "Just run 'Start lvm2' to activate them or boot using 'lvm' as bootoption for autostart."
+ fi
eend 0
if checkbootparam 'lvm' ; then
einfo "Bootoption LVM found. Searching for logical volumes:"
- service_wrapper lvm2 start ; eend $?
+ if $SYSTEMD ; then
+ service_wrapper lvm2-lvmetad start ; eend $?
+ else
+ service_wrapper lvm2 start ; eend $?
+ fi
fi
eoutdent
fi