r2720 - dists/trunk/live-initramfs/scripts
matth-guest at alioth.debian.org
matth-guest at alioth.debian.org
Thu Aug 9 20:39:05 UTC 2007
Author: matth-guest
Date: 2007-08-09 20:39:05 +0000 (Thu, 09 Aug 2007)
New Revision: 2720
Modified:
dists/trunk/live-initramfs/scripts/live
Log:
adds runtime squashfs loading via http fetch
Modified: dists/trunk/live-initramfs/scripts/live
===================================================================
--- dists/trunk/live-initramfs/scripts/live 2007-08-08 12:53:57 UTC (rev 2719)
+++ dists/trunk/live-initramfs/scripts/live 2007-08-09 20:39:05 UTC (rev 2720)
@@ -55,6 +55,11 @@
set -x
;;
+ fetch=*)
+ FETCH="${ARGUMENT#fetch=}"
+ export FETCH
+ ;;
+
hostname=*)
HOSTNAME="${ARGUMENT#hostname=}"
LIVECONF="changed"
@@ -200,7 +205,7 @@
;;
url=*)
- LOCATION="${ARGUMENT#url=}"
+ location="${ARGUMENT#url=}"
mount -n -o bind /sys /root/sys
mount -n -o bind /proc /root/proc
@@ -339,6 +344,8 @@
mount_images_in_directory() {
directory="$1"
rootmnt="$2"
+ echo "DEBUG: directory: $directory rootmnt: $rootmnt"
+
if match_files_in_dir "$directory/${LIVE_MEDIA_PATH}/*.squashfs" ||
match_files_in_dir "$directory/${LIVE_MEDIA_PATH}/*.ext2" ||
match_files_in_dir "$directory/${LIVE_MEDIA_PATH}/*.ext3" ||
@@ -428,6 +435,11 @@
. /tmp/net-${DEVICE}.conf
export HOSTNAME
+ if [ -n "${FETCH}" ] && do_httpmount; then
+ rc=0
+ return ${rc}
+ fi
+
if [ "${NFSROOT#*:}" = "$NFSROOT" ] && [ "$NETBOOT" != "cifs" ]; then
NFSROOT=${ROOTSERVER}:${NFSROOT}
fi
@@ -446,6 +458,15 @@
return ${rc}
}
+do_httpmount() {
+ rc=1
+ [ "$quiet" != "y" ] && log_begin_msg "Trying wget ${FETCH} -O ${mountpoint}/$(basename ${FETCH})"
+ mkdir -p "${mountpoint}/${LIVE_MEDIA_PATH}"
+ wget "${FETCH}" -O "${mountpoint}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
+ [ $? -eq 0 ] && rc=0
+ return ${rc}
+}
+
do_nfsmount() {
rc=1
modprobe "${MP_QUIET}" nfs
@@ -808,7 +829,7 @@
set_usplash_timeout
- if [ ! -z "${NETBOOT}" ]; then
+ if [ ! -z "${NETBOOT}" ] || [ ! -z "${FETCH}" ]; then
if do_netmount ; then
livefs_root="${mountpoint}"
else
More information about the debian-live-changes
mailing list