Removing leftover url= option, this ain't gonna work this way, see fetch=.
[live-boot-grml.git] / scripts / live
index 4169c90..753fceb 100755 (executable)
@@ -8,6 +8,7 @@ echo "/root/lib" >> /etc/ld.so.conf
 echo "/root/usr/lib" >> /etc/ld.so.conf
 
 mountpoint="/live/image"
+alt_mountpoint="/media"
 LIVE_MEDIA_PATH="live"
 
 root_persistence="live-rw"
@@ -59,13 +60,12 @@ Arguments ()
                                NOFASTBOOT="Yes"
                                NOFSTAB="Yes"
                                NOHOSTS="Yes"
-                               NOLOCALES="Yes"
                                NONETWORKING="Yes"
                                NOTIMEZONE="Yes"
                                NOXAUTOCONFIG="Yes"
                                NOXAUTOLOGIN="Yes"
 
-                               export NOACCESSIBILITY NOAPTCDROM NOAUTOLOGIN NOCONSOLEKEYBOARD NOFASTBOOT NOFSTAB NOHOSTS NOLOCALES NONETWORKING NOTIMEZONE NOXAUTOCONFIG NOXAUTOLOGIN
+                               export NOACCESSIBILITY NOAPTCDROM NOAUTOLOGIN NOCONSOLEKEYBOARD NOFASTBOOT NOFSTAB NOHOSTS NONETWORKING NOTIMEZONE NOXAUTOCONFIG NOXAUTOLOGIN
                                ;;
 
                        access=*)
@@ -213,17 +213,6 @@ Arguments ()
                                export LIVE_MEDIA_TIMEOUT
                                ;;
 
-                       language=*|debian-installer/language=*)
-                               language=${x#debian-installer/language=}
-                               locale="$(lang2locale "$language")"
-                               set_locale="true"
-                               ;;
-
-                       locale=*|debian-installer/locale=*)
-                               LOCALE="${ARGUMENT#*=}"
-                               export LOCALE
-                               ;;
-
                        module=*)
                                MODULE="${ARGUMENT#module=}"
                                export MODULE
@@ -284,11 +273,6 @@ Arguments ()
                                export NOHOSTS
                                ;;
 
-                       nolocales)
-                               NOLOCALES="Yes"
-                               export NOLOCALES
-                               ;;
-
                        nonetworking)
                                NONETWORKING="Yes"
                                export NONETWORKING
@@ -355,25 +339,6 @@ Arguments ()
                                export NOPRESEED
                                ;;
 
-                       url=*)
-                               URL_LOCATION="${ARGUMENT#url=}"
-
-                               mount -o bind /sys /root/sys
-                               mount -o bind /proc /root/proc
-                               mount -o bind /dev /root/dev
-
-                               mkdir -p /root/var/run/network
-                               [ "${NETBOOT}" ] || chroot /root dhclient eth0
-                               chroot /root wget -P /tmp "${URL_LOCATION}"
-                               [ "${NETBOOT}" ] || chroot /root ifconfig eth0 down
-
-                               umount /root/sys
-                               umount /root/proc
-                               umount /root/dev
-
-                               LOCATIONS="/tmp/$(basename ${URL_LOCATION}) ${LOCATIONS}"
-                               ;;
-
                        */*=*)
                                question="${ARGUMENT%%=*}"
                                value="${ARGUMENT#*=}"
@@ -699,8 +664,6 @@ copy_live_to ()
 
 do_netmount ()
 {
-       rc=1
-
        modprobe -q af_packet # For DHCP
 
        udevadm trigger
@@ -778,10 +741,12 @@ do_netmount ()
                NFSROOT=${ROOTSERVER}:${ROOTPATH}
        fi
 
-       if ( [ -n "${FETCH}" ] || [ -n "${HTTPFS}" ] || [ -n "${FTPFS}" ] ) && do_httpmount
+       rc=1
+
+       if ( [ -n "${FETCH}" ] || [ -n "${HTTPFS}" ] || [ -n "${FTPFS}" ] )
        then
-               rc=0
-               return ${rc}
+               do_httpmount
+               return $?
        fi
 
        if [ "${NFSROOT#*:}" = "${NFSROOT}" ] && [ "$NETBOOT" != "cifs" ]
@@ -808,19 +773,25 @@ do_netmount ()
 do_httpmount ()
 {
        rc=1
-       dest="${mountpoint}/${LIVE_MEDIA_PATH}"
-       mount -t ramfs ram "${mountpoint}"
-       mkdir -p "${dest}"
 
        for webfile in HTTPFS FTPFS FETCH
        do
-               url="$(eval echo \"\$\{${webfile}\}\")"
-               extension="$(echo "${url}" | sed 's/\(.*\)\.\(.*\)/\2/')"
+               local url="$(eval echo \"\$\{${webfile}\}\")"
+               local extension="$(echo "${url}" | sed 's/\(.*\)\.\(.*\)/\2/')"
 
                if [ -n "$url" ]
                then
                        case "${extension}" in
-                               squashfs|tgz|tar)
+                               iso|squashfs|tgz|tar)
+                                       if [ "${extension}" = "iso" ]
+                                       then
+                                               mkdir -p "${alt_mountpoint}"
+                                               dest="${alt_mountpoint}"
+                                       else
+                                               local dest="${mountpoint}/${LIVE_MEDIA_PATH}"
+                                               mount -t ramfs ram "${mountpoint}"
+                                               mkdir -p "${dest}"
+                                       fi
                                        if [ "${webfile}" = "FETCH" ]
                                        then
                                                case "$url" in
@@ -851,6 +822,12 @@ do_httpmount ()
                                        fi
                                        [ ${?} -eq 0 ] && rc=0
                                        [ "${extension}" = "tgz" ] && live_dest="ram"
+                                       if [ "${extension}" = "iso" ]
+                                       then
+                                               isoloop=$(setup_loop "${dest}/$(basename "${url}")" "loop" "/sys/block/loop*" "" '')
+                                               mount -t iso9660 "${isoloop}" "${mountpoint}"
+                                               rc=${?}
+                                       fi
                                        break
                                        ;;
 
@@ -863,7 +840,15 @@ do_httpmount ()
 
        if [ ${rc} != 0 ]
        then
-           umount "${mountpoint}"
+               if [ -d "${alt_mountpoint}" ]
+               then
+                       umount "${alt_mountpoint}"
+                       rmdir "${alt_mountpoint}"
+               fi
+               umount "${mountpoint}"
+       elif [ "${webfile}"  != "FETCH" ] ; then
+               NETBOOT="${webfile}"
+               export NETBOOT
        fi
 
        return ${rc}