Adding upstream version 1.118.2. upstream/1.118.2
authorDaniel Baumann <daniel@debian.org>
Sun, 18 Apr 2010 18:41:48 +0000 (20:41 +0200)
committerDaniel Baumann <daniel@debian.org>
Sun, 18 Apr 2010 18:41:48 +0000 (20:41 +0200)
hooks/live
scripts/live
scripts/live-bottom/21xdriver [new file with mode: 0755]
scripts/live-bottom/99hook [new file with mode: 0755]
scripts/live-helpers

index c18dfc2..ca2a761 100755 (executable)
@@ -81,6 +81,8 @@ manual_add_modules jffs2
 copy_exec /sbin/losetup /sbin
 manual_add_modules loop
 manual_add_modules squashfs
+manual_add_modules unlzma
+manual_add_modules sqlzma
 
 # Filesystem: unionfs/aufs
 manual_add_modules unionfs
index 332de10..0ed7675 100755 (executable)
@@ -60,6 +60,11 @@ Arguments ()
                                 export FETCH
                                 ;;
 
+                       hook=*)
+                               HOOK="${ARGUMENT#hook=}"
+                               export HOOK
+                               ;;
+
                        hostname=*)
                                HOSTNAME="${ARGUMENT#hostname=}"
                                LIVECONF="changed"
@@ -381,6 +386,16 @@ Arguments ()
                                export EXPOSED_ROOT
                                ;;
 
+                       plainroot)
+                               PLAIN_ROOT="Yes"
+                               export PLAIN_ROOT
+                               ;;
+
+                       root=*)
+                               ROOT="${ARGUMENT#root=}"
+                               export ROOT
+                               ;;
+
                        union=*)
                                UNIONTYPE="${ARGUMENT#union=}"
                                export UNIONTYPE
@@ -396,6 +411,11 @@ Arguments ()
                                export XDEBCONF
                                ;;
 
+                       xdriver=*)
+                               XDRIVER="${ARGUMENT#xdriver=}"
+                               export XDRIVER
+                               ;;
+
                        xvideomode=*)
                                XVIDEOMODE="${ARGUMENT#xvideomode=}"
                                export XVIDEOMODE
@@ -1166,7 +1186,7 @@ find_livefs ()
        fi
 
        # or do the scan of block devices
-       for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram)
+       for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v 'dm-')
        do
                devname=$(sys2dev "${sysblock}")
                fstype=$(get_fstype "${devname}")
@@ -1213,6 +1233,11 @@ set_usplash_timeout ()
 
 mountroot ()
 {
+    
+        if [ -x /scripts/local-top/cryptroot ]; then
+           /scripts/local-top/cryptroot
+       fi
+
        exec 6>&1
        exec 7>&2
        exec > live.log
@@ -1239,18 +1264,24 @@ mountroot ()
                        panic "Unable to find a live file system on the network"
                fi
        else
-               # Scan local devices for the image
-               for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
-               do
-                       livefs_root=$(find_livefs ${i})
+               if [ -n "${PLAIN_ROOT}" ] && [ -n "${ROOT}" ]
+               then
+                       # Do a local boot from hd
+                       livefs_root=${ROOT}
+               else
+                       # Scan local devices for the image
+                       for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
+                       do
+                               livefs_root=$(find_livefs ${i})
 
-                       if [ -n "${livefs_root}" ]
-                       then
-                               break
-                       fi
+                               if [ -n "${livefs_root}" ]
+                               then
+                                       break
+                               fi
 
-                       sleep 1
-               done
+                               sleep 1
+                       done
+               fi
        fi
 
        if [ -z "${livefs_root}" ]
diff --git a/scripts/live-bottom/21xdriver b/scripts/live-bottom/21xdriver
new file mode 100755 (executable)
index 0000000..c96f0ea
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOXAUTOCONFIG}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Configuring X kludges..."
+
+# live-initramfs script
+
+if [ -n "$XDRIVER" ]
+then
+       mount -n -o bind /sys /root/sys
+       mount -n -o bind /proc /root/proc
+       mount -n -o bind /dev /root/dev
+
+chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
+set xserver-xorg/autodetect_video_card false
+set xserver-xorg/config/device/driver ${XDRIVER}
+EOF
+
+       chroot /root dexconf
+
+       umount /root/sys
+       umount /root/proc
+       umount /root/dev
+fi
+
diff --git a/scripts/live-bottom/99hook b/scripts/live-bottom/99hook
new file mode 100755 (executable)
index 0000000..0341026
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -z "${HOOK}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Executing custom hook script..."
+
+# live-initramfs script
+
+cd /root
+wget "${HOOK}"
+
+./$(basename ${HOOK})
+
+log_end_msg
index 504a3f4..807553a 100644 (file)
@@ -34,6 +34,13 @@ get_fstype ()
        local FSTYPE
        local FSSIZE
 
+       # fstype misreports LUKS devices
+       is_luks "${1}"
+       if [ $? -eq 0 ]; then
+           /lib/udev/vol_id -t ${1} 2>/dev/null
+           return
+       fi
+
        eval $(fstype < ${1})
 
        if [ "${FSTYPE}" != "unknown" ]
@@ -306,3 +313,16 @@ get_mac ()
 
        echo ${mac}
 }
+
+is_luks()
+{
+    devname="${1}"
+    if [ -x /sbin/cryptsetup ]
+    then
+       /sbin/cryptsetup isLuks "${devname}" 2>/dev/null
+       return $?
+    else
+       return 1
+    fi
+
+}