]> git.ipfire.org Git - thirdparty/dracut.git/blobdiff - mkinitrd-suse.sh
iscsi: always popd, even if there is no iscsi device
[thirdparty/dracut.git] / mkinitrd-suse.sh
index 0f2b3c4f82788950393f0e927db0ca63ccdf2249..b6af2b19a0dc7cd4af6f1f26fe266e9feaa198d9 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash --norc
 #
-# mkinitrd compability wrapper for SUSE.
+# mkinitrd compatibility wrapper for SUSE.
 #
 # Copyright (c) 2013 SUSE Linux Products GmbH. All rights reserved.
 #
@@ -62,7 +62,7 @@ usage () {
     $cmd "                             /etc/sysconfig/kernel."
     $cmd "     -d root_device          Root device. Defaults to the device from"
     $cmd "                             which / is mounted. Overrides the rootdev"
-    $cmd "                             enviroment variable if set."
+    $cmd "                             environment variable if set."
     $cmd "     -j device               Journal device"
     $cmd "     -D interface            Run dhcp on the specified interface."
     $cmd "     -I interface            Configure the specified interface statically."
@@ -104,7 +104,7 @@ calc_netmask() {
     local prefix=$1
 
     [ -z "$prefix" ] && return
-    mask=$(echo "(2 ^ 32) - (2 ^ $prefix)" | bc -l)
+    mask=$(( 0xffffffff << (32 - $prefix) ))
     byte1=$(( mask >> 24 ))
     byte2=$(( mask >> 16 ))
     byte3=$(( mask >> 8 ))
@@ -237,11 +237,13 @@ while (($# > 0)); do
        -k) # Would be nice to get a list of images here
            read_arg kernel_images "$@" || shift $?
            for kernel_image in $kernel_images;do
+               [ -L "/boot/$kernel_image" ] && kernel_image="$(readlink "/boot/$kernel_image")"
                kernels="$kernels ${kernel_image#*-}"
            done
            ;;
        -i) read_arg initrd_images "$@" || shift $?
            for initrd_image in $initrd_images;do
+               [ -L "/boot/$initrd_image" ] && initrd_image="$(readlink "/boot/$initrd_image")"
                # Check if the initrd_image contains a path.
                # if not, then add the default boot_dir
                dname=`dirname $initrd_image`
@@ -263,7 +265,7 @@ while (($# > 0)); do
            ;;
        -M) read_arg map_file "$@" || shift $?
            ;;
-       -A) host_only=0;;
+       -A) dracut_args="${dracut_args} --no-host-only";;
        -B) skip_update_bootloader=1;;
         -v|--verbose) dracut_args="${dracut_args} -v";;
        -L) logfile=;;