Support cciss host adapter in bootoption isofrom.
authorMichael Prokop <mika@grml.org>
Thu, 11 Mar 2010 10:40:25 +0000 (11:40 +0100)
committerMichael Prokop <mika@grml.org>
Thu, 11 Mar 2010 10:41:55 +0000 (11:41 +0100)
debian/changelog
debian/patches/00list
debian/patches/15_support_cciss_in_isofrom.dpatch [new file with mode: 0755]

index af9199c..a9709f3 100644 (file)
@@ -2,8 +2,9 @@ live-initramfs (1.173.3-1grml.02) unstable; urgency=low
 
   * New patch to prefer removable devices over non-removable devices,
     so scan them first.
+  * Support cciss host adapter in bootoption isofrom. [Closes: issue827]
 
- -- Michael Prokop <mika@grml.org>  Thu, 11 Mar 2010 10:18:05 +0100
+ -- Michael Prokop <mika@grml.org>  Thu, 11 Mar 2010 11:39:38 +0100
 
 live-initramfs (1.173.3-1grml.01) unstable; urgency=low
 
index f754b0f..2f254fb 100644 (file)
@@ -7,3 +7,4 @@
 12_uuid_support.dpatch
 13_always_display_warnings_and_failures.dpatch
 14_prefer_removable_devices.dpatch
+15_support_cciss_in_isofrom.dpatch
diff --git a/debian/patches/15_support_cciss_in_isofrom.dpatch b/debian/patches/15_support_cciss_in_isofrom.dpatch
new file mode 100755 (executable)
index 0000000..4fb21fd
--- /dev/null
@@ -0,0 +1,47 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 15_support_cciss_in_isofrom.dpatch by Michael Prokop <mika@grml.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Support unusual device names like /dev/cciss/c0d0p1 in isofrom bootoption.
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' live-initramfs-grml~/scripts/live live-initramfs-grml/scripts/live
+--- live-initramfs-grml~/scripts/live  2010-03-11 11:27:33.574467706 +0100
++++ live-initramfs-grml/scripts/live   2010-03-11 11:35:59.275256127 +0100
+@@ -1537,12 +1537,30 @@
+       # support for fromiso=.../isofrom=....
+       if [ -n "$FROMISO" ]
+       then
+-              mkdir /isofrom
+-              ISO_DEVICE="$(echo $FROMISO | sed 's|\(/dev/[a-z]*[0-9]*\).*|\1|')"
+-              mount "$ISO_DEVICE" /isofrom
+-              ISO_NAME="$(echo $FROMISO | sed 's|/dev/[a-z]*[0-9]*/||')"
+-              loopdevname=$(setup_loop "/isofrom/${ISO_NAME}" "loop" "/sys/block/loop*" "" '')
+-              devname="${loopdevname}"
++              ISO_DEVICE=$(dirname $FROMISO)
++              if ! [ -b $ISO_DEVICE ]
++              then
++                      # to support unusual device names like /dev/cciss/c0d0p1
++                      # as well we have to identify the block device name, let's
++                      # do that for up to 10 levels
++                      i=10
++                      while ! [ -b "$ISO_DEVICE" ] && [ -n "$ISO_DEVICE" ] && [ "$ISO_DEVICE" != "/dev" ] && [ "$i" -gt 0 ]
++                      do
++                              ISO_DEVICE=$(dirname ${ISO_DEVICE%/*})
++                              i=$(($i -1))
++                      done
++              fi
++              
++              if [ "$ISO_DEVICE" = "/dev" ]
++              then
++                      echo "Warning: specified device for bootoption isofrom= ($FROMISO) not found.">>/live.log
++              else
++                      mkdir /isofrom
++                      mount "$ISO_DEVICE" /isofrom
++                      ISO_NAME="$(echo $FROMISO | sed "s|$ISO_DEVICE||")"
++                      loopdevname=$(setup_loop "/isofrom/${ISO_NAME}" "loop" "/sys/block/loop*" "" '')
++                      devname="${loopdevname}"
++              fi
+       fi
+       if [ -z "${devname}" ]