diff --git a/CLFS3/master.sh b/CLFS3/master.sh index 71794ee..5714b16 100644 --- a/CLFS3/master.sh +++ b/CLFS3/master.sh @@ -118,13 +118,64 @@ EOF host_prep=" 025-addinguser 026-settingenvironment 027-create-directories 028-creating-sysfile" } +#-----------------------------# +systemprep_Makefiles() { # +#-----------------------------# + echo "${tab_}${GREEN}Processing... ${L_arrow}system prep tools ( LUSER ) ${R_arrow}" + + for file in systemprep/* ; do + # Keep the script file name + this_script=`basename $file` + + # Set the dependency for the first target. + if [ -z $PREV ] ; then PREV=028-creating-sysfile ; fi + + # First append each name of the script files to a list (this will become + # the names of the targets in the Makefile) + cross_tools="$cross_tools $this_script" + + # Grab the name of the target (minus the -headers or -cross in the case of gcc + # and binutils in chapter 5) + name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'` + + 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. + LUSER_wrt_target "${this_script}" "$PREV" + # + # If $pkg_tarball isn't empty, we've got a package... + if [ "$pkg_tarball" != "" ] ; then + LUSER_wrt_unpack "$pkg_tarball" + fi + # + LUSER_wrt_RunAsUser "${file}" + # + [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}" + # + # 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 .... +} + #-----------------------------# cross_tools_Makefiles() { # #-----------------------------# echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools ( LUSER ) ${R_arrow}" - - for file in cross-tools/* ; do + + for file in cross-tools/* ; do # Keep the script file name this_script=`basename $file` # @@ -407,6 +458,7 @@ build_Makefile() { # Construct a Makefile from the book scripts >$MKFILE.tmp host_prep_Makefiles + [[ "${PLATFORM% -*}" = "WRT" ]] && systemprep_Makefiles # $cross_tools cross_tools_Makefiles # $cross_tools final_system_Makefiles # $basicsystem bootscripts_Makefiles # $bootscripttools diff --git a/Config.in b/Config.in index 8df9af5..8c72cdd 100644 --- a/Config.in +++ b/Config.in @@ -109,6 +109,21 @@ menu "--- BOOK Settings" bool "hppa" if BOOK_CLFS2 endchoice + choice + prompt "Hardware Platform" + depends BOOK_CLFS3 && ARCH_MIPS + default PLATFORM_GENERIC + help + # Chose a destination platform + # Platform specific files will be included + + config PLATFORM_GENERIC + bool "Generic platform" + + config PLATFORM_WRT + bool "WRT - MIPS based wireless router" if ARCH_MIPS + endchoice + choice prompt "Library" depends (BOOK_CLFS && !ARCH_ALPHA) || (BOOK_CLFS3 && ARCH_MIPS) @@ -123,7 +138,7 @@ menu "--- BOOK Settings" bool "64-bit" if !ARCH_PPC config DATA_MULTI - bool "multilib" if !(BOOK_CLFS3 && ARCH_MIPS) + bool "multilib" if !(BOOK_CLFS3 && ARCH_MIPS ) endchoice choice @@ -218,16 +233,24 @@ menu "--- BOOK Settings" default "sparc-unknown-linux-gnu" if ARCH_SPARC default "powerpc-unknown-linux-gnu" if ARCH_PPC + config PLATFORM + string + default "GENERIC" if (!BOOK_CLFS3) || PLATFORM_GENERIC + default "WRT - Wireless Router" if PLATFORM_WRT + config ARCH string default "x86" if ARCH_X86 && (DATA_32 || BOOK_CLFS2 || BOOK_CLFS3) default "x86_64" if ARCH_X86 && DATA_MULTI default "x86_64-64" if ARCH_X86 && DATA_64 + default "wrt" if PLATFORM_WRT && BOOK_CLFS3 + default "mips" if ARCH_MIPS && (DATA_32 || BOOK_CLFS3) default "mips64" if ARCH_MIPS && DATA_MULTI default "mips64-64" if ARCH_MIPS && DATA_64 && BOOK_CLFS + default "ppc" if ARCH_PPC && DATA_32 default "ppc64" if ARCH_PPC && DATA_MULTI @@ -238,7 +261,12 @@ menu "--- BOOK Settings" default "alpha" if ARCH_ALPHA default "arm" if ARCH_ARM default "hppa" if ARCH_HPPA - + + config PLATFORM + string + default "WRT - Wireless Router" if PLATFORM_WRT + default "GENERIC" if PLATFORM_GENERIC + config MIPS_LEVEL string depends BOOK_CLFS3 && ARCH_MIPS diff --git a/common/libs/func_validate_configs.sh b/common/libs/func_validate_configs.sh index 008b537..abbc51f 100644 --- a/common/libs/func_validate_configs.sh +++ b/common/libs/func_validate_configs.sh @@ -23,7 +23,7 @@ inline_doc local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL PAGE TIMEZONE LANG LC_ALL LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE" local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TARGET32 TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE" local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET REPORT STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE" - local -r clfs3_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET MIPS_LEVEL REPORT STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP CUSTOM_TOOLS REBUILD_MAKEFILE" + local -r clfs3_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH PLATFORM TARGET MIPS_LEVEL REPORT STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP CUSTOM_TOOLS REBUILD_MAKEFILE" local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE" local -r blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR" @@ -109,6 +109,7 @@ inline_doc MODEL | \ METHOD | \ ARCH | \ + PLATFORM | \ TARGET | \ GRSECURITY_HOST | \ BLFS_TOOL | \