[or-cvs] r16430: Added check if running from CD in persistent volume enabling (incognito/trunk/root_overlay/usr/sbin)

anonym at seul.org anonym at seul.org
Tue Aug 5 18:52:39 UTC 2008


Author: anonym
Date: 2008-08-05 14:52:39 -0400 (Tue, 05 Aug 2008)
New Revision: 16430

Modified:
   incognito/trunk/root_overlay/usr/sbin/enable-persistent-vol
Log:
Added check if running from CD in persistent volume enabling script.


Modified: incognito/trunk/root_overlay/usr/sbin/enable-persistent-vol
===================================================================
--- incognito/trunk/root_overlay/usr/sbin/enable-persistent-vol	2008-08-05 18:51:10 UTC (rev 16429)
+++ incognito/trunk/root_overlay/usr/sbin/enable-persistent-vol	2008-08-05 18:52:39 UTC (rev 16430)
@@ -1,7 +1,8 @@
 #!/bin/bash
 
-# FIXME: we should get this from somewhere
-LOCK_FILE=/mnt/cdrom/LOCK_NO_PERSISTENT
+# FIXME: we should get these from somewhere
+MEDIAROOT=/mnt/cdrom
+LOCK_FILE=${MEDIAROOT}/LOCK_NO_PERSISTENT
 
 # Find the dialog command
 DIALOG="$(which Xdialog 2>/dev/null)"
@@ -12,6 +13,12 @@
 DEFAULT_WIDTH=80            
 DIALOG="${DIALOG} --wrap --cr-wrap --left"          
 
+# there probably is a better way to determine if we run from CD or USB
+if [[ -e ${MEDIAROOT}/isolinux -a ! -e ${MEDIAROOT}/syslinux ]]; then
+	${DIALOG} --msgbox "You are running from CD. You need to run __INCOGNITO__ from USB in order to use a persistent home volume." 0 ${DEFAULT_WIDTH}
+	exit 1
+fi
+
 if [[ ! -e ${LOCK_FILE} ]]; then
 	${DIALOG} --msgbox "The persistent home volume is already enabled. If you want to disable it, that should be done during the guide next time you boot __INCOGNITO__." 0 ${DEFAULT_WIDTH}
 	exit 1



More information about the tor-commits mailing list