r2653 - dists/trunk/live-initramfs/scripts

daniel at alioth.debian.org daniel at alioth.debian.org
Mon Jul 30 19:45:48 UTC 2007


Author: daniel
Date: 2007-07-30 19:45:48 +0000 (Mon, 30 Jul 2007)
New Revision: 2653

Modified:
   dists/trunk/live-initramfs/scripts/live
Log:


Modified: dists/trunk/live-initramfs/scripts/live
===================================================================
--- dists/trunk/live-initramfs/scripts/live	2007-07-30 17:42:47 UTC (rev 2652)
+++ dists/trunk/live-initramfs/scripts/live	2007-07-30 19:45:48 UTC (rev 2653)
@@ -2,12 +2,12 @@
 
 # set -e
 
-export PATH=/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:/usr/bin:/usr/sbin:/bin:/sbin
+export PATH="/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
 
 echo "/root/lib" >> /etc/ld.so.conf
 echo "/root/usr/lib" >> /etc/ld.so.conf
 
-mountpoint=/live/image
+mountpoint="/live/image"
 LIVE_MEDIA_PATH="/live"
 
 root_persistence="live-rw"
@@ -15,12 +15,12 @@
 root_snapshot_label="live-sn"
 home_snapshot_label="home-sn"
 
-USERNAME=user
+USERNAME="user"
 USERFULLNAME="Live user"
-HOSTNAME=host
-BUILD_SYSTEM=Custom
+HOSTNAME="host"
+BUILD_SYSTEM="Custom"
 
-mkdir -p $mountpoint
+mkdir -p "${mountpoint}"
 
 [ -f /etc/live.conf ] && . /etc/live.conf
 export USERNAME USERFULLNAME HOSTNAME BUILD_SYSTEM
@@ -31,22 +31,20 @@
     touch /live.vars
 fi
 
-parse_cmdline ()
+Arguments ()
 {
-	PRESEEDS=
+	PRESEEDS=""
 
-	# looking for live-initramfs specifics options as kernel parameters
-
-	for x in $(cat /proc/cmdline)
+	for ARGUMENT in `cat /proc/cmdline`
 	do
-		case $x in
+		case "${ARGUMENT}" in
 			access=*)
-				ACCESS=${x#access=}
+				ACCESS="${ARGUMENT#access=}"
 				export ACCESS
 				;;
 
 			console=*)
-				DEFCONSOLE="${x#*=}"
+				DEFCONSOLE="${ARGUMENT#*=}"
 				export DEFCONFSOLE
 				;;
 
@@ -58,25 +56,25 @@
 				;;
 
 			hostname=*)
-				HOSTNAME=${x#hostname=}
+				HOSTNAME="${ARGUMENT#hostname=}"
 				LIVECONF="changed"
 				export HOSTNAME LIVECONF
 				;;
 
 			username=*)
-				USERNAME=${x#username=}
+				USERNAME="${ARGUMENT#username=}"
 				LIVECONF="changed"
 				export USERNAME LIVECONF
 				;;
 
 			userfullname=*)
-				USERFULLNAME=${x#userfullname=}
+				USERFULLNAME="${ARGUMENT#userfullname=}"
 				LIVECONF="changed"
 				export USERFULLNAME LIVECONF
 				;;
 
 			ip=*)
-				STATICIP=${x#ip=}
+				STATICIP="${ARGUMENT#ip=}"
 
 				if [ -z "${STATICIP}" ]
 				then
@@ -87,77 +85,77 @@
 				;;
 
 			keyb=*|kbd-chooser/method=*)
-				KBD=${x#*=}
+				KBD="${ARGUMENT#*=}"
 				export KBD
 				;;
 
 			klayout=*|console-setup/layoutcode=*)
-				KLAYOUT=${x#*=}
+				KLAYOUT="${ARGUMENT#*=}"
 				export KLAYOUT
 				;;
 
 			kvariant=*|console-setup/variantcode=*)
-				KVARIANT=${x#*=}
+				KVARIANT="${ARGUMENT#*=}"
 				export KVARIANT
 				;;
 
 			kmodel=*|console-setup/modelcode=*)
-				KMODEL=${x#*=}
+				KMODEL="${ARGUMENT#*=}"
 				export KMODEL
 				;;
 
 			koptions=*)
