Adding upstream version 1.157.2. upstream/1.157.2
authorDaniel Baumann <daniel@debian.org>
Sun, 18 Apr 2010 18:42:05 +0000 (20:42 +0200)
committerDaniel Baumann <daniel@debian.org>
Sun, 18 Apr 2010 18:42:05 +0000 (20:42 +0200)
hooks/live
scripts/live-bottom/12fstab
scripts/live-bottom/13swap [deleted file]
scripts/live-bottom/14locales
scripts/live-bottom/15autologin
scripts/live-helpers

index 32adfb6..4e29226 100755 (executable)
@@ -148,7 +148,10 @@ else
        copy_exec /sbin/udevtrigger /sbin
        copy_exec /sbin/udevsettle /sbin
 fi
-copy_exec /usr/bin/udevinfo /bin
+if [ -x /usr/bin/udevinfo ]
+then
+       copy_exec /usr/bin/udevinfo /bin
+fi
 
 # Program: wget
 if [ -x /usr/bin/wget ]
index f38eee7..22c11a0 100755 (executable)
@@ -32,17 +32,63 @@ log_begin_msg "Configuring fstab"
 
 # live-initramfs script
 
-# Create a fake fstab only if it is not already there
+# Create a fake fstab only if it doesn't exist or if its the debootstrap template
 if [ ! -f "${FSTAB}" ] || grep -qs 'UNCONFIGURED FSTAB FOR BASE SYSTEM' "${FSTAB}"
 then
-       cat >> ${FSTAB} << EOF
+
+cat > ${FSTAB} << EOF
 # /etc/fstab: static file system information.
 #
 # <file system> <mount point>   <type>  <options>       <dump>  <pass>
 
-${UNIONTYPE} / ${UNIONTYPE} rw 0 0
-tmpfs /tmp tmpfs nosuid,nodev 0 0
 EOF
+
+fi
+
+if ! grep -qs  "^${UNIONTYPE}" "${FSTAB}"
+then
+       echo "${UNIONTYPE} / ${UNIONTYPE} rw 0 0" >> "${FSTAB}"
+fi
+
+if ! grep -qs "^tmpfs /tmp" "${FSTAB}"
+then
+       echo "tmpfs /tmp tmpfs nosuid,nodev 0 0" >> "${FSTAB}"
+fi
+
+if [ -z "${NOSWAP}" ]
+then
+       devices=""
+
+       for device in /dev/[hs]d[a-z][0-9]*
+       do
+               if ! [ -b "${device}" ]
+               then
+                       continue
+               fi
+
+               /lib/udev/vol_id ${device%%[0-9]*} 2>/dev/null | grep -q "^ID_FS_USAGE=raid" && continue
+
+               magic=$(/bin/dd if="${device}" bs=4086 skip=1 count=1 2>/dev/null | /bin/dd bs=10 count=1 2>/dev/null) || continue
+
+               if [ "${magic}" = "SWAPSPACE2" -o "${magic}" = "SWAP-SPACE" ]
+               then
+                       #log "Found ${device}"
+                       devices="${devices} ${device}"
+               fi
+       done
+
+       # Remove all auto swap entries
+       if grep -qs  "swap swap" "${FSTAB}"
+       then
+               grep -v "swap swap" "${FSTAB}" > "${FSTAB}".tmp
+               mv "${FSTAB}".tmp "${FSTAB}"
+       fi
+
+       # Add new swap entries
+       for device in ${devices}
+       do
+               echo "${device} swap swap defaults 0 0" >> "${FSTAB}"
+       done
 fi
 
 # disabled for now
