X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive;h=86aaddc6934b1d5fcb80420e806b65e87669f6e1;hb=565006c37036db7c7f35d4f28796d42c55f2ee8a;hp=04243d7c4ad09ca74eef93a4c9cb0c1b262c0a4f;hpb=ea5ccacffb14572b4800d14fc9eea23cad7ca893;p=live-boot-grml.git diff --git a/scripts/live b/scripts/live index 04243d7..86aaddc 100755 --- a/scripts/live +++ b/scripts/live @@ -60,8 +60,14 @@ parse_cmdline () export TORAM="Yes" ;; todisk=*) export TODISK=${x#todisk=} ;; - swapoff) - export SWAPOFF="Yes" ;; + noswap) + export NOSWAP="Yes" ;; + noautologin) + export NOAUTOLOGIN="Yes" ;; + noxautologin) + export NOXAUTOLOGIN="Yes" ;; + nosudo) + export NOSUDO="Yes" ;; showmounts) export SHOWMOUNTS="Yes" ;; persistent) @@ -70,7 +76,7 @@ parse_cmdline () export PERSISTENT="" ;; ip*) STATICIP=${x#ip=} - if [ "${STATICIP}" == "" ]; then + if [ "${STATICIP}" = "" ]; then STATICIP="frommedia" fi export STATICIP ;; @@ -100,6 +106,8 @@ parse_cmdline () export MODULE=${x#module=} ;; preseed/file=*|file=*) export LOCATION="${x#*=}" ;; + upgrade) + export UPGRADE="Yes" ;; */*=*) question="${x%%=*}" value="${x#*=}" @@ -112,10 +120,10 @@ parse_cmdline () # sort of compatibility with netboot.h from linux docs if [ -z "${NETBOOT}" ]; then - if [ "${ROOT}" == "/dev/nfs" ]; then + if [ "${ROOT}" = "/dev/nfs" ]; then NETBOOT="nfs" export NETBOOT - elif [ "${ROOT}" == "/dev/cifs" ]; then + elif [ "${ROOT}" = "/dev/cifs" ]; then NETBOOT="cifs" export NETBOOT fi @@ -131,6 +139,7 @@ is_live_path() { if [ -d "$path/live" ]; then if [ "$(echo $path/live/*.squashfs)" != "$path/live/*.squashfs" ] || [ "$(echo $path/live/*.ext2)" != "$path/live/*.ext2" ] || + [ "$(echo $path/live/*.ext3)" != "$path/live/*.ext3" ] || [ "$(echo $path/live/*.dir)" != "$path/live/*.dir" ]; then return 0 fi @@ -140,7 +149,7 @@ is_live_path() { get_backing_device() { case "$1" in - *.squashfs|*.ext2) + *.squashfs|*.ext2|*.ext3) echo $(setup_loop "$1" "loop" "/sys/block/loop*" '0' "${LIVE_MEDIA_ENCRYPTION}") ;; *.dir) @@ -167,6 +176,7 @@ mount_images_in_directory() { rootmnt="$2" if match_files_in_dir "$directory/live/*.squashfs" || match_files_in_dir "$directory/live/*.ext2" || + match_files_in_dir "$directory/live/*.ext3" || match_files_in_dir "$directory/live/*.dir"; then setup_unionfs "$directory/live" "$rootmnt" else @@ -230,7 +240,7 @@ copy_live_to() { mount -t "${fstype}" ${mount_options} "${dev}" "${copyto}" cp -a ${copyfrom}/* ${copyto} # "cp -a" from busybox also copies hidden files umount ${copyfrom} - mount -r -o move ${copyto} ${copyfrom} + mount -r --move ${copyto} ${copyfrom} rmdir ${copyto} return 0 } @@ -350,13 +360,13 @@ try_snap () snap_mount="${2}" snap_type="${3}" - snapdata=$(find_files "${snap_label}.squashfs ${snap_label}.cpio.gz ${snap_label}.ext2") + snapdata=$(find_files "${snap_label}.squashfs ${snap_label}.cpio.gz ${snap_label}.ext2 ${snap_label}.ext3") if [ ! -z "${snapdata}" ]; then snapdev="$(echo ${snapdata} | cut -f1 -d ' ')" snapback="$(echo ${snapdata} | cut -f2 -d ' ')" snapfile="$(echo ${snapdata} | cut -f3 -d ' ')" - if echo "${snapfile}" | grep -qs '\(squashfs\|ext2\)'; then - # squashfs or ext2 snapshot + if echo "${snapfile}" | grep -qs '\(squashfs\|ext2\|ext3\)'; then + # squashfs or ext2/ext3 snapshot dev=$(get_backing_device "${snapback}/${snapfile}") if ! do_snap_copy "${dev}" "${snap_mount}" "${snap_type}"; then log_warning_msg "Impossible to include the ${snapfile} Snapshot" @@ -428,7 +438,7 @@ setup_unionfs() { done else # If ${MODULE}.lst does not exist, create a list of images - for image_type in "ext2" "squashfs" "dir"; do + for image_type in "ext2" "ext3" "squashfs" "dir"; do for image in "${image_directory}"/*."${image_type}"; do if [ -e "${image}" ]; then image_string="${image_string} ${image}"; @@ -499,7 +509,7 @@ setup_unionfs() { case d in *.dir) # do nothing # mount -o bind "${d}" "${rootmnt}/live/${d##*/}" ;; - *) mount -o move "${d}" "${rootmnt}/live/${d##*/}" + *) mount --move "${d}" "${rootmnt}/live/${d##*/}" ;; esac done @@ -569,8 +579,8 @@ find_livefs() { fi done elif [ "${fstype}" = "squashfs" -o \ - "${fstype}" = "ext3" -o \ - "${fstype}" = "ext2" ]; then + "${fstype}" = "ext2" -o \ + "${fstype}" = "ext3" ]; then # This is an ugly hack situation, the block device has # an image directly on it. It's hopefully # live-initramfs, so take it and run with it.