summaryrefslogtreecommitdiff
path: root/debian/init.d
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 14:46:22 +0200
committerDaniel Baumann <daniel@debian.org>2007-09-23 14:46:22 +0200
commita7e62470dcdcd93501d9f54a96ca45d267ad1fe5 (patch)
treea0b23f27867323956e9383a0eb04aafce9e3d4d0 /debian/init.d
parent4a0b1ba4d428c623d14bae7f0db85c80abb0da0a (diff)
downloadlive-boot-a7e62470dcdcd93501d9f54a96ca45d267ad1fe5.tar.gz
live-boot-a7e62470dcdcd93501d9f54a96ca45d267ad1fe5.zip
Adding casper 1.61+debian-1.
Diffstat (limited to 'debian/init.d')
-rw-r--r--debian/init.d40
1 files changed, 40 insertions, 0 deletions
diff --git a/debian/init.d b/debian/init.d
new file mode 100644
index 0000000..6d2d6d3
--- /dev/null
+++ b/debian/init.d
@@ -0,0 +1,40 @@
+#! /bin/sh
+
+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 /cdrom >/dev/null 2>&1
+
+# XXX - i18n
+echo -n "Please remove the disc, close the tray (if any) and 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