Apply patch by Michael Schierl to support bootoption findiso
authorMichael Prokop <mika@grml.org>
Mon, 12 Jan 2009 14:45:28 +0000 (15:45 +0100)
committerMichael Prokop <mika@grml.org>
Mon, 12 Jan 2009 14:45:28 +0000 (15:45 +0100)
debian/changelog
debian/patches/00list
debian/patches/07_support_findiso.dpatch [new file with mode: 0755]

index 78b2462..e64a348 100644 (file)
@@ -1,3 +1,10 @@
+live-initramfs (1.154.4-1grml.02) unstable; urgency=low
+
+  * Apply patch by Michael Schierl <schierlm@gmx.de> for bootoption
+    findiso (usage: like findiso=/grml_2008.11.iso). Thanks!
+
+ -- Michael Prokop <mika@grml.org>  Mon, 12 Jan 2009 15:44:33 +0100
+
 live-initramfs (1.154.4-1grml.01) unstable; urgency=low
 
   * Disable several configuration options in /etc/live.conf as we don't
index 85ceb69..6065f92 100644 (file)
@@ -4,3 +4,4 @@
 04_fix_no_medium_found_error.dpatch
 05_boot_failure_message_grml.dpatch
 06_support_fromiso_isofrom.dpatch
+07_support_findiso.dpatch
diff --git a/debian/patches/07_support_findiso.dpatch b/debian/patches/07_support_findiso.dpatch
new file mode 100755 (executable)
index 0000000..c55bfd3
--- /dev/null
@@ -0,0 +1,60 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 07_support_findiso.dpatch by Michael Schierl <schierlm@gmx.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: support for findoiso bootoption
+# When booting with findiso=/grml_2008.11.iso, it will look for
+# that .iso file on all disks where it usually looks for the .squashfs
+# file. When it is found, the disk containing the iso is read-only mounted
+# as /live/findiso (and exposed there after boot completed). The squashfs
+# file is searched inside that ISO file then.
+
+@DPATCH@
+diff -urNad live-initramfs-grml~/scripts/live live-initramfs-grml/scripts/live
+--- live-initramfs-grml~/scripts/live  2009-01-12 15:42:17.752549464 +0100
++++ live-initramfs-grml/scripts/live   2009-01-12 15:42:20.323387590 +0100
+@@ -92,6 +92,11 @@
+                               export HOSTNAME LIVECONF
+                               ;;
++                      findiso=*)
++                              FINDISO="${ARGUMENT#findiso=}"
++                              export FINDISO
++                              ;;
++
+                       isofrom=*|fromiso=*)
+                               FROMISO="${ARGUMENT#*=}"
+                               export FROMISO
+@@ -1385,6 +1390,17 @@
+       if is_supported_fs ${fstype}
+       then
+               mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue
++              if [ -n "${FINDISO}" ]
++              then
++                      if [ -f ${mountpoint}${FINDISO} ]; then
++                              umount ${mountpoint}
++                              mkdir /live/findiso -p
++                              mount -t ${fstype} -o ro,noatime "${devname}" /live/findiso
++                              loopdevname=$(setup_loop "/live/findiso${FINDISO}" "loop" "/sys/block/loop*" "" '')
++                              devname="${loopdevname}"
++                              mount -t iso9660 -o ro,noatime "${devname}" ${mountpoint}
++                      fi
++              fi
+               if is_live_path ${mountpoint} && \
+                       ([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint})
+diff -urNad live-initramfs-grml~/scripts/live-bottom/05mountpoints live-initramfs-grml/scripts/live-bottom/05mountpoints
+--- live-initramfs-grml~/scripts/live-bottom/05mountpoints     2008-11-04 01:20:22.000000000 +0100
++++ live-initramfs-grml/scripts/live-bottom/05mountpoints      2009-01-12 15:42:20.323387590 +0100
+@@ -33,4 +33,11 @@
+       mount --move /live/image /root/live/image
+ fi
++# Move findiso directory to the new root filesystem so that programs there can get at it.
++if [ -d /live/findiso -a ! -d /root/live/findiso ]
++then
++      mkdir -p /root/live/findiso
++      mount -n --move /live/findiso /root/live/findiso
++fi
++
+ log_end_msg