turns out that [ -f ] returns true in bash !
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 29 Nov 2019 14:09:13 +0000 (15:09 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Sun, 1 Dec 2019 19:13:52 +0000 (20:13 +0100)
prep.sh

diff --git a/prep.sh b/prep.sh
index 4b851de..c9308da 100755 (executable)
--- a/prep.sh
+++ b/prep.sh
@@ -128,7 +128,7 @@ install -d -m 755 $isofs
 # Copy the kernel out
 echo "* BootCD - locating kernel"
 for kernel in $bootcd/boot/vmlinuz-* ; do
-    if [ -f $kernel ] ; then
+    if [ -f "$kernel" ] ; then
         echo "* BootCD kernel (1) creating from $kernel"
         echo "* kernel created (1) from $kernel" > $isofs/kernel.from
         install -D -m 644 $kernel $isofs/kernel
@@ -160,7 +160,7 @@ done
 # second chance if first approach would not work
 if [ ! -f $isofs/kernel ] ; then
     kernel=$(find $bootcd/boot -name linux)
-    if [ -f $kernel ] ; then
+    if [ -f "$kernel" ] ; then
         echo "* BootCD kernel (2) creating from $kernel"
         echo "* kernel created (2) from $kernel" > $isofs/kernel.from
         install -D -m 644 $kernel $isofs/kernel