[SCM] live-boot branch, debian-next, updated. debian/3.0_a26-1-15-g9cd39e1
Tails developers
amnesia at boum.org
Sun Apr 8 18:32:38 UTC 2012
The following commit has been merged in the debian-next branch:
commit 931814d0796d3d403357bf05645052421244ca7a
Author: Tails developers <amnesia at boum.org>
Date: Sun Apr 8 20:23:57 2012 +0200
Adding support for the findiso boot parameter.
Thanks to the grml team for the initial patch,
thanks to adrian15sgd at gmail.com for bringing it to a mergeable state.
diff --git a/manpages/en/live-boot.7 b/manpages/en/live-boot.7
index 3d92e62..e5ac8ab 100644
--- a/manpages/en/live-boot.7
+++ b/manpages/en/live-boot.7
@@ -66,6 +66,8 @@ Target <target-name>
Lun 0 Path=<path-to-your-live-image.iso>,Type=fileio,IOMode=ro
# If you want to boot multiple machines you might want to look at tuning some parameters like
# Wthreads or MaxConnections
+.IP "\fBfindiso\fR=\fI/PATH/TO/IMAGE\fI" 4
+Look for the specified ISO file on all disks where it usually looks for the .squashfs file (so you don't have to know the device name as in fromiso=....).
.IP "\fBfromiso\fR=\fI/PATH/TO/IMAGE\fI" 4
Allows to use a filesystem from within an iso image that's available on live-media.
.IP "\fBignore_uuid\fR" 4
diff --git a/scripts/live b/scripts/live
index 46407c1..8046cc2 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1355,6 +1355,21 @@ check_dev ()
mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue
[ -n "$devuid" ] && echo "$devuid" >> $tried
+ if [ -n "${FINDISO}" ]
+ then
+ if [ -f ${mountpoint}/${FINDISO} ]
+ then
+ umount ${mountpoint}
+ mkdir -p /live/findiso
+ mount -t ${fstype} -o ro,noatime "${devname}" /live/findiso
+ loopdevname=$(setup_loop "/live/findiso/${FINDISO}" "loop" "/sys/block/loop*" 0 "")
+ devname="${loopdevname}"
+ mount -t iso9660 -o ro,noatime "${devname}" ${mountpoint}
+ else
+ umount ${mountpoint}
+ fi
+ fi
+
if is_live_path ${mountpoint} && \
([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint})
then
@@ -1641,6 +1656,26 @@ mountroot ()
# when booting FAI, this simple workaround solves it
ls /root/* >/dev/null 2>&1
+ # Move findiso directory to the new root filesystem so that programs there can get at it.
+ if [ -d /live/findiso ] && [ ! -d /root/live/findiso ]
+ then
+ mkdir -p /root/live/findiso
+ mount -n --move /live/findiso /root/live/findiso
+ fi
+
+ # if we do not unmount the ISO we can't run "fsck /dev/ice" later on
+ # because the mountpoint is left behind in /proc/mounts, so let's get
+ # rid of it when running from RAM
+ if [ -n "$FINDISO" ] && [ "${TORAM}" ]
+ then
+ losetup -d /dev/loop0
+
+ if is_mountpoint /live/findiso
+ then
+ umount /root/live/findiso
+ fi
+ fi
+
# copy snapshot configuration if exists
if [ -f snapshot.conf ]
then
diff --git a/scripts/live-helpers b/scripts/live-helpers
index e25e4bc..456c2d7 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -143,6 +143,11 @@ Arguments ()
export STATICIP
;;
+ findiso=*)
+ FINDISO="${ARGUMENT#findiso=}"
+ export FINDISO
+ ;;
+
live-getty)
LIVE_GETTY="1"
export LIVE_GETTY
@@ -1579,3 +1584,15 @@ fix_home_rw_compatibility ()
/home source=." > "${include_list}"
fi
}
+
+is_mountpoint () {
+
+ directory="$1"
+
+ if [ $(stat -fc%d:%D "${directory}") != $(stat -fc%d:%D "${directory}/..") ]
+ then
+ return 0
+ else
+ return 1
+ fi
+}
--
live-boot
More information about the debian-live-changes
mailing list