diff -up mkinitrd-6.0.93/mkinitrd.remove-bash4ism mkinitrd-6.0.93/mkinitrd --- mkinitrd-6.0.93/mkinitrd.remove-bash4ism 2010-04-11 23:09:41.000000000 +0900 +++ mkinitrd-6.0.93/mkinitrd 2010-04-12 01:07:01.000000000 +0900 @@ -345,7 +345,7 @@ findstoragedriverinsys () { sysfs=$(readlink ${sysfs%/*}) fi - if [[ ! "$sysfs" =~ '^/sys/.*block/.*$' ]]; then + if ! (echo "$sysfs" | egrep -q '^/sys/.*block/.*$' ); then error "WARNING: $sysfs is a not a block sysfs path, skipping" return fi @@ -356,12 +356,12 @@ findstoragedriverinsys () { *) handleddevices="$handleddevices $sysfs" ;; esac - if [[ "$sysfs" =~ '^/sys/.*block/md[0-9]+$' ]]; then + if ( echo "$sysfs" | egrep -q '^/sys/.*block/md[0-9]+$' ); then local raid=${sysfs##*/} vecho "Found MDRAID component $raid" handleraid $raid fi - if [[ "$sysfs" =~ '^/sys/.*block/dm-[0-9]+$' ]]; then + if ( echo "$sysfs" | egrep -q '^/sys/.*block/dm-[0-9]+$' ); then vecho "Found DeviceMapper component ${sysfs##*/}" handledm $(cat $sysfs/dev |cut -d : -f 1) $(cat $sysfs/dev |cut -d : -f 2) fi @@ -541,7 +541,7 @@ handledm() { dmname=$(dmsetup info -j $major -m $minor -c --noheadings -o name) # do the device resolution dance to get /dev/mapper/foo # since 'lvm lvs' doesn't like dm-X device nodes - if [[ "$slavedev" =~ ^dm- ]]; then + if (echo "$slavedev" | egrep -q '^dm-' ); then majmin=$(get_numeric_dev dec "/dev/$slavedev") for dmdev in /dev/mapper/* ; do dmnum=$(get_numeric_dev dev $dmdev) @@ -1266,7 +1266,7 @@ if [ "x$PROBE" == "xyes" ]; then else # check if it's root by label rdev=$rootdev - if [[ "$rdev" =~ ^(UUID=|LABEL=) ]]; then + if ( echo "$rdev" | egrep -q '^(UUID=|LABEL=)' ); then rdev=$(resolve_device_name "$rdev") fi rootopts=$(echo $rootopts | sed -e 's/^r[ow],//' -e 's/,_netdev//' -e 's/_netdev//' -e 's/,r[ow],$//' -e 's/,r[ow],/,/' -e 's/^r[ow]$/defaults/' -e 's/$/,ro/') @@ -1277,7 +1277,7 @@ if [ "x$PROBE" == "xyes" ]; then [ -z "$thawdev" ] && thawdev=$(awk '/^[ \t]*[^#]/ { if ($3 == "swap") { print $1; exit }}' $fstab) swsuspdev="$thawdev" if [ -n "$swsuspdev" ]; then - if [[ "$swsuspdev" =~ ^(UUID=|LABEL=) ]]; then + if ( echo "$swsuspdev" | egrep -q '^(UUID=|LABEL=)' ); then swsuspdev=$(resolve_device_name "$swsuspdev") fi findstoragedriver "$swsuspdev" @@ -1315,7 +1315,7 @@ fi # loopfs : filesystem of loopdev # loopots : options to mount loopfs -if [ -n "${loopfs}" ] || [[ "$rootopts" =~ "loop" ]]; then +if [ -n "${loopfs}" ] || (echo "$rootopts" | grep "loop" ); then # FIXME: probe this somehow? rootdev=/dev/loop0 @@ -1546,12 +1546,12 @@ emitmodules() { # we mount usbfs before the first module *after* the HCDs if [ "$usb_mounted" == "prep" ]; then - if [[ "$module" =~ ".hci[_-]hcd" ]]; then + if (echo "$module" | egrep -q ".hci[_-]hcd" ); then usb_mounted="no" found_hcd_module="yes" fi elif [ "$usb_mounted" == "no" ]; then - if [[ ! "$module" =~ ".hci[_-]hcd" ]]; then + if ! (echo "$module" | egrep -q ".hci[_-]hcd" ); then usb_mounted=yes emit "mount -t usbfs /proc/bus/usb /proc/bus/usb" fi @@ -1566,7 +1566,7 @@ emitmodules() { # Hack - we need a delay after loading usb-storage to give things # time to settle down before we start looking a block devices - if [[ "$module" =~ usb[_-]storage ]] || [ "$module" = "ub" ]; then + if (echo "$module" | egrep -q 'usb[_-]storage' ) || [ "$module" = "ub" ]; then if [ "$found_hcd_module" == "no" -a "$usb_mounted" == "prep" ]; then usb_mounted=yes emit "mount -t usbfs /proc/bus/usb /proc/bus/usb" @@ -1843,7 +1843,7 @@ if [ -z "$noresume" ]; then if [ -n "$tuxonicefwtarget" ]; then inst_tuxonice $SWSUSPPROC $MNTIMAGE $tuxonicefwtarget $USERUIPROC elif [ -n "$swsuspdev" ]; then - if [[ "$swsuspdev" =~ ^(UUID=|LABEL=) ]]; then + if (echo "$swsuspdev" | egrep -q '^(UUID=|LABEL=)' ); then swsuspdev=$(resolve_device_name "$swsuspdev") fi