Merging casper 1.111.
[live-boot-grml.git] / scripts / live
index 5867209..a01221b 100755 (executable)
@@ -507,7 +507,7 @@ mount_images_in_directory ()
 {
        directory="${1}"
        rootmnt="${2}"
-       mac="$3"
+       mac="${3}"
 
 
        if match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.squashfs" ||
@@ -515,7 +515,7 @@ mount_images_in_directory ()
                match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext3" ||
                match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.dir"
        then
-                [ -n "$mac" ] && adddirectory="$directory/${LIVE_MEDIA_PATH}/${mac}"
+               [ -n "${mac}" ] && adddirectory="${directory}/${LIVE_MEDIA_PATH}/${mac}"
                setup_unionfs "${directory}/${LIVE_MEDIA_PATH}" "${rootmnt}" "${adddirectory}"
        else
                :
@@ -872,7 +872,7 @@ setup_unionfs ()
 {
        image_directory="${1}"
        rootmnt="${2}"
-        addimage_directory="$3"
+        addimage_directory="${3}"
        modprobe -q -b ${UNIONTYPE}
 
        # run-init can't deal with images in a subdir, but we're going to
@@ -921,18 +921,19 @@ setup_unionfs ()
                        done
                done
 
-    if [ -n "${addimage_directory}" -a -d "${addimage_directory}" ]; then
-      for FILESYSTEM in squashfs ext2 ext3 xfs dir
-      do
-        for IMAGE in "${addimage_directory}"/*."${FILESYSTEM}"
-        do
-          if [ -e "${IMAGE}" ]
-          then
-            image_string="${image_string} ${IMAGE}"
-          fi
-        done
-      done
-    fi
+               if [ -n "${addimage_directory}" ] && [ -d "${addimage_directory}" ]
+               then
+                       for FILESYSTEM in squashfs ext2 ext3 xfs dir
+                       do
+                               for IMAGE in "${addimage_directory}"/*."${FILESYSTEM}"
+                               do
+                                       if [ -e "${IMAGE}" ]
+                                       then
+                                               image_string="${image_string} ${IMAGE}"
+                                       fi
+                               done
+                       done
+               fi
 
                # Now sort the list
                image_string="$(echo ${image_string} | sed -e 's/ /\n/g' | sort )"
@@ -982,6 +983,8 @@ setup_unionfs ()
                        cow_fstype=$(get_fstype "${cowprobe}")
                else
                        [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent medium"
+                       cowdevice="tmpfs"
+                       cow_fstype="tmpfs"
                fi
        elif [ -n "${NFS_COW}" ]
        then
@@ -994,7 +997,7 @@ setup_unionfs ()
                        nfs_cow_opts="-o nolock"
                        nfs_cow=${NFS_COW}
                fi
-               mac=$(get_mac)
+               mac="$(get_mac)"
                if [ -n "${mac}" ]
                then
                        cowdevice=$(echo ${nfs_cow}|sed "s/client_mac_address/${mac}/")
@@ -1195,14 +1198,6 @@ find_livefs ()
        return 1
 }
 
-pulsate ()
-{
-       if [ -x /sbin/usplash_write ]
-       then
-               /sbin/usplash_write "PULSATE"
-       fi
-}
-
 set_usplash_timeout ()
 {
        if [ -x /sbin/usplash_write ]
@@ -1222,7 +1217,6 @@ mountroot ()
 
        set_usplash_timeout
        [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-premount"
-       pulsate
        run_scripts /scripts/live-premount
        [ "${quiet}" != "y" ] && log_end_msg
 
@@ -1278,8 +1272,8 @@ mountroot ()
        then
                setup_unionfs "${livefs_root}" "${rootmnt}"
        else
-               mac=$(get_mac)
-    mac=$(echo ${mac}|sed "s/-//g")
+               mac="$(get_mac)"
+               mac="$(echo ${mac} | sed 's/-//g')"
                mount_images_in_directory "${livefs_root}" "${rootmnt}" "${mac}"
        fi
 
@@ -1288,7 +1282,6 @@ mountroot ()
        maybe_break live-bottom
        [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-bottom"
 
-       pulsate
        run_scripts /scripts/live-bottom
        [ "${quiet}" != "y" ] && log_end_msg