Improve /etc/grml/fai/live-initramfs/live.conf handling
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 10-build-initramfs
index 98ea666..9777a52 100755 (executable)
@@ -4,13 +4,21 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2 or any later version.
-# Latest change: Sun Dec 16 19:11:33 CET 2007 [mika]
 ################################################################################
 
 set -e
 
-cp /etc/grml/fai/live-initramfs/live.conf $target/etc/live.conf
-cp /etc/grml/fai/live-initramfs/grml-script.init-top "$target/usr/share/initramfs-tools/scripts/init-top/grml"
+if ! [ -f "$target/etc/live.conf" ] ; then
+  echo "Warning: $target/etc/live.conf does not exist yet,"
+  echo "         ... installing /etc/grml/fai/live-initramfs/live.conf"
+  cp /etc/grml/fai/live-initramfs/live.conf "$target/etc/live.conf"
+fi
+
+if [ -f /etc/grml/fai/live-initramfs/grml-script.init-top ] ; then
+  cp /etc/grml/fai/live-initramfs/grml-script.init-top "$target/usr/share/initramfs-tools/scripts/init-top/grml"
+else
+  echo "Warning: /etc/grml/fai/live-initramfs/grml-script.init-top could not be read"
+fi
 
 FILE=$(ls -1 $target/boot/vmlinuz-* 2>/dev/null| sort -r | head -1)
 KERNELVERSION=$(echo "${FILE##$target/boot/vmlinuz-}")