Skip to content

Commit

Permalink
Adding support for isofrom/fromiso bootoption.
Browse files Browse the repository at this point in the history
  • Loading branch information
mika authored and daniel-baumann committed Jan 31, 2010
1 parent 75340e1 commit 0b23566
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions scripts/live
Expand Up @@ -97,6 +97,11 @@ Arguments ()
export HOSTNAME LIVECONF
;;

isofrom=*|fromiso=*)
FROMISO="${ARGUMENT#*=}"
export FROMISO
;;

username=*)
USERNAME="${ARGUMENT#username=}"
LIVECONF="changed"
Expand Down Expand Up @@ -1384,6 +1389,17 @@ check_dev ()
devname="${2}"
skip_uuid_check="${3}"

# 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}"
fi

if [ -z "${devname}" ]
then
devname=$(sys2dev "${sysdev}")
Expand Down Expand Up @@ -1655,6 +1671,15 @@ mountroot ()
log_end_msg
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 "$FROMISO" ] && [ "${TORAM}" ]
then
losetup -d /dev/loop0
grep -q /isofrom /proc/mounts && umount /isofrom
fi

if [ -n "${MODULETORAMFILE}" ] || [ -n "${PLAIN_ROOT}" ]
then
setup_unionfs "${livefs_root}" "${rootmnt}"
Expand Down

0 comments on commit 0b23566

Please sign in to comment.