[Fai-commit] r4332 - in trunk: bin man
lange at alioth.debian.org
lange at alioth.debian.org
Wed Jun 13 11:26:08 UTC 2007
Author: lange
Date: 2007-06-13 11:26:07 +0000 (Wed, 13 Jun 2007)
New Revision: 4332
Modified:
trunk/bin/fai-cd
trunk/man/fai-cd.8
Log:
add option -k, this is for debugging
Modified: trunk/bin/fai-cd
===================================================================
--- trunk/bin/fai-cd 2007-06-13 10:48:25 UTC (rev 4331)
+++ trunk/bin/fai-cd 2007-06-13 11:26:07 UTC (rev 4332)
@@ -34,6 +34,7 @@
forceremoval=0;
burn=0
+keep=0
hidedirs="/usr/share/locale /usr/share/doc /var/lib/apt /var/cache/apt /usr/share/man /var/lib/dpkg/info /media/mirror/aptcache /media/mirror/.apt-move"
# we need FAI_CONFIGDIR, NFSROOT
@@ -153,6 +154,11 @@
echo "Writing FAI CD-ROM image to $isoname. This may need some time."
mkisofs -V "$vname" -A "$aname" -log-file /dev/null -quiet -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o $isoname $tmp || die 12 "mkisofs failed."
echo -n "ISO image size and filename: "; du -h $isoname
+ if [ $keep -eq 1 ]; then
+ echo "fai-cd script stopped for 6666 seconds. The filesystem is now available in $tmp."
+ echo "To continue the script and call the cleanup call: pkill -f 'sleep 6666'"
+ sleep 6666 || true
+ fi
rm $tmp1
unhide_dirs
umount_dirs
@@ -171,12 +177,13 @@
esac
# Parse commandline options
-while getopts "fhg:bm:C:" opt ; do
+while getopts "kfhg:bm:C:" opt ; do
case "$opt" in
C) cfdir=$OPTARG ;;
f) forceremoval=1 ;;
h) usage ;;
g) grub_config="$OPTARG" ;;
+ k) keep=1 ;;
m) mirrordir="$OPTARG" ;;
b) burn=1 ;;
?) usage ;;
@@ -189,7 +196,7 @@
[ -z "$mirrordir" ] && die 4 "Please specify the directory of your mirror using -m"
[ -d "$mirrordir" ] || die 5 "$mirrordir is not a directory"
[ -f "$isoname" ] && [ $forceremoval -eq 1 ] && rm $isoname
-[ -f "$isoname" ] && die 3 "Outputfile $isoname already exists. Please remove it."
+[ -f "$isoname" ] && die 3 "Outputfile $isoname already exists. Please remove it or use -f."
[ $(id -u) != "0" ] && die 9 "Run this program as root."
[ -x "$(which mkisofs)" ] || die 8 "mkisofs not found. Please install package."
Modified: trunk/man/fai-cd.8
===================================================================
--- trunk/man/fai-cd.8 2007-06-13 10:48:25 UTC (rev 4331)
+++ trunk/man/fai-cd.8 2007-06-13 11:26:07 UTC (rev 4332)
@@ -60,6 +60,12 @@
.BI \-h
Show simle help and version.
.TP
+.BI \-k
+Keep the temporary filesystem for debugging. The script will sleep for
+a long time, before continuing the cleanup of temp files and
+mounts. Beware of killing or suspending the script itself, since a lot
+of mounts will remain. This is for debugging only!
+.TP
.BI "\-m " DIRECTORY
Use DIRECTORY as partitial FAI mirror. This option is mandatory.
.SH SEE ALSO
More information about the Fai-commit
mailing list