-				KOPTIONS=${x#koptions=}
+				KOPTIONS="${ARGUMENT#koptions=}"
 				export KOPTIONS
 				;;
 
 			live-getty)
-				LIVE_GETTY=1
+				LIVE_GETTY="1"
 				export LIVE_GETTY
 				;;
 
 			live-media=*|bootfrom=*)
-				LIVE_MEDIA=${x#*=}
+				LIVE_MEDIA="${ARGUMENT#*=}"
 				export LIVE_MEDIA
 				;;
 
 			live-media-encryption=*|encryption=*)
-				LIVE_MEDIA_ENCRYPTION=${x#*=}
+				LIVE_MEDIA_ENCRYPTION="${ARGUMENT#*=}"
 				export LIVE_MEDIA_ENCRYPTION
 				;;
 
 			live-media-offset=*)
-				LIVE_MEDIA_OFFSET=${x#live-media-offset=}
+				LIVE_MEDIA_OFFSET="${ARGUMENT#live-media-offset=}"
 				export LIVE_MEDIA_OFFSET
 				;;
 
 			live-media-path=*)
-				LIVE_MEDIA_PATH="${x#live-media-path=}"
+				LIVE_MEDIA_PATH="${ARGUMENT#live-media-path=}"
 				export LIVE_MEDIA_PATH
 				;;
 
 			live-media-timeout=*)
-				LIVE_MEDIA_TIMEOUT=${x#live-media-timeout=}
+				LIVE_MEDIA_TIMEOUT="${ARGUMENT#live-media-timeout=}"
 				export LIVE_MEDIA_TIMEOUT
 				;;
 
 			locale=*|debian-installer/locale=*)
-				LOCALE=${x#*=}
+				LOCALE="${ARGUMENT#*=}"
 				export LOCALE
 				;;
 
 			module=*)
-				MODULE=${x#module=}
+				MODULE="${ARGUMENT#module=}"
 				export MODULE
 				;;
 
 			netboot=*)
-				NETBOOT=${x#netboot=}
+				NETBOOT="${ARGUMENT#netboot=}"
 				export NETBOOT
 				;;
 
 			nfsopts=*)
-				NFSOPTS=${x#nfsopts=}
+				NFSOPTS="${ARGUMENT#nfsopts=}"
 				export NFSOPTS
 				;;
 
@@ -197,12 +195,12 @@
 				;;
 
 			preseed/file=*|file=*)
-				LOCATION="${x#*=}"
+				LOCATION="${ARGUMENT#*=}"
 				export LOCATION
 				;;
 
 			url=*)
-				LOCATION="${x#url=}"
+				LOCATION="${ARGUMENT#url=}"
 
 				mount -n -o bind /sys /root/sys
 				mount -n -o bind /proc /root/proc
@@ -221,10 +219,9 @@
 				;;
 
 			*/*=*)
-				question="${x%%=*}"
-				value="${x#*=}"
+				question="${ARGUMENT%%=*}"
+				value="${ARGUMENT#*=}"
 				PRESEEDS="${PRESEEDS}\"${question}=${value}\" "
-
 				export PRESEEDS
 				;;
 
@@ -234,12 +231,12 @@
 				;;
 
 			timezone=*)
-				TIMEZONE="${x#timezone=}"
+				TIMEZONE="${ARGUMENT#timezone=}"
 				export TIMEZONE
 				;;
 
 			todisk=*)
-				TODISK=${x#todisk=}
+				TODISK="${ARGUMENT#todisk=}"
 				export TODISK
 				;;
 
@@ -249,12 +246,12 @@
 				;;
 
 			union=*)
-				UNIONTYPE="${x#union=}"
+				UNIONTYPE="${ARGUMENT#union=}"
 				export UNIONTYPE
 				;;
 
 			utc=*)
-				UTC="${x#utc=}"
+				UTC="${ARGUMENT#utc=}"
 				export UTC
 				;;
 
@@ -264,7 +261,7 @@
 				;;
 
 			xvideomode=*)
-				XVIDEOMODE="${x#xvideomode=}"
+				XVIDEOMODE="${ARGUMENT#xvideomode=}"
 				export XVIDEOMODE
 				;;
 		esac
@@ -798,7 +795,7 @@
     exec > live.log
     exec 2>&1
 
-    parse_cmdline
+    Arguments
 
     set_usplash_timeout
     [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-premount"




More information about the debian-live-changes mailing list