1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 07_support_findiso.dpatch by Michael Schierl <schierlm@gmx.de>
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: support for findoiso bootoption
6 # When booting with findiso=/grml_2010.05.iso, it will look for
7 # that .iso file on all disks where it usually looks for the .squashfs
8 # file. When it is found, the disk containing the iso is read-only mounted
9 # as /live/findiso (and exposed there after boot completed). The squashfs
10 # file is searched inside that ISO file then.
13 diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' live-initramfs-grml~/grml/05mountpoints live-initramfs-grml/grml/05mountpoints
14 --- live-initramfs-grml~/grml/05mountpoints 2010-05-11 11:00:21.000000000 +0200
15 +++ live-initramfs-grml/grml/05mountpoints 2010-05-11 11:03:07.087928541 +0200
17 # example when booting FAI, this simple workaround solves it
18 ls /root/* >/dev/null 2>&1
20 +# Move findiso directory to the new root filesystem so that programs there can get at it.
21 +if [ -d /live/findiso -a ! -d /root/live/findiso ]
23 + mkdir -p /root/live/findiso
24 + mount -n --move /live/findiso /root/live/findiso
27 +# if we do not unmount the ISO we can't run "fsck /dev/ice" later on
28 +# because the mountpoint is left behind in /proc/mounts, so let's get
29 +# rid of it when running from RAM
30 +if [ -n "$FINDISO" ] && [ "${TORAM}" ]
32 + losetup -d /dev/loop0
33 + grep -q /live/findiso /proc/mounts && umount /root/live/findiso
38 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
39 --- live-initramfs-grml~/scripts/live 2010-05-11 11:00:21.000000000 +0200
40 +++ live-initramfs-grml/scripts/live 2010-05-11 11:03:37.210427405 +0200
42 export HOSTNAME LIVECONF
46 + FINDISO="${ARGUMENT#findiso=}"
51 FROMISO="${ARGUMENT#*=}"
53 @@ -1593,6 +1598,18 @@
54 mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue
55 [ -n "$devuid" ] && echo "$devuid" >> $tried
57 + if [ -n "${FINDISO}" ]
59 + if [ -f ${mountpoint}/${FINDISO} ]; then
60 + umount ${mountpoint}
61 + mkdir /live/findiso -p
62 + mount -t ${fstype} -o ro,noatime "${devname}" /live/findiso
63 + loopdevname=$(setup_loop "/live/findiso/${FINDISO}" "loop" "/sys/block/loop*" "" '')
64 + devname="${loopdevname}"
65 + mount -t iso9660 -o ro,noatime "${devname}" ${mountpoint}
69 if is_live_path ${mountpoint} && \
70 ([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint})