From 608fbe13d0d069e99d982c0bec6266386b10f150 Mon Sep 17 00:00:00 2001 From: Matthew Burgess Date: Thu, 9 Feb 2012 22:58:45 +0000 Subject: [PATCH] Fix various issues when building CLFS. --- CLFS/clfs.xsl | 7 +- CLFS/master.sh | 120 +++++++++++++++++++++++++++++++++- CLFS2/clfs2.xsl | 6 +- Config.in | 2 +- common/libs/func_wrt_Makefile | 11 +++- 5 files changed, 139 insertions(+), 7 deletions(-) diff --git a/CLFS/clfs.xsl b/CLFS/clfs.xsl index 0562fb8..ecb06b8 100644 --- a/CLFS/clfs.xsl +++ b/CLFS/clfs.xsl @@ -216,9 +216,9 @@ - + + contains(string(), 'make -k check')"> @@ -283,6 +283,9 @@ + + + diff --git a/CLFS/master.sh b/CLFS/master.sh index efa3cd8..8948708 100644 --- a/CLFS/master.sh +++ b/CLFS/master.sh @@ -225,6 +225,7 @@ chroot_Makefiles() { # pkg_tarball=$(get_package_tarball_name $name) # This is very ugly:: util-linux is in /chroot but must be run under LUSER + # Same for e2fsprogs (in CLFS 1.1.0) # .. Customized makefile entry case "${this_script}" in *util-linux) @@ -236,6 +237,42 @@ chroot_Makefiles() { # wrt_touch temptools="$temptools $this_script" continue ;; + *util-linux-ng) + LUSER_wrt_target "${this_script}" "$PREV" + LUSER_wrt_unpack "$pkg_tarball" + [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" + LUSER_wrt_RunAsUser "${file}" + LUSER_RemoveBuildDirs "${name}" + wrt_touch + temptools="$temptools $this_script" + continue ;; + *util-linux-libs) + LUSER_wrt_target "${this_script}" "$PREV" + LUSER_wrt_unpack "$pkg_tarball" + [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" + LUSER_wrt_RunAsUser "${file}" + LUSER_RemoveBuildDirs "${name}" + wrt_touch + temptools="$temptools $this_script" + continue ;; + *e2fsprogs) + LUSER_wrt_target "${this_script}" "$PREV" + LUSER_wrt_unpack "$pkg_tarball" + [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" + LUSER_wrt_RunAsUser "${file}" + LUSER_RemoveBuildDirs "${name}" + wrt_touch + temptools="$temptools $this_script" + continue ;; + *e2fsprogs-libs) + LUSER_wrt_target "${this_script}" "$PREV" + LUSER_wrt_unpack "$pkg_tarball" + [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" + LUSER_wrt_RunAsUser "${file}" + LUSER_RemoveBuildDirs "${name}" + wrt_touch + temptools="$temptools $this_script" + continue ;; esac @@ -518,7 +555,7 @@ final_system_Makefiles() { # CHROOT_Unpack "$pkg_tarball" # If the testsuites must be run, initialize the log file case $name in - binutils | gcc | glibc ) + binutils | gcc | glibc | eglibc ) [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}" ;; * ) @@ -633,6 +670,84 @@ bootscripts_Makefiles() { # done # for file in bootscripts/* ... } +#--------------------------------------# +network_Makefiles() { # +#--------------------------------------# + + if [[ "${METHOD}" = "chroot" ]]; then + echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) network ( CHROOT ) ${R_arrow}" + else + echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) network ( ROOT ) ${R_arrow}" + fi + + for file in network/* ; do + # Keep the script file name + this_script=`basename $file` + + case $this_script in + *choose) continue ;; # This is not a script but a commentary. + *dhcp) continue ;; # Assume static networking. + *dhcpcd) continue ;; # Assume static networking. + *) ;; + esac + + # First append each name of the script files to a list (this will become + # the names of the targets in the Makefile + networktools="$networktools $this_script" + + # Grab the name of the target, strip id number, XXX-script + name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'\ + -e 's@-64bit@@' \ + -e 's@-64@@' \ + -e 's@64@@' \ + -e 's@n32@@'` + case $name in + *network*) name=network-cross-lfs ;; + esac + + pkg_tarball=$(get_package_tarball_name $name) + + #--------------------------------------------------------------------# + # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< # + #--------------------------------------------------------------------# + # + # Drop in the name of the target on a new line, and the previous target + # as a dependency. Also call the echo_message function. + CHROOT_wrt_target "${this_script}" "$PREV" + # + # If $pkg_tarball isn't empty, we've got a package... + # + if [ "$pkg_tarball" != "" ] ; then + if [ "${INSTALL_LOG}" = "y" ] ; then + CHROOT_wrt_LogNewFiles "$name" + fi + CHROOT_Unpack "$pkg_tarball" + fi + # + CHROOT_wrt_RunAsRoot "${file}" + # + # Write installed files log and remove the build directory(ies) + # except if the package build fails. + if [ "$pkg_tarball" != "" ] ; then + CHROOT_wrt_RemoveBuildDirs "$name" + if [ "${INSTALL_LOG}" = "y" ] ; then + CHROOT_wrt_LogNewFiles "$name" + fi + fi + # + # Include a touch of the target name so make can check if it's already been made. + wrt_touch + # + #--------------------------------------------------------------------# + # >>>>>>>> END OF Makefile ENTRY <<<<<<<< # + #--------------------------------------------------------------------# + # + # Keep the script file name for Makefile dependencies. + PREV=$this_script + + done # for file in network/* ... +} + #--------------------------------------# bootable_Makefiles() { # #--------------------------------------# @@ -756,6 +871,9 @@ set -e # Add the iterations targets, if needed [[ "$COMPARE" = "y" ]] && wrt_compare_targets bootscripts_Makefiles # mk_BOOTSCRIPT (CHROOT) $bootscripttools + if [ -d network ]; then + network_Makefiles # If present, process network setup. + fi bootable_Makefiles # mk_BOOTABLE (CHROOT) $bootabletools # Add the CUSTOM_TOOLS targets, if needed diff --git a/CLFS2/clfs2.xsl b/CLFS2/clfs2.xsl index 76fa0f0..83b4f53 100644 --- a/CLFS2/clfs2.xsl +++ b/CLFS2/clfs2.xsl @@ -71,7 +71,8 @@ set -e - + cd $PKGDIR tar -xvf ../vim-&vim-version;-lang.* --strip-components=1 @@ -138,6 +139,9 @@ + + + diff --git a/Config.in b/Config.in index 5bbf4dc..5dc23ab 100644 --- a/Config.in +++ b/Config.in @@ -260,7 +260,7 @@ menu "--- BOOK Settings" default "hppa1.1-unknown-linux-gnu" if PROC_hppa1 default "hppa2.0-unknown-linux-gnu" if PROC_hppa2 - default "arm-unknown-linux-gnu" if ARCH_ARM && BOOK_CLFS2 + default "arm-unknown-linux-gnueabi" if ARCH_ARM && BOOK_CLFS2 default "arm-unknown-linux-uclibc" if PROC_ARM default "armv5l-unknown-linux-uclibc" if PROC_ARM5L diff --git a/common/libs/func_wrt_Makefile b/common/libs/func_wrt_Makefile index a530928..a36566c 100644 --- a/common/libs/func_wrt_Makefile +++ b/common/libs/func_wrt_Makefile @@ -71,6 +71,8 @@ get_package_tarball_name() { # case $script_name in tcl) echo $(grep "^tcl" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;; + iputils) echo $(grep "^iputils" $JHALFSDIR/pkg_tarball_list | head -n1 ) + ;; powerpc-utils) echo $(grep "^powerpc-utils" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;; uClibc) @@ -85,12 +87,17 @@ get_package_tarball_name() { # # Uses kernel headers directly echo $(grep "^linux-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) else - # CLFS{2,3} use massaged headers package - echo $(grep "^linux-headers-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) + # CLFS{2,3} used to use massaged headers package + # echo $(grep "^linux-headers-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) + echo $(grep "^linux-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) fi ;; expect) echo $(grep "^expect" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;; + e2fsprogs-libs) echo $(grep "^e2fsprogs" $JHALFSDIR/pkg_tarball_list | head -n1 ) + ;; + util-linux-libs) echo $(grep "^util-linux" $JHALFSDIR/pkg_tarball_list | head -n1 ) + ;; xz-utils) echo $(grep "^xz" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;; sqlite) echo $(grep "^sqlite" $JHALFSDIR/pkg_tarball_list | head -n1 )