diff --git a/scripts/live-bottom/13swap b/scripts/live-bottom/13swap
deleted file mode 100755 (executable)
index 8fc718c..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-#set -e
-
-# initramfs-tools header
-
-PREREQ=""
-
-prereqs()
-{
-       echo "${PREREQ}"
-}
-
-case "${1}" in
-       prereqs)
-               prereqs
-               exit 0
-               ;;
-esac
-
-# live-initramfs header
-
-if [ -z "${SWAPON}" ] || [ -n "${NOFSTAB}" ]
-then
-       exit 0
-fi
-
-. /scripts/live-functions
-
-log_begin_msg "Setting up swap"
-
-# live-initramfs script
-
-FSTAB=/root/etc/fstab
-devices=""
-
-for device in /dev/[hs]d[a-z][0-9]*
-do
-       if ! [ -b "${device}" ]
-       then
-               continue
-       fi
-
-       /lib/udev/vol_id ${device%%[0-9]*} 2>/dev/null | grep -q "^ID_FS_USAGE=raid" && continue
-
-       magic=$(/bin/dd if="${device}" bs=4086 skip=1 count=1 2>/dev/null | /bin/dd bs=10 count=1 2>/dev/null) || continue
-
-       if [ "${magic}" = "SWAPSPACE2" -o "${magic}" = "SWAP-SPACE" ]
-       then
-               #log "Found ${device}"
-               devices="${devices} ${device}"
-       fi
-done
-
-for device in ${devices}
-do
-
-cat >> ${FSTAB} << EOF
-${device} swap swap defaults 0 0
-EOF
-
-done
-
-log_end_msg
index 6348338..022a605 100755 (executable)
@@ -104,7 +104,10 @@ then
 
        if [ -d /root/etc/default/kdm.d/ ]
        then
-               printf 'LANGUAGE=%s\n' "${LANG}" >> /root/etc/default/kdm.d/live-autologin
+               if ! grep -qs "^LANGUAGE" "${LANG}"
+               then
+                       printf 'LANGUAGE=%s\n' "${LANG}" >> /root/etc/default/kdm.d/live-autologin
+               fi
        elif [ -f /root/etc/kde3/kdm/kdmrc ]
        then
                sed -i -r -e "s/#Language=.*/Language=${language}/" \
@@ -113,8 +116,8 @@ then
 
        really_export LANG
 
-       printf 'LANG="%s"\n' "${LANG}" >> /root/etc/default/locale
-       printf 'LANG="%s"\n' "${LANG}" >> /root/etc/environment
+       printf 'LANG="%s"\n' "${LANG}" > /root/etc/default/locale
+       printf 'LANG="%s"\n' "${LANG}" > /root/etc/environment
        printf '%s %s\n' "${LANG}" "${codepage}" > /root/etc/locale.gen
 
        if [ -z "${SILENT}" ]
index 7fb2b13..38c3a8f 100755 (executable)
@@ -59,6 +59,8 @@ fi
 
 if [ -d /root/etc/default/kdm.d/ ]
 then
+       if ! grep -qs "^AUTOLOGIN" /root/etc/default/kdm.d/live-autologin
+       then
 
 cat >> /root/etc/default/kdm.d/live-autologin << EOF
 AUTOLOGINUSER=${USERNAME}
@@ -66,6 +68,8 @@ AUTOLOGINAGAIN=true
 AUTOLOGINDELAY=0
 EOF
 
+       fi
+
 elif [ -f /root/etc/kde3/kdm/kdmrc ]
 then
        # Configure KDM autologin
index 70897d6..59bdb4f 100644 (file)
@@ -6,10 +6,19 @@ then
        export PATH="${PATH}:/usr/lib/klibc/bin"
 fi
 
+# handle upgrade path from old udev (using udevinfo) to
+# recent versions of udev (using udevadm info)
+if [ -x /sbin/udevadm ]
+then
+       udevinfo='/sbin/udevadm info'
+else
+       udevinfo='udevinfo'
+fi
+
 sys2dev ()
 {
        sysdev=${1#/sys}
-       echo "/dev/$(udevinfo -q name -p ${sysdev} 2>/dev/null|| echo ${sysdev##*/})"
+       echo "/dev/$($udevinfo -q name -p ${sysdev} 2>/dev/null|| echo ${sysdev##*/})"
 }
 
 subdevices ()