| Revision 806, 4.4 KB checked in by daisuke, 16 years ago (diff) |
|---|
diff -up mkinitrd-6.0.93/mkinitrd.remove-bash4ism mkinitrd-6.0.93/mkinitrd
| old | new | findstoragedriverinsys () { |
|---|---|---|
| 345 | 345 | sysfs=$(readlink ${sysfs%/*}) |
| 346 | 346 | fi |
| 347 | 347 | |
| 348 | if |
|
| 348 | if ! (echo "$sysfs" | egrep -q '^/sys/.*block/.*$' ); then | |
| 349 | 349 | error "WARNING: $sysfs is a not a block sysfs path, skipping" |
| 350 | 350 | return |
| 351 | 351 | fi |
| … | … | findstoragedriverinsys () { |
| 356 | 356 | *) handleddevices="$handleddevices $sysfs" ;; |
| 357 | 357 | esac |
| 358 | 358 | |
| 359 | if |
|
| 359 | if ( echo "$sysfs" | egrep -q '^/sys/.*block/md[0-9]+$' ); then | |
| 360 | 360 | local raid=${sysfs##*/} |
| 361 | 361 | vecho "Found MDRAID component $raid" |
| 362 | 362 | handleraid $raid |
| 363 | 363 | fi |
| 364 | if |
|
| 364 | if ( echo "$sysfs" | egrep -q '^/sys/.*block/dm-[0-9]+$' ); then | |
| 365 | 365 | vecho "Found DeviceMapper component ${sysfs##*/}" |
| 366 | 366 | handledm $(cat $sysfs/dev |cut -d : -f 1) $(cat $sysfs/dev |cut -d : -f 2) |
| 367 | 367 | fi |
| … | … | handledm() { |
| 541 | 541 | dmname=$(dmsetup info -j $major -m $minor -c --noheadings -o name) |
| 542 | 542 | # do the device resolution dance to get /dev/mapper/foo |
| 543 | 543 | # since 'lvm lvs' doesn't like dm-X device nodes |
| 544 | if |
|
| 544 | if (echo "$slavedev" | egrep -q '^dm-' ); then | |
| 545 | 545 | majmin=$(get_numeric_dev dec "/dev/$slavedev") |
| 546 | 546 | for dmdev in /dev/mapper/* ; do |
| 547 | 547 | dmnum=$(get_numeric_dev dev $dmdev) |
| … | … | if [ "x$PROBE" == "xyes" ]; then |
| 1266 | 1266 | else |
| 1267 | 1267 | # check if it's root by label |
| 1268 | 1268 | rdev=$rootdev |
| 1269 | if |
|
| 1269 | if ( echo "$rdev" | egrep -q '^(UUID=|LABEL=)' ); then | |
| 1270 | 1270 | rdev=$(resolve_device_name "$rdev") |
| 1271 | 1271 | fi |
| 1272 | 1272 | 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/') |
| … | … | if [ "x$PROBE" == "xyes" ]; then |
| 1277 | 1277 | [ -z "$thawdev" ] && thawdev=$(awk '/^[ \t]*[^#]/ { if ($3 == "swap") { print $1; exit }}' $fstab) |
| 1278 | 1278 | swsuspdev="$thawdev" |
| 1279 | 1279 | if [ -n "$swsuspdev" ]; then |
| 1280 | if |
|
| 1280 | if ( echo "$swsuspdev" | egrep -q '^(UUID=|LABEL=)' ); then | |
| 1281 | 1281 | swsuspdev=$(resolve_device_name "$swsuspdev") |
| 1282 | 1282 | fi |
| 1283 | 1283 | findstoragedriver "$swsuspdev" |
| … | … | fi |
| 1315 | 1315 | # loopfs : filesystem of loopdev |
| 1316 | 1316 | # loopots : options to mount loopfs |
| 1317 | 1317 | |
| 1318 | if [ -n "${loopfs}" ] || |
|
| 1318 | if [ -n "${loopfs}" ] || (echo "$rootopts" | grep "loop" ); then | |
| 1319 | 1319 | # FIXME: probe this somehow? |
| 1320 | 1320 | |
| 1321 | 1321 | rootdev=/dev/loop0 |
| … | … | emitmodules() { |
| 1546 | 1546 | |
| 1547 | 1547 | # we mount usbfs before the first module *after* the HCDs |
| 1548 | 1548 | if [ "$usb_mounted" == "prep" ]; then |
| 1549 | if |
|
| 1549 | if (echo "$module" | egrep -q ".hci[_-]hcd" ); then | |
| 1550 | 1550 | usb_mounted="no" |
| 1551 | 1551 | found_hcd_module="yes" |
| 1552 | 1552 | fi |
| 1553 | 1553 | elif [ "$usb_mounted" == "no" ]; then |
| 1554 | if |
|
| 1554 | if ! (echo "$module" | egrep -q ".hci[_-]hcd" ); then | |
| 1555 | 1555 | usb_mounted=yes |
| 1556 | 1556 | emit "mount -t usbfs /proc/bus/usb /proc/bus/usb" |
| 1557 | 1557 | fi |
| … | … | emitmodules() { |
| 1566 | 1566 | |
| 1567 | 1567 | # Hack - we need a delay after loading usb-storage to give things |
| 1568 | 1568 | # time to settle down before we start looking a block devices |
| 1569 | if |
|
| 1569 | if (echo "$module" | egrep -q 'usb[_-]storage' ) || [ "$module" = "ub" ]; then | |
| 1570 | 1570 | if [ "$found_hcd_module" == "no" -a "$usb_mounted" == "prep" ]; then |
| 1571 | 1571 | usb_mounted=yes |
| 1572 | 1572 | emit "mount -t usbfs /proc/bus/usb /proc/bus/usb" |
| … | … | if [ -z "$noresume" ]; then |
| 1843 | 1843 | if [ -n "$tuxonicefwtarget" ]; then |
| 1844 | 1844 | inst_tuxonice $SWSUSPPROC $MNTIMAGE $tuxonicefwtarget $USERUIPROC |
| 1845 | 1845 | elif [ -n "$swsuspdev" ]; then |
| 1846 | if |
|
| 1846 | if (echo "$swsuspdev" | egrep -q '^(UUID=|LABEL=)' ); then | |
| 1847 | 1847 | swsuspdev=$(resolve_device_name "$swsuspdev") |
| 1848 | 1848 | fi |
| 1849 | 1849 |