summaryrefslogtreecommitdiffstats
path: root/build_tools/archiso
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2013-01-10 22:11:11 (GMT)
committerJames Meyer <james.meyer@operamail.com>2013-01-10 22:11:11 (GMT)
commit21e0cfadb17a1a90a94a537520bc3737c43a78ce (patch)
treef5e02519cdc105012f3f0b47accbe2ab0b61c31c /build_tools/archiso
parent4473d450326bdd798c790d2f70dfd890c4dc7d42 (diff)
downloadlinhes_dev-21e0cfadb17a1a90a94a537520bc3737c43a78ce.zip
add support for ejecting the CD after install
Diffstat (limited to 'build_tools/archiso')
-rw-r--r--build_tools/archiso/archiso/archiso_shutdown33
-rw-r--r--build_tools/archiso/archiso/hooks/archiso_shutdown1
-rwxr-xr-xbuild_tools/archiso/mythvantage/root-image/etc/rc.local4
3 files changed, 37 insertions, 1 deletions
diff --git a/build_tools/archiso/archiso/archiso_shutdown b/build_tools/archiso/archiso/archiso_shutdown
index 85cce59..e61b7f9 100644
--- a/build_tools/archiso/archiso/archiso_shutdown
+++ b/build_tools/archiso/archiso/archiso_shutdown
@@ -32,6 +32,39 @@ if [[ ! -d /oldrun/archiso/copytoram ]]; then
fi
fi
+
+#JM
+#This is where the reboot would go
+echo "------------------------"
+#bootdev is created in rc.local on startup
+bootdev=$( cat /bootdev.txt )
+if [ -f /proc/sys/dev/cdrom/info ]
+then
+ cdroms=$( cat /proc/sys/dev/cdrom/info | { while read a b c; do
+ #echo $a $b $c
+ if [ "${a}" = "drive" -a "${b}" = "name:" ]; then
+ echo ${c}
+ break
+ fi
+ done
+ } )
+ for d in ${cdroms}
+ do
+ if [ "/dev/${d}" = "${bootdev}" ]
+ then
+ echo "Boot device is a cdrom, ejecting..."
+ eject ${bootdev}
+ break
+ fi
+ done
+fi
+echo "------------------------"
+sleep 1
+#
+
+
+
+
# reboot / poweroff / halt, depending on the argument passed by init
# if something invalid is passed, we halt
case "$1" in
diff --git a/build_tools/archiso/archiso/hooks/archiso_shutdown b/build_tools/archiso/archiso/hooks/archiso_shutdown
index 24e4103..64295c1 100644
--- a/build_tools/archiso/archiso/hooks/archiso_shutdown
+++ b/build_tools/archiso/archiso/hooks/archiso_shutdown
@@ -12,6 +12,7 @@ run_hook ()
cp /bin/mount /run/initramfs/bin/
cp /sbin/dmsetup /run/initramfs/sbin/
cp /sbin/losetup /run/initramfs/sbin/
+
if [[ -x /bin/nbd-client ]]; then
cp /bin/nbd-client /run/initramfs/bin/
fi
diff --git a/build_tools/archiso/mythvantage/root-image/etc/rc.local b/build_tools/archiso/mythvantage/root-image/etc/rc.local
index b6ea57e..6e49dc1 100755
--- a/build_tools/archiso/mythvantage/root-image/etc/rc.local
+++ b/build_tools/archiso/mythvantage/root-image/etc/rc.local
@@ -23,7 +23,9 @@ function install_db {
}
-
+#set bootdev.txt for shutdown eject in archiso_shutdown
+mount|grep bootmnt|cut -f1 -d" " > /run/initramfs/bootdev.txt
+cp -f /usr/bin/eject /run/initramfs/usr/bin/eject
#check to see if mysql is running
stat_busy "Checking Mysql"