[Fai-commit] r5402 - trunk/bin
Thomas Lange
lange at alioth.debian.org
Sun May 3 19:30:35 UTC 2009
Author: lange
Date: 2009-05-03 19:30:35 +0000 (Sun, 03 May 2009)
New Revision: 5402
Modified:
trunk/bin/fai-cd
Log:
copy live subdir only when available
check root id when -u is used
Modified: trunk/bin/fai-cd
===================================================================
--- trunk/bin/fai-cd 2009-05-03 19:28:57 UTC (rev 5401)
+++ trunk/bin/fai-cd 2009-05-03 19:30:35 UTC (rev 5402)
@@ -76,7 +76,7 @@
# insert date into grub menu
if [ $bootonly -eq 1 ]; then
echo "Using kernel version $kernelversion"
- perl -pi -e "s/_VERSIONSTRING_/ Kernel : $kernelversion /" $tmp/boot/grub/menu.lst
+ perl -pi -e "s/_VERSIONSTRING_/Kernel : $kernelversion/" $tmp/boot/grub/menu.lst
else
perl -pi -e "s/_VERSIONSTRING_/ $isoversion /" $tmp/boot/grub/menu.lst
fi
@@ -146,10 +146,12 @@
[ -d $usbdir ] || die 17 "$usbdir does not exist."
if [ $rsync -eq 1 ]; then
echo "Syncing FAI data to USB device $usbdir"
- rsync --delete -av $tmp/live $tmp/boot $usbdir || true
+ rsync --delete -av $tmp/boot $usbdir || true
+ [ -d $tmp/live ] && rsync --delete -av $tmp/live $usbdir || true
else
echo "Writing FAI data to USB device $usbdir"
- cp -a $tmp/live $tmp/boot $usbdir 2>/dev/null || true
+ cp -a $tmp/boot $usbdir 2>/dev/null || true
+ [ -d $tmp/live ] && cp -a $tmp/live $usbdir 2>/dev/null || true
fi
echo $isoversion > $usbdir/.FAI-CD-VERSION
@@ -260,7 +262,8 @@
fi
[ -f "$isoname" ] && [ $forceremoval -eq 1 ] && rm $isoname
[ -f "$isoname" ] && die 3 "Outputfile $isoname already exists. Please remove it or use -f."
-if [ $bootonly -eq 0 ]; then
+
+if [ $bootonly -eq 0 -o $makeusb -eq 1 ]; then
[ $(id -u) != "0" ] && die 9 "Run this program as root."
fi
More information about the Fai-commit
mailing list