From d601cfcc4728a992d94150a9304dcecdc91e3180 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Fri, 10 Mar 2017 20:23:57 +0000 Subject: [PATCH] Fix logic for copying fstab. That stupid bug wanted to copy fstab when FSTAB was empty! --- CLFS/master.sh | 10 +++++----- LFS/master.sh | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CLFS/master.sh b/CLFS/master.sh index 6417ff1..d25aa56 100644 --- a/CLFS/master.sh +++ b/CLFS/master.sh @@ -378,7 +378,7 @@ boot_Makefiles() { # *grub | *aboot | *colo | *silo | *arcload | *lilo | *introduction ) continue ;; *how-to-view*) continue ;; *whatnext*) continue ;; - *fstab) [[ ! -z ${FSTAB} ]] && + *fstab) [[ -z "${FSTAB}" ]] || [[ ${FSTAB} == $BUILDDIR/sources/fstab ]] || cp ${FSTAB} $BUILDDIR/sources/fstab ;; *kernel) # if there is no kernel config file do not build the kernel @@ -499,7 +499,7 @@ boot_Makefiles() { # *changingowner) wrt_RunAsRoot "${file}" ;; *devices) wrt_RunAsRoot "${file}" ;; *fstab) - if [[ -n "$FSTAB" ]]; then + if [[ -n "${FSTAB}" ]]; then LUSER_wrt_CopyFstab else LUSER_wrt_RunAsUser "${file}" @@ -734,10 +734,10 @@ bootscripts_Makefiles() { # this_script=`basename $file` case $this_script in - *udev) continue ;; # This is not a script but a commentary, we want udev-rules + *udev) continue ;; # This is not a script but a comment, we want udev-rules *console*) continue ;; # Use the files that came with the bootscripts # fstab is now here (for 3.x.y) - *fstab) [[ ! -z ${FSTAB} ]] && + *fstab) [[ -z "${FSTAB}" ]] || [[ ${FSTAB} == $BUILDDIR/sources/fstab ]] || cp ${FSTAB} $BUILDDIR/sources/fstab ;; *) ;; @@ -912,7 +912,7 @@ bootable_Makefiles() { # # A little housekeeping on the scripts case $this_script in *grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* ) continue ;; - *fstab) [[ ! -z ${FSTAB} ]] && + *fstab) [[ -z "${FSTAB}" ]] || [[ ${FSTAB} == $BUILDDIR/sources/fstab ]] || cp ${FSTAB} $BUILDDIR/sources/fstab ;; *kernel) # if there is no kernel config file do not build the kernel diff --git a/LFS/master.sh b/LFS/master.sh index f80cf57..69ddc28 100644 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -312,7 +312,7 @@ chapter78_Makefiles() { # If no .config file is supplied, the kernel build is skipped case ${this_script} in *grub) continue ;; - *fstab) [[ ! -z ${FSTAB} ]] && + *fstab) [[ -z "${FSTAB}" ]] || [[ ${FSTAB} == $BUILDDIR/sources/fstab ]] || cp ${FSTAB} $BUILDDIR/sources/fstab ;; *kernel) [[ -z ${CONFIG} ]] && continue @@ -366,7 +366,7 @@ chapter78_Makefiles() { # Check if we have a real /etc/fstab file case "${this_script}" in - *fstab) if [[ -n $FSTAB ]]; then + *fstab) if [[ -n "$FSTAB" ]]; then CHROOT_wrt_CopyFstab else CHROOT_wrt_RunAsRoot "$file"