PATCH mkinitrd: Make mkinitrd work with kernels < 2.6.29 (#487358, #489151)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make mkinitrd work with kernels < 2.6.29 and for people woho have compiled
custom kernels with CONFIG_SYSFS_DEPRECATED_V2 set. This is esp. important
so that things won't break for people using yum to go from F-9/F-10 -> F-11
---
 mkinitrd |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/mkinitrd b/mkinitrd
index 21dad0f..657d4ce 100755
--- a/mkinitrd
+++ b/mkinitrd
@@ -323,11 +323,11 @@ findstoragedriverinsys () {
     local sysfs=$(readlink "$1")

     # if its a partition look at the device holding the partition
-    if [ -f "$sysfs/partition" ]; then
+    if [ -f "$sysfs/start" ]; then
         sysfs=$(readlink ${sysfs%/*})
     fi

-    if [[ ! "$sysfs" =~ '^/sys/devices/.*/block/.*$' ]]; then
+    if [[ ! "$sysfs" =~ '^/sys/.*block/.*$' ]]; then
         error "WARNING: $sysfs is a not a block sysfs path, skipping"
         return
     fi
@@ -338,12 +338,12 @@ findstoragedriverinsys () {
         *) handleddevices="$handleddevices $sysfs" ;;
     esac

-    if [[ "$sysfs" =~ '^/sys/devices/virtual/block/md[0-9]+$' ]]; then
+    if [[ "$sysfs" =~ '^/sys/.*block/md[0-9]+$' ]]; then
         local raid=${sysfs##*/}
         vecho "Found MDRAID component $raid"
         handleraid $raid
     fi
-    if [[ "$sysfs" =~ '^/sys/devices/virtual/block/dm-[0-9]+$' ]]; then
+    if [[ "$sysfs" =~ '^/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
--
1.6.1.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux