X-Git-Url: http://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=6f774dbb13b1568397ea021c7701bd43eee657ea;hp=802db3894627721e837bedf9454168f5b75e7908;hb=ce5210b7e75aac4a11079f64640f545961be8db3;hpb=2b9d1d5a109a4802953d46aaa49269b61753376c diff --git a/autoconfig.functions b/autoconfig.functions index 802db38..6f774db 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -540,6 +540,27 @@ config_kernel(){ } # }}} +# {{{ 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: @@ -1205,18 +1226,18 @@ config_syslog(){ # {{{ 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 } # }}} @@ -1623,7 +1644,11 @@ config_swraid(){ 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:" @@ -1750,11 +1775,19 @@ config_lvm(){ 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