X-Git-Url: http://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=aa85c0824e041960aca3fe73aac30be8813e7d3d;hp=7a8e3978e625bae8582f991b1dc931d3256e8d8e;hb=aea47d4ad4c27fd01432d76ebb3c5477f73cff97;hpb=493dfc88f8fe5fd540fb08bb5750dc6aa95aa9d9 diff --git a/autoconfig.functions b/autoconfig.functions index 7a8e397..aa85c08 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -937,9 +937,13 @@ fi # {{{ Start creating /etc/fstab with HD partitions and USB SCSI devices now config_fstab(){ + NOSWAP="" -checkbootparam "noswap" && NOSWAP="yes" -if checkbootparam "nofstab"; then +if checkbootparam "noswap" -o checkbootparam "forensic" ; then + NOSWAP="yes" +fi + +if checkbootparam "nofstab" -o checkbootparam "forensic" ; then ewarn "Skipping /etc/fstab creation as requested on boot commandline." ; eend 0 else checkbootparam "anyswap" && export ANYSWAP='yes' || export ANYSWAP="" @@ -1708,7 +1712,7 @@ fi } config_automount(){ -if checkbootparam noautoconfig ; then +if checkbootparam noautoconfig -o checkbootparam forensic ; then ewarn "Skipping running automount of device(s) labeled GRMLCFG as requested." ; eend 0 else if [ -z "$INSTALLED" ] ; then @@ -1989,14 +1993,23 @@ fi # {{{ SW-RAID config_swraid(){ if [ -z "$INSTALLED" ] ; then - if checkbootparam "noraid" -o checkbootparam "forensic" ; then + # notice: checkbootparam "forensic" is just for users who don't know how to really use the bootoption + if checkbootparam "noraid" -o checkbootparam "forensic" -o checkbootparam "raid=noautodetect" ; then ewarn "Skipping search for SW-RAID as requested on boot commandline." ; eend 0 else if ! [ -x /sbin/mdadm ] ; then eerror "mdadm not available, can not execute it." ; eend 1 else - einfo "Searching for software RAID arrays:" + if ! grep -q ARRAY /etc/mdadm/mdadm.conf 2>>$DEBUG ; then + einfo "Creating /etc/mdadm/mdadm.conf" + [ -r /etc/mdadm/mdadm.conf ] && mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.old + /usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf ; eend $? + else + ewarn "/etc/mdadm/mdadm.conf looks like a configured mdadm setup, will not touch it." ; eend 0 + fi + + einfo "Searching for software RAID arrays (disable via bootoption noraid):" eindent IFSOLD=${IFS:-} IFS='