From 0271c0c10d3c10d30f7fe8c0535ea883c7c3b73a Mon Sep 17 00:00:00 2001 From: George Boudreau Date: Tue, 21 Mar 2006 13:25:20 +0000 Subject: [PATCH] Standardized handling of the optional param CONFIG --- CLFS/master.sh | 31 ++++++++++++++++++------------- HLFS/master.sh | 5 ----- LFS/master.sh | 15 ++++++++------- common/common-functions | 1 + 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/CLFS/master.sh b/CLFS/master.sh index d4a3aae..f0eb2ff 100755 --- a/CLFS/master.sh +++ b/CLFS/master.sh @@ -216,12 +216,14 @@ boot_Makefiles() { # *grub*) continue ;; *whatnext*) continue ;; *settingenvironment*) sed 's@PS1=@set +h\nPS1=@' -i $file ;; - *kernel) # if there is no kernel config file do not build the kernel + *kernel) # if there is no kernel config file do not build the kernel [[ -z $CONFIG ]] && continue - sed "s|make mrproper|make mrproper\ncp $CONFIG .config|" -i $file - # You cannot run menuconfig from within the makefile + # Copy the config file to /sources with a standardized name + cp -v $CONFIG $BUILDDIR/sources/kernel-config + sed "s|make mrproper|make mrproper\ncp /sources/kernel-config .config|" -i $file + # You cannot run menuconfig from within the makefile sed 's|menuconfig|oldconfig|' -i $file - #If defined include the keymap in the kernel + #If defined include the keymap in the kernel if [[ -n "$KEYMAP" ]]; then sed "s|^loadkeys -m.*>|loadkeys -m $KEYMAP >|" -i $file else @@ -856,12 +858,14 @@ bootable_Makefiles() { # case $this_script in *grub*) continue ;; *kernel) - # if there is no kernel config file do not build the kernel + # if there is no kernel config file do not build the kernel [[ -z $CONFIG ]] && continue - sed "s|make mrproper|make mrproper\ncp $CONFIG .config|" -i $file - # You cannot run menuconfig from within the makefile + # Copy the config file to /sources with a standardized name + cp -v $CONFIG $BUILDDIR/sources/kernel-config + sed "s|make mrproper|make mrproper\ncp /sources/kernel-config .config|" -i $file + # You cannot run menuconfig from within the makefile sed 's|menuconfig|oldconfig|' -i $file - # If defined include the keymap in the kernel + # If defined include the keymap in the kernel if [[ -n "$KEYMAP" ]]; then sed "s|^loadkeys -m.*>|loadkeys -m $KEYMAP >|" -i $file else @@ -937,13 +941,14 @@ bm_bootable_Makefiles() { # case $this_script in *grub*) continue ;; *kernel) - # if there is no kernel config file do not build the kernel + # if there is no kernel config file do not build the kernel [[ -z $CONFIG ]] && continue - cfg_file="/sources/`basename $CONFIG`" - sed "s|make mrproper|make mrproper\ncp $cfg_file .config|" -i $file - # You cannot run menuconfig from within the makefile + # Copy the named config file to /sources with a standardized name + cp -v $CONFIG $BUILDDIR/sources/kernel-config + sed "s|make mrproper|make mrproper\ncp ../kernel-config .config|" -i $file + # You cannot run menuconfig from within the makefile sed 's|menuconfig|oldconfig|' -i $file - # If defined include the keymap in the kernel + # If defined include the keymap in the kernel if [[ -n "$KEYMAP" ]]; then sed "s|^loadkeys -m.*>|loadkeys -m $KEYMAP >|" -i $file else diff --git a/HLFS/master.sh b/HLFS/master.sh index 7d45370..06f1f36 100755 --- a/HLFS/master.sh +++ b/HLFS/master.sh @@ -455,11 +455,6 @@ EOF ) >> $MKFILE.tmp fi - if [[ `_IS_ $this_script kernel` ]] ; then - # not much really, script does everything.. - echo -e "\t@cp -f $CONFIG \$(MOUNT_PT)/sources/kernel-config" >> $MKFILE.tmp - fi - # Check if we have a real /etc/fstab file if [[ `_IS_ $this_script fstab` ]] && [[ -n "$FSTAB" ]] ; then wrt_copy_fstab "$this_script" diff --git a/LFS/master.sh b/LFS/master.sh index 242594a..599fd82 100755 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -222,14 +222,15 @@ chapter789_Makefiles() { # The filesystems can't be unmounted via Makefile and the user # should enter the chroot environment to create the root # password, edit several files and setup Grub. - if [[ `_IS_ ${this_script} grub` ]] || [[ `_IS_ ${this_script} reboot` ]] ; then - continue - fi - + # # If no .config file is supplied, the kernel build is skipped - if [ -z $CONFIG ] && [[ `_IS_ ${this_script} kernel` ]] ; then - continue - fi + # + case ${this_script} in + *grub) continue ;; + *reboot) continue ;; + *kernel) [[ -z ${CONFIG} ]] && continue + cp ${CONFIG} $BUILDDIR/sources/kernel-config ;; + esac # First append each name of the script files to a list (this will become # the names of the targets in the Makefile diff --git a/common/common-functions b/common/common-functions index 5fcee0d..3216673 100644 --- a/common/common-functions +++ b/common/common-functions @@ -722,6 +722,7 @@ extract_commands() { # grep "\-version" $BOOK/general.ent | sed -e 's@@"@' \ -e '/generic/d' >> packages + echo " ...OK" ;; esac