summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 14:46:30 +0200
committerDaniel Baumann <daniel@debian.org>2007-09-23 14:46:30 +0200
commit9fda4b0552744a305a699855e2ad3907e8cab164 (patch)
treefe188681a51e406a3811bb708c6d3df31cb3e5a8 /scripts
parentbeec4f9fb766be23d575b070e398639d5a4a9c9d (diff)
downloadlive-boot-9fda4b0552744a305a699855e2ad3907e8cab164.tar.gz
live-boot-9fda4b0552744a305a699855e2ad3907e8cab164.zip
Adding casper 1.81+debian-1.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/casper72
-rwxr-xr-xscripts/casper-bottom/22screensaver12
-rwxr-xr-xscripts/casper-bottom/23networking12
-rwxr-xr-xscripts/casper-bottom/31disable_update_notifier10
-rw-r--r--scripts/casper-helpers8
5 files changed, 68 insertions, 46 deletions
diff --git a/scripts/casper b/scripts/casper
index f57d406..4d6c1a5 100644
--- a/scripts/casper
+++ b/scripts/casper
@@ -14,7 +14,7 @@ home_snapshot_label="home-sn"
USERNAME="casper"
USERFULLNAME="Live session user"
HOSTNAME="live"
-BUILD_SYSTEM="Debian"
+BUILD_SYSTEM="Custom"
mkdir -p $mountpoint
@@ -87,6 +87,8 @@ parse_cmdline ()
export KVARIANT=${x#*=} ;;
kmodel=*|console-setup/modelcode=*)
export KMODEL=${x#*=} ;;
+ module=*)
+ export MODULE=${x#module=} ;;
preseed/file=*|file=*)
export LOCATION="${x#*=}" ;;
*/*=*)
@@ -109,6 +111,10 @@ parse_cmdline ()
export NETBOOT
fi
fi
+
+ if [ -z "${MODULE}" ]; then
+ MODULE=order
+ fi
}
is_casper_path() {
@@ -167,8 +173,7 @@ is_nice_device() {
return 1
}
-is_supported_fs ()
-{
+is_supported_fs () {
# FIXME: do something better like the scan of supported filesystems
fstype="${1}"
case ${fstype} in
@@ -398,31 +403,48 @@ setup_unionfs() {
# Let's just mount the read-only file systems first
rofsstring=""
rofslist=""
- if [ "${NETBOOT}" == "nfs" ] ; then
+ if [ "${NETBOOT}" = "nfs" ] ; then
roopt="nfsro" # go aroung a bug in nfs-unionfs locking
else
roopt="ro"
fi
+ # Read image names from ${MODULE}.lst if it exists
+ if [ -e "${image_directory}/${MODULE}.lst" ]; then
+ for image in $(cat "${image_directory}/${MODULE}.lst"); do
+ image_string="${image_string} ${image_directory}/${image}";
+ done
+ else
+ # If ${MODULE}.lst does not exist, create a list of images
+ for image_type in "ext2" "squashfs" "dir"; do
+ for image in "${image_directory}"/*."${image_type}"; do
+ if [ -e "${image}" ]; then
+ image_string="${image_string} ${image}";
+ fi
+ done
+ done
+ # Now sort the list
+ image_string=$(echo ${image_string} | sed -e 's/ /\n/g' | sort )
+ fi
+
mkdir -p "${croot}"
- for image_type in "ext2" "squashfs" "dir" ; do
- for image in "${image_directory}"/*."${image_type}"; do
- imagename=$(basename "${image}")
- if [ -d "${image}" ]; then
- # it is a plain directory: do nothing
- rofsstring="${image}=${roopt}:${rofsstring}"
- rofslist="${image} ${rofslist}"
- elif [ -f "${image}" ]; then
- backdev=$(get_backing_device "$image")
- fstype=$(get_fstype "${backdev}")
- if [ "${fstype}" = "unknown" ]; then
- panic "Unknown file system type on ${backdev} (${image})"
- fi
- mkdir -p "${croot}/${imagename}"
- mount -t "${fstype}" -o ro "${backdev}" "${croot}/${imagename}" || panic "Can not mount $backdev ($image) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
+ for image in ${image_string}; do
+ imagename=$(basename "${image}")
+ if [ -d "${image}" ]; then
+ # it is a plain directory: do nothing
+ rofsstring="${image}=${roopt}:${rofsstring}"
+ rofslist="${image} ${rofslist}"
+ elif [ -f "${image}" ]; then
+ backdev=$(get_backing_device "$image")
+ fstype=$(get_fstype "${backdev}")
+ if [ "${fstype}" = "unknown" ]; then
+ panic "Unknown file system type on ${backdev} (${image})"
fi
- done
+ mkdir -p "${croot}/${imagename}"
+ mount -t "${fstype}" -o ro "${backdev}" "${croot}/${imagename}" || panic "Can not mount $backdev ($image) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
+ fi
done
+
rofsstring=${rofsstring%:}
mkdir -p /cow
@@ -602,15 +624,15 @@ mountroot() {
panic "Unable to find a medium containing a live file system"
fi
- if [ -n "${TORAM}" ]; then
+ if [ "${TORAM}" ]; then
live_dest="ram"
- elif [ -n "${TODISK}" ]; then
+ elif [ "${TODISK}" ]; then
live_dest="${TODISK}"
fi
- if [ -n "${live_dest}" ]; then
- [ "$quiet" != "y" ] && log_begin_msg "Copying live_media to ${live_dest}"
+ if [ "${live_dest}" ]; then
+ log_begin_msg "Copying live_media to ${live_dest}"
copy_live_to "${livefs_root}" "${live_dest}"
- [ "$quiet" != "y" ] && log_end_msg
+ log_end_msg
fi
mount_images_in_directory "${livefs_root}" "${rootmnt}"
diff --git a/scripts/casper-bottom/22screensaver b/scripts/casper-bottom/22screensaver
index e5965e8..39c0f22 100755
--- a/scripts/casper-bottom/22screensaver
+++ b/scripts/casper-bottom/22screensaver
@@ -20,17 +20,11 @@ esac
log_begin_msg "$DESCRIPTION"
-
gnome_screensaver_version=$(chroot /root dpkg-query -W --showformat='${Version}' gnome-screensaver 2>/dev/null) || gnome_screensaver_version=""
-
-if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
- gnome_screensaver_lock="/apps/gnome-screensaver/lock"
-else
- gnome_screensaver_lock="/apps/gnome-screensaver/lock_enabled"
-fi
-
if [ -n "$gnome_screensaver_version" ]; then
- chroot /root sudo -u "$USERNAME" gconftool-2 -t bool -s "${gnome_screensaver_lock}" false
+ # Support legacy gconf value
+ chroot /root sudo -u "$USERNAME" gconftool-2 -t bool -s /apps/gnome-screensaver/lock false
+ chroot /root sudo -u "$USERNAME" gconftool-2 -t bool -s /apps/gnome-screensaver/lock_enabled false
fi
log_end_msg
diff --git a/scripts/casper-bottom/23networking b/scripts/casper-bottom/23networking
index 116b1d6..cfc565d 100755
--- a/scripts/casper-bottom/23networking
+++ b/scripts/casper-bottom/23networking
@@ -21,7 +21,7 @@ esac
log_begin_msg "$DESCRIPTION"
-if [ "${STATICIP}" == "frommedia" -a -e "$IFFILE" ] ; then
+if [ "${STATICIP}" = "frommedia" -a -e "$IFFILE" ] ; then
# will use existent /etc/network/interfaces
log_end_msg
exit 0
@@ -33,11 +33,7 @@ iface lo inet loopback
EOF
-if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
- udevtrigger -Bpci -Iclass="0x02*"
-else
- udevtrigger
-fi
+udevtrigger
udevsettle
if [ -z "${NETBOOT}" -a -n "${STATICIP}" -a "${STATICIP}" != "frommedia" ]; then
@@ -71,8 +67,8 @@ else
[ -e $interface ] || continue
i="$(basename $interface)"
cat >> "$IFFILE" <<EOF
-auto ${i}
-iface ${i} inet ${method}
+auto $i
+iface $i inet ${method}
EOF
done
diff --git a/scripts/casper-bottom/31disable_update_notifier b/scripts/casper-bottom/31disable_update_notifier
index 10b86a2..2461c25 100755
--- a/scripts/casper-bottom/31disable_update_notifier
+++ b/scripts/casper-bottom/31disable_update_notifier
@@ -20,7 +20,15 @@ esac
log_begin_msg "$DESCRIPTION"
-rm -f /root/etc/xdg/autostart/update-notifier.desktop
+# For GNOME, we divert away apt-check to avoid a regular 'apt-get update'
+# equivalent in the live session. We want to run update-notifier for crash
+# report handling.
+chroot /root dpkg-divert --add --rename --quiet \
+ /usr/lib/update-notifier/apt-check
+ln -s /bin/true /root/usr/lib/update-notifier/apt-check
+
+# For KDE, adept_notifier's only useful function at the moment is an
+# 'apt-get update' equivalent, so we disable it entirely.
rm -f /root/usr/share/autostart/adept_notifier_auto.desktop
log_end_msg
diff --git a/scripts/casper-helpers b/scripts/casper-helpers
index f8bd206..8402d93 100644
--- a/scripts/casper-helpers
+++ b/scripts/casper-helpers
@@ -1,9 +1,11 @@
## Casper helper functions, used by casper on boot and by casper-snapshot
-if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
+if [ "${BUILD_SYSTEM}" = "Ubuntu" ]; then
MP_QUIET="-Q"
-else
+elif [ "${BUILD_SYSTEM}" = "Debian" ]; then
MP_QUIET="-q"
+else
+ MP_QUIET=""
fi
if [ ! -x "/bin/fstype" ]; then
@@ -112,7 +114,7 @@ setup_loop() {
local pattern=$3
local offset=$4
- modprobe "${MP_QUIET}" -b "$module"
+ modprobe ${MP_QUIET} -b "$module"
udevsettle
for loopdev in $pattern; do