diff --git a/README b/README old mode 100755 new mode 100644 diff --git a/functions.sh b/functions.sh index 61bc556..d4250ac 100755 --- a/functions.sh +++ b/functions.sh @@ -746,11 +746,11 @@ validate_vars() { fi # test if $DRIVE1 is not busy - CHECK="$(hdparm -z $DRIVE1 2>&1 | grep 'BLKRRPART failed: Device or resource busy')" - if [ "$CHECK" ]; then - graph_error "ERROR: DRIVE1 is busy - cannot access device $DRIVE1 " - return 1 - fi +# CHECK="$(hdparm -z $DRIVE1 2>&1 | grep 'BLKRRPART failed: Device or resource busy')" +# if [ "$CHECK" ]; then +# graph_error "ERROR: DRIVE1 is busy ($CHECK) - cannot access device $DRIVE1 " +# return 1 +# fi # test if $SWRAID has not 0 or 1 as parameter if [ "$SWRAID" != "0" -a "$SWRAID" != "1" ]; then @@ -3540,7 +3540,7 @@ function isVServer() { *) debug "# Systype: $SYSTYPE" case "$SYSMFC" in - QEMU) + QEMU) debug "# Manufacturer: $SYSMFC" return 0;; *) diff --git a/suse.sh b/suse.sh index 4c7eb00..296a08f 100755 --- a/suse.sh +++ b/suse.sh @@ -80,7 +80,7 @@ generate_config_mdadm() { echo "DEVICES /dev/[hs]d*" > $FOLD/hdd$MDADMCONF echo "MAILADDR root" >> $FOLD/hdd$MDADMCONF if [ "$SUSEVERSION" -ge 132 ] ; then - echo > $FOLD/hdd$MDADMCONF + echo >> $FOLD/hdd$MDADMCONF fi # if [ "$SUSEVERSION" = "11.0" -o "$SUSEVERSION" = "11.2" -o "$SUSEVERSION" = "11.3" -o "$SUSEVERSION" = "11.4" -o "$SUSEVERSION" = "12.1" -o "$SUSEVERSION" = "12.2" ]; then if [ "$SUSEVERSION" -ge 110 ]; then @@ -102,18 +102,18 @@ generate_new_ramdisk() { # opensuse 13.2 uses dracut for generating initrd if [ "$SUSEVERSION" -ge 132 ] ; then DRACUTFILE="$FOLD/hdd/etc/dracut.conf.d/03-hetzner.conf" - echo "add_dracutmodules+=\"mdraid lvm\"" >> $DRACUTFILE - echo "add_drivers+=\"raid1 raid10 raid0 raid456\"" >> $DRACUTFILE - echo "mdadmconf=\"yes\"" >> $DRACUTFILE - echo "lvmconf=\"yes\"" >> $DRACUTFILE - echo "hostonly=\"no\"" >> $DRACUTFILE - echo "early_microcode=\"no\"" >> $DRACUTFILE - +# echo "add_dracutmodules+=\"mdraid lvm\"" >> $DRACUTFILE +# echo "add_drivers+=\"raid1 raid10 raid0 raid456\"" >> $DRACUTFILE +# echo "mdadmconf=\"yes\"" >> $DRACUTFILE +# echo "lvmconf=\"yes\"" >> $DRACUTFILE +# echo "hostonly=\"no\"" >> $DRACUTFILE +# echo "early_microcode=\"no\"" >> $DRACUTFILE +# # dracut fix for auto-assembling raid - local mdraid_rule="$FOLD/hdd/usr/lib/udev/rules.d/64-md-raid-assembly.rules" - local dracut_rulesd="$FOLD/hdd/usr/lib/dracut/rules.d" - mkdir -p $dracut_rulesd - cp $mdraid_rule $dracut_rulesd +# local mdraid_rule="$FOLD/hdd/usr/lib/udev/rules.d/64-md-raid-assembly.rules" +# local dracut_rulesd="$FOLD/hdd/usr/lib/dracut/rules.d" +# mkdir -p $dracut_rulesd +# cp $mdraid_rule $dracut_rulesd else KERNELCONF="$FOLD/hdd/etc/sysconfig/kernel" @@ -131,6 +131,15 @@ generate_new_ramdisk() { echo -e "### especially in combination with nomodeset" >> $blacklist_conf echo -e "blacklist i915" >> $blacklist_conf + local dracut_feature='' + local dracut_modules='' + if [ "$SWRAID" = "1" ]; then + dracut_feature="$dracut_feature mdraid" + dracut_modules="$dracut_modules raid0 raid1 raid10 raid456" + fi + [ "$LVM" = "1" ] && dracut_feature="$dracut_feature lvm" + + # change the if contruct to test if [ "$SUSEVERSION" -ge 112 ]; then # mkinitrd doesn't have the switch -t anymore as of 11.2 and uses /dev/shm if it is writeable @@ -138,7 +147,14 @@ generate_new_ramdisk() { # run without updating bootloader as this would fail because of missing # or at this point still wrong device.map. # A device.map is temp. generated by grub2-install in 12.2 - execute_chroot_command "mkinitrd -B"; EXITCODE=$? + mkinitcmd="mkinitrd -B" + if [ "$SUSEVERSION" -ge 132 ]; then + [ -n "$dracut_feature" ] && mkinitcmd="$mkinitcmd -f '$dracut_feature'" + [ -n "$dracut_modules" ] && mkinitcmd="$mkinitcmd -m '$dracut_modules'" + execute_chroot_command "$mkinitcmd"; EXITCODE=$? + else + execute_chroot_command "$mkinitcmd"; EXITCODE=$? + fi else execute_chroot_command "mkinitrd"; EXITCODE=$? fi