summaryrefslogtreecommitdiffstats
path: root/build_tools/archiso
diff options
context:
space:
mode:
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"