summaryrefslogtreecommitdiff
path: root/debian/casper.init
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 14:46:24 +0200
committerDaniel Baumann <daniel@debian.org>2007-09-23 14:46:24 +0200
commit6c1a2cfab139bb4a61e7bcf5f4cafe3b7498f64e (patch)
tree333a05a0a341c98203688dc4d01589340eca951c /debian/casper.init
parenta4a7503df76005df67b006e1324004c808830c32 (diff)
downloadlive-boot-6c1a2cfab139bb4a61e7bcf5f4cafe3b7498f64e.tar.gz
live-boot-6c1a2cfab139bb4a61e7bcf5f4cafe3b7498f64e.zip
Adding casper 1.66+debian-1.
Diffstat (limited to 'debian/casper.init')
-rw-r--r--debian/casper.init45
1 files changed, 45 insertions, 0 deletions
diff --git a/debian/casper.init b/debian/casper.init
new file mode 100644
index 0000000..e0522e0
--- /dev/null
+++ b/debian/casper.init
@@ -0,0 +1,45 @@
+#! /bin/sh
+
+# check for netboot
+if grep -qs netboot /proc/cmdline || grep -qsi root=/dev/nfs /proc/cmdline || grep -qsi root=/dev/cifs /proc/cmdline ; then
+ exit 0
+fi
+
+grep -qs boot=casper /proc/cmdline || exit 0
+
+# Try to cache everything we're likely to need after ejecting. This
+# is fragile and simple-minded, but our options are limited.
+cache_path() {
+ path="$1"
+
+ if [ -d "$path" ]; then
+ find "$path" -type f | xargs cat > /dev/null 2>&1
+ elif [ -f "$path" ]; then
+ if [ -x "$path" ]; then
+ if file "$path" | grep -q 'dynamically linked'; then
+ for lib in $(ldd "$path" | awk '{ print $3 }'); do
+ cache_path "$lib"
+ done
+ fi
+ fi
+ cat "$path" >/dev/null 2>&1
+ fi
+}
+
+for path in $(which halt) $(which reboot) /etc/rc?.d /etc/default; do
+ cache_path "$path"
+done
+
+eject -p -m /live_media >/dev/null 2>&1
+
+# XXX - i18n
+echo -n "Please remove the disc and close the tray (if any) then press ENTER: "
+if [ -x /sbin/usplash_write ]; then
+ /sbin/usplash_write "TIMEOUT 0"
+ /sbin/usplash_write "TEXT Please remove the disc, close the tray (if any)"
+ /sbin/usplash_write "TEXT and press ENTER to continue"
+fi
+
+read x < /dev/console
+
+exit 0