Changes in / [ca368ad:0f7a988]
- Files:
-
- 1 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
BLFS/xsl/scripts.xsl
rca368ad r0f7a988 306 306 </xsl:when><!-- @role="package" --> 307 307 308 <xsl:when test="@role = 'qt 5-prefix' or @role = 'qt6-prefix'">308 <xsl:when test="@role = 'qt4-prefix' or @role = 'qt5-prefix'"> 309 309 <xsl:apply-templates select=".//screen[./userinput]"/> 310 310 </xsl:when> … … 458 458 </xsl:call-template> 459 459 </xsl:variable> 460 <xsl:variable name="first_letter" 461 select="translate(substring($package,1,1), 462 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 463 'abcdefghijklmnopqrstuvwxyz')"/> 460 464 <xsl:text>
</xsl:text> 461 465 <xsl:value-of select="$varname"/> … … 473 477 <xsl:value-of select="$varname"/> 474 478 <xsl:text>" 475 else<!-- Download from upstream http --> 476 wget -T 30 -t 5 "</xsl:text> 477 <xsl:value-of select="$httpurl"/> 479 else
</xsl:text> 480 <!-- Download from upstream http --> 481 <xsl:if test="string-length($httpurl) > 10"> 482 <xsl:text> wget -T 30 -t 5 "</xsl:text> 483 <xsl:value-of select="$httpurl"/> 484 <xsl:text>" ||
</xsl:text> 485 </xsl:if> 486 <!-- Download from upstream ftp --> 487 <xsl:if test="string-length($ftpurl) > 10"> 488 <xsl:text> wget -T 30 -t 5 "</xsl:text> 489 <xsl:value-of select="$ftpurl"/> 490 <xsl:text>" ||
</xsl:text> 491 </xsl:if> 492 <!-- The FTP_SERVER mirror as a last resort --> 493 <xsl:text> wget -T 30 -t 5 "${JH_FTP_SERVER}svn/</xsl:text> 494 <xsl:value-of select="$first_letter"/> 495 <xsl:text>/$</xsl:text> 496 <xsl:value-of select="$varname"/> 478 497 <xsl:text>" 479 498 fi -
Config.in
rca368ad r0f7a988 1 # Check for "nproc" presence:2 config HAVE_NPROC3 def_bool $(shell,if nproc &>/dev/null; then echo y; else echo n; fi)4 5 # Check for "cpuset controller in cgroup v2" presence:6 config HAVE_CGROUP7 def_bool $(shell,if grep -q cpuset /sys/fs/cgroup/cgroup.controllers 2>/dev/null; then echo y; else echo n; fi)8 9 1 menu "BOOK Settings" 10 2 … … 430 422 # timing out. 431 423 424 config SERVER 425 string "FTP mirror" 426 default "http://ftp.osuosl.org" 427 depends on GETPKG 428 help 429 #-- FTP mirror to download packages and patches if not found 430 # in $SRC_ARCHIVE 431 # As a last resort, the files will downloaded from upstream, 432 # if possible. 433 432 434 config RUNMAKE 433 435 bool "Run the makefile" … … 449 451 menu "Build Settings" 450 452 depends on !BOOK_BLFS 451 452 #--- Parallelism453 menu "Parallelism settings"454 if HAVE_NPROC455 config ALL_CORES456 bool "Use all cores"457 default y458 help459 If you answer y, MAKEFLAGS will be set to "-j$(nproc)" at the460 beginning of each package script, and book instructions will not461 be changed otherwise. This will run the scripts with the same462 settings as in the book since version r12.0-87 included. Before463 that version, this will run the builds with all cores, but some464 test suites may still be run sequentially. You'll be asked for465 a CPU set to use, so that the number of jobs can still be limited466 in this way (useful for measuring SBU values at -j4, for467 example).468 If you answer n, then jhalfs will fall back to a static number469 of cores, defined below.470 471 if ALL_CORES && HAVE_CGROUP472 config CPUSET473 string "set of cpus to use, or 'all' for all cpus"474 default "all"475 help476 See "List format" in cpuset(7). Choosing cpus depend477 on the topology of your processors. Sometimes two478 hyperthreads on the same core are numbered consecutively.479 For example for using all cores and no hyperthreading on480 a Haswell, use "0,2,4,6". Other brands may have a different481 topology, and may require e.g. "0-3" to use the first 4 cores.482 If not sure, keep the default.483 endif484 485 endif # HAVE_NPROC486 if !HAVE_NPROC487 config ALL_CORES488 bool489 default n490 endif491 492 config N_PARALLEL493 int "Number of parallel `make' jobs"494 depends on !ALL_CORES495 default 1496 help497 #-- The usual recommandation is (number of CPU cores)+1498 # Do not set for meaningful SBU calculations.499 500 config REALSBU501 bool "Build Binutils pass1 without parallelism (Real SBU)"502 default n503 help504 #-- Use -j1 in make invokation for Binutils pass1 to505 # get a valid SBU value.506 endmenu # parallelism507 453 508 454 #--- Test Suites … … 522 468 # do not stop on test suite failures. 523 469 470 menu "Test settings" 471 depends on CONFIG_TESTS 524 472 choice 525 depends on CONFIG_TESTS526 473 prompt "Tests level" 527 474 default TST_1 … … 543 490 544 491 endchoice 492 493 endmenu # test settings 545 494 546 495 config TEST … … 815 764 depends on !BOOK_BLFS 816 765 817 #--- Optimizations818 config CONFIG_OPTIMIZE819 bool "Optimization"820 default n821 help822 # Opens a menu for various optimization settings:823 # Actual optimization flags MUST be defined in ./optimize/*824 # before activating this option.825 #826 # WARNING: The use of build optimizations may lead to build issues.827 # If the system doesn't work as expected, please rebuild828 # without optimizations before asking for support.829 menu "Optimization settings"830 depends on CONFIG_OPTIMIZE831 832 choice833 prompt "Optimization level"834 default OPT_1835 help836 #-- Optimization values are set in optimize/* files837 838 config OPT_1839 bool "Final system only"840 841 config OPT_2842 bool "Both temp tools and final system"843 844 endchoice845 846 endmenu # Optimization settings847 config OPTIMIZE848 int849 default "0" if !CONFIG_OPTIMIZE850 default "1" if OPT_1851 default "2" if OPT_2852 853 #--- End Optimizations854 855 766 config REPORT 856 767 bool "Create SBU and disk usage report" … … 858 769 859 770 config SAVE_CH5 860 bool "Save temporary systemwork"771 bool "Save Chapter 5 work" 861 772 depends on BOOK_LFS || BOOK_LFS_SYSD 862 773 default n 863 774 help 864 Save the state of jhalfs after finishing building the temporary 865 system 775 Save the state of jhalfs at the end of chapter 5: 866 776 867 777 if you tick this item, the whole $LFS directory is 868 saved when chapter 7 is finished. It'll be in a .tar869 file in the $BUILD_DIR/jhalfs directory778 saved when chapter 5 is finished. It'll be in an xz 779 compressed tarball in the $LFS/jhalfs directory 870 780 871 781 #--- ICA … … 899 809 900 810 #--- End ICA 811 812 #--- Optimizations 813 config CONFIG_OPTIMIZE 814 bool "Optimization and parallelization" 815 default n 816 help 817 # Opens a menu for various optimization settings: 818 # Actual optimization flags MUST be defined in ./optimize/* 819 # before activating this option. 820 # 821 # WARNING: The use of build optimizations may lead to build issues. 822 # If the system doesn't work as expected, please rebuild 823 # without optimizations before asking for support. 824 menu "Parallelization and Optimization settings" 825 depends on CONFIG_OPTIMIZE 826 827 config N_PARALLEL 828 int "Number of parallel `make' jobs" 829 default 1 830 help 831 #-- The usual recommandation is (number of CPU cores)+1 832 # Do not set for meaningful SBU calculations. 833 834 choice 835 prompt "Optimization level" 836 default OPT_1 837 help 838 #-- Optimization values are set in optimize/* files 839 840 config OPT_1 841 bool "Final system only" 842 843 config OPT_2 844 bool "Both temp tools and final system" 845 846 endchoice 847 848 config REALSBU 849 bool "Build Binutls pass1 without optimization (Real SBU)" 850 depends on OPT_2 851 default n 852 help 853 #-- Use -j1 in make invokation for Binutils pass1 to 854 # get a valid SBU value. 855 856 endmenu # Optimization settings 857 config OPTIMIZE 858 int 859 default "0" if !CONFIG_OPTIMIZE 860 default "1" if OPT_1 861 default "2" if OPT_2 862 863 #--- End Optimizations 901 864 902 865 #-- Internal Settings -
LFS/lfs.xsl
rca368ad r0f7a988 28 28 --> 29 29 <xsl:param name="testsuite" select="1"/> 30 31 <!-- Parallelism (LFS >= 12.1) -->32 <xsl:param name="jobs" select="1"/>33 34 <!-- value of jobs for binutils-pass1 -->35 <xsl:param name="jobs-bp1" select="1"/>36 30 37 31 <!-- Install non wide character ncurses 5? --> … … 624 618 <xsl:value-of select="$hostname"/> 625 619 </xsl:when> 626 <xsl:when test="contains(string(.),'$(nproc)')">627 <xsl:value-of select="$jobs"/>628 </xsl:when>629 620 <xsl:otherwise> 630 621 <xsl:text>**EDITME</xsl:text> … … 1253 1244 </xsl:text> 1254 1245 </xsl:if> 1255 <xsl:text>1256 export MAKEFLAGS="-j</xsl:text>1257 <xsl:choose>1258 <xsl:when test="@id='ch-tools-binutils-pass1'">1259 <xsl:value-of select="$jobs-bp1"/>1260 </xsl:when>1261 <xsl:otherwise>1262 <xsl:value-of select="$jobs"/>1263 </xsl:otherwise>1264 </xsl:choose>1265 <xsl:text>"1266 </xsl:text>1267 1246 <xsl:text>SECONDS=${PREV_SEC} 1268 1247 -
LFS/master.sh
rca368ad r0f7a988 128 128 # If using optimizations, write the instructions 129 129 case "${OPTIMIZE}$1${nb_chaps}${this_script}${REALSBU}" in 130 0* | *binutils-pass1y | 15* | 167* | 177*) ;; 131 *kernel*) ;; # No CFLAGS for kernel 132 *) wrt_optimize "$name" ;; 130 0* | *binutils-pass1y | 15* | 167* | 177*) 131 wrt_makeflags "$name" "-j1" "1" ;; 132 *kernel*) # No CFLAGS for kernel 133 wrt_makeflags "$name" "$JH_MAKEFLAGS" "$N_PARALLEL" ;; 134 *) wrt_optimize "$name" && 135 wrt_makeflags "$name" "$JH_MAKEFLAGS" "$N_PARALLEL" ;; 133 136 esac 134 # There is no need to tweak MAKEFLAGS anymore, this is done 135 # by lfs.xsl. But still, NINJAJOBS needs to be set if 136 # N_PARALLEL is defined. 137 if [ -n "N_PARALLEL" ]; then 138 wrt_makeflags "$name" "$JH_MAKEFLAGS" "$N_PARALLEL" 139 fi 140 fi # end of package specific instructions 137 fi 141 138 142 139 # Some scriptlet have a special treatment; otherwise standard … … 290 287 done 291 288 292 # If CPUSET is defined and not equal to "all", then we define a first target293 # that calls a script which re-enters make calling target all294 if [ -n "$CPUSET" ] && [ "$CPUSET" != all ]; then295 (296 cat << EOF297 298 all-with-cpuset:299 @CPUSPEC="\$(CPUSET)" ./run-in-cgroup.sh \$(MAKE) all300 EOF301 ) >> $MKFILE302 fi303 289 # Drop in the main target 'all:' and the chapter targets with each sub-target 304 290 # as a dependency. Also prevent running targets in parallel. -
README
rca368ad r0f7a988 1 1 1. INTRODUCTION:: 2 2 3 The scripts in this directory implement an automation of the building 4 of a GNU/LInux system, as described in the Linux From Scratch book series. 5 The name of the project is jhalfs: in that name, "alfs" stands for 6 "automated linux from scratch", and the initials "jh" have been kept since 7 the original "jhalfs-0.2" code developed by Jeremy Huntwork. 8 9 The list of supported books can be found at 10 http://wiki.linuxfromscratch.org/alfs/wiki/SupportedBooks (maybe outdated, 11 current develoment books and latest version are always supported). 12 13 The documentation is split among various README.* files. Here is a list 14 of what is in which: 15 - README (this file): instructions to use the LFS book. This should be 16 enough if you just want to build a base system as per the LFS book. It 17 is also a required reading for all the other projects. 18 - README.BLFS: instructions to install an automated build infrastructure 19 for the BLFS book. There are two ways to do so: (i) install the 20 tools at the end of an LFS build, or 21 (ii) install the tools on an already running system. Both methods are 22 described in that file. 23 - README.CUSTOM: instructions to run custom commands either during the LFS 24 build, or at the end of a LFS build. Note that you will not find 25 instructions on how to write those commands, but some examples are 26 available. 27 - README.PACKAGE_MANAGEMENT: instructions to use package management during 28 the build (Note: the only package manager that is regularly tested is 29 porg) 30 31 Other sources of information are the context help in the menu interface, 32 and the LFS books themselves (both required readings of course!). 3 The scripts in this directory implement an automation of the building 4 of a GNU/LInux system, as described in the Linux From Scratch book series. 5 The name of the project is jhalfs: in that name, "alfs" stands for 6 "automated linux from scratch", and the initials "jh" have been kept since 7 the original "jhalfs-0.2" code developed by Jeremy Huntwork. 8 9 The list of supported books can be found at 10 http://wiki.linuxfromscratch.org/alfs/wiki/SupportedBooks. 11 12 The documentation is split among various README.* files. Here is a list 13 of what is in which: 14 - README (this file): instructions to use the LFS book. This should be 15 enough if you just want to build a base system as per the LFS book. It is 16 also a required reading for all the other projects. 17 - README.BLFS: instructions to install an automated build infrastructure 18 for the BLFS book. There are two ways to do so: (i) install the 19 tools at the end of an LFS build, or 20 (ii) install the tools on an already running system. Both methods are 21 described in that file. 22 - README.CUSTOM: instructions to run custom commands either during the xLFS 23 build, at the end of a xLFS build. Note that you will not find 24 instructions on how to write those commands, but some examples are 25 available. 26 - README.PACKAGE_MANAGEMENT: instructions to use package management during 27 the build 28 29 Other sources of information are the context help in the menu interface, 30 and the xLFS books themselves. 33 31 34 32 2. PREREQUISITES:: 35 33 36 It is strongly advised that you first build manually a complete system 37 before attempting to automate the build. 38 39 Of course the "Host System Requirements" should be fulfilled. Some 40 supplementary packages are needed for using jhalfs. They are detailed 41 at the bottom of the page: 42 https://www.linuxfromscratch.org/alfs/download.html. In short, you need 43 wget, sudo, libxml2, libxslt, docbook-4.5-xml, and docbook-xsl-nons. 34 As said elsewhere, it is strongly advised that you first build manually 35 a complete system before attempting to automate the build. 36 37 Of course the "Host System Requirements" should be fulfilled. The needed 38 supplementary packages are detailed at the bottom of the page: 39 https://www.linuxfromscratch.org/alfs/download.html. In short, you need 40 wget, sudo, libxml2, libxslt, docbook-4.5-xml, and docbook-xsl-nons. 44 41 45 42 3. INSTALLATION:: 46 43 47 48 44 No installation is required. You may want to move the files in this 45 directory to a convenient location, and then follow the instructions below. 49 46 50 47 4. CONFIGURATION:: 51 48 52 4.1. CONFIGURATION OF THE TOOLS: 53 There is no configuration of the tools themselves. The various 54 parameters for the build are set through a menu driven interface. See 55 the section RUNNING below for details. 56 57 4.2. PRELIMINARY TASKS: 58 This tool has no support at all for creating a partition and a mount 59 point for the built system. You should follow the book up to the section 60 "Mounting the new partition". Note that the default name for the 61 partition mount point is "/mnt/build_dir", instead of /mnt/lfs. 62 You can change that default to anything you'd like in the menu, so you 63 may name it /mnt/lfs if you prefer . We'll use the name /mnt/build_dir 64 in the sequel. 65 66 For downloading packages, you can use the tool or download them 67 yourself. Even if using the tool, it is recommended to set up a source 68 repository where you store already downloaded packages. The tool will 69 automatically search a package in this repository before downloading it 70 if it is not found there. This repository cannot be the same as 71 /mnt/build_dir/sources. As an example, we'll use /usr/src. You should 72 arrange for the user running the tool to have write access to this 73 directory. 74 75 If you want to build the kernel as part of the automated build, 76 a configuration file must be provided. In order to do so, it is 77 recommended to download the kernel tarball, unpack it, run 78 <make menuconfig> (or any other *config), configure the kernel as per 79 the book, and save the resulting .config file to a location where it can 80 be retrieved later on. It is suggested to put it into the source 81 repository, with a versioned name, e.g. 82 /usr/src/config-<arch>-<kernel version>-<config details>. 83 84 Another file you may provide is the fstab file. As for the kernel 85 configuration, this file has to be prepared before running the menu. 86 You can copy-paste the file from the "Creating the /etc/fstab File" 87 page, then edit to suit the future lfs system layout, then save the 88 file. A convenient location and name is /usr/src/fstablfs. 89 90 At a more advanced level, you may want to supply custom commands 91 to be run at the end of LFS build. Scripts containing those commands 92 are located in the ./custom/config directory. Examples are given in 93 ./custom/examples. A template is provided as ./custom/template. See 94 README.CUSTOM for more details. 49 4.1. CONFIGURATION OF THE TOOLS: 50 There is no configuration of the tools themselves. The various 51 parameters for the build are set through a menu driven interface. See 52 the section RUNNING below for details. 53 54 4.2. PRELIMINARY TASKS: 55 This tool has no support at all for creating a partition and a mount 56 point for the built system. You should follow the book up to the section 57 "Mounting the new partition". Note that the default name for the 58 partition mount point is "/mnt/build_dir", instead of /mnt/{c,}lfs. 59 You can change that default to anything you'd like in the menu, so you 60 may name it /mnt/lfs, or whatever you like. We'll use the name 61 /mnt/build_dir in the sequel. 62 63 The tool can download the needed packages for you, or you may download 64 them yourself. The tool may optionally use a package archive directory 65 where the downloaded packages are stored. That directory name may be made 66 available to the tool in two ways: (i) export the SRC_ARCHIVE variable, 67 for example SRC_ARCHIVE=/usr/src, (ii) enter the name at the "Package 68 Archive Directory" menu prompt. Note that the user should have write 69 permission to that directory. If a needed package is found in that 70 directory, it is copied to /mnt/build_dir/sources, if not, it is 71 downloaded to that directory and copied to /mnt/build_dir/sources, 72 except if found in /mnt/build_dir/sources, in which case, it is just 73 copied to $SRC_ARCHIVE. If you want the tool to download packages and you 74 do not want to archive them, just unset SRC_ARCHIVE, and keep the 75 default entry for "Package Archive Directory". If you choose to download 76 the packages by yourself, you should download (or copy) them to 77 /mnt/build_dir/sources directly. 78 79 If you want to build the kernel as part of the automated build, select 80 "Build the kernel" in the menu. Then, a configuration file must be 81 provided. In order to do so, it is recommended to download the kernel 82 tarball, unpack it, run <make menuconfig> (or any other *config), 83 configure the kernel as per 84 the book, and save the resulting .config file to a location where it can 85 be retrieved later on (a convenient location and name is 86 $SRC_ARCHIVE/config-<arch>-<kernel version>-<config details>). 87 88 Another file you may provide is the fstab file. To use it, select 89 "Use a custom fstab file" in the menu interface, and enter the name of 90 the file where asked. As for the kernel configuration, this file has to 91 be prepared before running the menu. A convenient location and name is 92 $SRC_ARCHIVE/fstablfs. 93 94 At a more advanced level, you may want to supply custom commands 95 to be run at the end of (C)LFS build. Scripts containing those commands 96 are located in the ./custom/config directory. Examples are given in 97 ./custom/examples. A template is provided as ./custom/template. See 98 README.CUSTOM for more details. 95 99 96 100 5. RUNNING:: 97 101 98 99 102 IMPORTANT:: 103 You must be logged as a normal user with sudo privileges to run 100 104 the Makefile. Furthermore, you are supposed to have enough privilege 101 105 to become any user. If you are not bothered about security issues, 102 the entry for the user running the tool in /etc/sudoers could be 103 <user> ALL=(ALL) NOPASSWD:ALL 104 105 The command <make> will launch a menu based configuration program, 106 similar to the kernel "menuconfig" configuration tool. 107 108 Help on parameter function is available from the on-line help (type the 109 character `?' after highlighting the parameter). Please do use the help: 110 it may contain additional information not duplicated in this file. 111 112 MENU "BOOK Settings" 113 114 Use BOOK: You have three choices: LFS System V, LFS systemd, BLFS. 115 The BLFS part is described in README.BLFS 116 117 Book version: You have two choices: "Branch" or "Working Copy" 118 Branch will have the tool clone the book's git repository. The 119 choice of the branch (actually any git commit) or of the file 120 location for the working copy is done in the next menu entry. 121 122 Multilib: Four choices: Normal LFS, Multilib with i686 libraries, 123 multilib with x32 libraries, multilib with all libraries. 124 It is recommended to use "Normal LFS" unless you know what you 125 are doing 126 127 Build method: two choices: chroot (as in book), boot 128 Presently, the "boot" method is not implemented, so keep the default. 129 130 Add blfs-tools support (see README.BLFS) 131 This will install the blfs tools onto the newly built system. It 132 is not the same thing as choosing the BLFS book in the menu, which 133 will install the blfs tools on the currently running system. 134 135 Add custom tools support (see README.CUSTOM) 136 137 MENU "General Settings" 138 139 Build Directory: the name of the root of the LFS system 140 This is the equivalent of the LFS variable in the book. Set it 141 to "/mnt/lfs" if you have followed the book for creating the LFS 142 partition and mount point. 143 144 Retrieve source files: Say y to have jhalfs download the packages 145 If you say no, you must download the packages yourself and put 146 them into the /mnt/build_dir/sources directory. Follow book's 147 chapter 3 instructions. 148 If you say yes, you'll be asked several other questions: 149 - Package Archive Directory: Repository of downloaded packages 150 This directory, which is on the host and should be writable 151 by the user running the tool, is for storing downloaded packages. 152 If you keep the default "$SRC_ARCHIVE", you can set this variable 153 to the absolute path of the repository and export it. Or if the 154 variable is not set, jhalfs downloads the sources directly to 155 /mnt/build_dir/sources. 156 Instead of using the SRC_ARCHIVE envar, you can also enter the 157 path of the repository directory into this field. 158 - Retry on 'connection refused' failure: self explanatory 159 - Number of retry attempts on download failures: self explanatory 160 - Download timeout (in seconds): self explanatory 161 162 Run the makefile: start the build immediately after running the tool 163 This is not the preferred method: it is recommended to rather 164 run "make -C /mnt/build_dir/jhalfs" after the tool has finished 165 setting up the build. But this may be handy if you are sure everything 166 is well, and want to leave the tool and the build run without 167 supervision. 168 169 Rebuild files: clean up the /mnt/build_dir directory 170 Say n if you want to rerun the tool (to update generated scripts 171 for example) without removing what has already been done. Otherwise, 172 say y. Note that there are some guards against removing a directory 173 containing useful things, but double check that the /mnt/build_dir 174 directory is really what you want to erase. 175 176 MENU "Build Settings" 177 178 MENU Parallelism settings 179 - Use all cores: 180 If you say y, MAKEFLAGS will be set to "-j$(nproc)" at the 181 beginning of each script. Other envars are supposed to be passed 182 from the environment, as done in new books. Note that for old books, 183 this means the scripts using make or ninja will be run with all 184 cores, but not when this needs to set special envars like 185 TESTSUITEFLAGS. You can still define the number of cores used 186 in next field. 187 If you say n, you'll be asked for a static number of threads 188 to use. 189 - set of cpus to use, or 'all' for all cpus (only if using all cores): 190 You can define here the cores you want to use. See help for 191 details. This is the preferred way of reducing the number of cores 192 rather than using a static thread number. 193 - Number of parallel `make' jobs (only if not using all cores): 194 Every occurrence of $(nproc) in new books will be replaced with 195 the number entered here. Also MAKEFLAGS will be set to "-jN" (where 196 N is the number entered) at the beginning of each scripts. Furthermore 197 NINJAJOBS will be set to N in the environment. This allows to run all 198 books with N threads, except for paarts that need other envars to be 199 set 200 - Build Binutils pass1 without parallelism (Real SBU) 201 The standard SBU is defined as the time to run the binutils-pass1 202 build with only one thread. Saying y here allows to get a value for 203 it. If you say n, the value is not meaningful for SBU measurements. 204 205 Run testsuites: say y to run the test suites 206 You'll have the choice between running all the test suites, or only 207 those deemed critical (binutils, gmp, mpfr, mpc, and gcc). 208 209 Package management: see README.PACKAGE_MANAGEMENT 210 211 Create a log of installed files for each package: self explanatory 212 213 Strip Installed Binaries/Libraries: use the book instructions for 214 stripping 215 216 DO NOT use/display progress_bar (self explanatory) 217 218 MENU System configuration 219 220 Use a custom fstab file: 221 If you say y, you'll have to provide a file containing the fstab 222 for the LFS system. See above "preliminary tasks". 223 224 Build the kernel: 225 If you say y, you'll be asked for a file containing the kernel 226 configuration. See above "preliminary tasks". 227 228 Install non-wide-character ncurses (rarely used nowadays): 229 If you say y, the system will use instructions in the note on the 230 ncurses page to install those libraries. 231 232 TimeZone: set to the result of "tzselect" 233 234 Language: set to the result of the instructions on "The Bash Shell 235 Startup Files" page. 236 237 Install the full set of locales: installs all the locales known to 238 glibc. 239 240 Groff page size: choice between "A4" and "Letter". 241 242 Hostname: self explanatory 243 244 Network configuration: various fields for setting network. Look at 245 chapter 9 for background. 246 247 Console configuration: various fields for setting console, as described 248 in chapter 9. 249 250 MENU Advanced features: 251 252 Optimization: Optimization settings are done by editing files in the 253 "optimize" directory. The menu just allows you to choose between applying 254 optimizations only to the final chapter or to all the book. Say n for 255 a normal build 256 257 Create SBU and disk usage report: self explanatory 258 259 Save temporary system work: self explanatory (see help) 260 261 Run comparison analysis on final stage: build the system several times 262 using the preceding one, to test whether it is able to rebuild itself 263 identically. Don't use normally... 264 265 Internal Settings (WARNING: for jhalfs developers only): says it all 106 the entry for the user "jhalfs_user" in /etc/sudoers could be 107 jhalfs_user ALL=(ALL) NOPASSWD:ALL 108 109 The command <make> will launch a menu based configuration program. The 110 underlying menu code was borrowed from BusyBox and slightly modified for 111 our use. 112 113 Help on parameter function is available from the on-line help. Please 114 make use of that feature: it may contain additional information not 115 duplicated in this file. 116 117 You should first choose which book and flavour you want to build. Note 118 that when you choose the BLFS book, the tool will just install the BLFS 119 tool to your system. You'll have to run that installed tool to build 120 packages in BLFS. See README.BLFS to know how. If you choose any other 121 book, you'll have to configure the settings and the build parameters 122 from the menu. Note that you may choose to install the blfs tools onto 123 the newly built system. It is not the same thing as choosing 124 the BLFS book in the menu, which will install the blfs tools on the 125 currently running system. 126 127 The "General Settings" menu is where the "Build Directory" name is to be 128 entered. Other entries in that menu select what the tool should do. The 129 "Run the Makefile" entry selects whether the tool will start the build 130 automatically after generating the needed files. The "Rebuild files" selects 131 whether to clean the build directory before doing anything else. To protect 132 against removing important files, this can only be done in an empty directory, 133 or a directory previously populated by the tool. 134 135 The "Build Settings" menu is where various options for the build can be 136 selected. Two options, "Use a custom fstab file" and "Build the kernel", 137 have been described above. "Do not use/display progress_bar", if set, will 138 prevent a progress bar to be displayed during the build. That may be useful 139 on slow machine. The other options should be self explanatory, using either 140 the online help or book reading. 141 142 The "Advanced Features" menu is for various maintenance tasks, like 143 testing the build instructions or reporting build statistics. One useful 144 option is "Optimization and parallelisation". It is not recommended to use 145 it for setting compiler optimization flags, although it is possible, but 146 if you select it, you'll be able to select the number of parallel `make' 147 jobs, which allows much faster builds on modern multicore CPUs. 266 148 267 149 Once you have set the parameters and saved the configuration, the script … … 394 276 machine. 395 277 278 Q. "What is the function of "User account" and "Group account" menu 279 settings?" 280 A. If you are running jhalfs from a low or non-privileged account you may 281 not have the priv to create/delete the user needed to build temporary 282 tools. 283 These settings allow you to use your own user and group name to do those 284 build steps. 285 286 These variables are adjustable also when invoking make: 287 288 cd $BUILDDIR; make LUSER=myaccount LGROUP=mygroup 289 290 The only changes to your account will be the creation of a NEW .bashrc 291 after saving your original to .bashrc.XXX 292 396 293 Q. "How could I stop the build at a predefined chosen point?" 397 294 A. Launch the Makefile manually passing the last numbered target to be build -
common/chroot.xsl
rca368ad r0f7a988 6 6 extension-element-prefixes="exsl" 7 7 version="1.0"> 8 9 <xsl:param name="jobs_2" select="1"/>10 8 11 9 <xsl:template match="/"> … … 58 56 <xsl:param name="instructions" select="''"/> 59 57 <xsl:choose> 60 <xsl:when test="contains($instructions, '$(nproc || echo 1)')">61 <xsl:call-template name="extract-chroot">62 <xsl:with-param63 name="instructions"64 select="concat(substring-before($instructions, '$(nproc || echo 1)'), $jobs_2, substring-after($instructions, '$(nproc || echo 1)'))"/>65 </xsl:call-template>66 </xsl:when>67 58 <xsl:when test="not(starts-with($instructions,'
chroot')) and 68 59 contains($instructions, '
chroot')"> -
common/libs/func_book_parser
rca368ad r0f7a988 64 64 popd > /dev/null 65 65 66 if [ "$ALL_CORES" = "y" ]; then67 JOBS="\$(nproc)"68 else69 JOBS="$N_PARALLEL"70 fi71 if [ "$REALSBU" = y ]; then JOBSBP1=1; else JOBSBP1="$JOBS"; fi72 73 66 # First profile the book, for revision and arch. Note that 74 67 # MULTIBLIB is set to "default" if pure 64 bit book. In this case, … … 110 103 --stringparam log-level "$LOG_LEVEL" \ 111 104 --stringparam script-root "$SCRIPT_ROOT" \ 112 --stringparam jobs "$JOBS" \113 --stringparam jobs-bp1 "$JOBSBP1" \114 105 --output "./${COMMANDS}/" \ 115 106 $XSL \ … … 151 142 echo -n "... " 152 143 xsltproc --nonet --xinclude \ 153 --stringparam jobs_2 "$JOBS_2" \ 154 -o chroot-scripts/ chroot.xsl \ 144 -o chroot-scripts/ chroot.xsl \ 155 145 $BOOK/chapter0?/*chroot*.xml >> $LOGDIR/$LOG 2>&1 156 146 echo "done" -
common/libs/func_download_pkgs
rca368ad r0f7a988 133 133 echo -n "Creating URLs file... " 134 134 xsltproc --nonet --xinclude \ 135 --stringparam server "$SERVER" \ 136 --stringparam family lfs \ 135 137 --stringparam pkgmngt "$PKGMNGT" \ 136 138 --stringparam revision "$INITSYS" \ -
common/libs/func_install_blfs
rca368ad r0f7a988 137 137 BUILD_ROOT=/sources 138 138 BUILD_SUBDIRS=y 139 JOBS=$(if [ "$ALL_CORES" = y ]; then echo 0; else echo $N_PARALLEL; fi)139 JOBS=$(if [ -n "$N_PARALLEL" ]; then echo $N_PARALLEL; else echo 1; fi) 140 140 EOF 141 # The 0 value above is for using all cores142 141 for OPT_VAR in CFLAGS CXXFLAGS LDFLAGS; do 143 142 eval optVal=\$${OPT_VAR}_$DEF_OPT_MODE … … 181 180 sudo find . -name unpacked -exec rm \{\} \; 182 181 if [ "$GETPKG" = "y" ]; then 182 JH_FTP_SERVER=$SERVER/pub/blfs/ \ 183 183 JH_SRC_ARCHIVE=${SRC_ARCHIVE:-/dev/null} \ 184 184 $BUILDDIR$BLFS_ROOT/download_script … … 219 219 # updating to the end of the process, adding an 'update' target 220 220 sed -i -e '/xsltproc/,+6d' \ 221 -e '/^all/ i update:' \221 -e '/^all/s@$@ update@' \ 222 222 -e 's/touch/@touch/' Makefile 223 223 cat >> Makefile << EOF 224 update: all224 update: 225 225 @echo Updating the tracking file 226 226 @for pack in \$\$(grep '<productname' ../$LFS_XML/tmp/lfs-full.xml | \\ -
common/libs/func_validate_configs.sh
rca368ad r0f7a988 19 19 local -r BOOK_common="COMMIT BOOK CUSTOM_TOOLS" 20 20 local -r GENERAL_common="LUSER LGROUP LHOME BUILDDIR CLEAN GETPKG SRC_ARCHIVE \ 21 RETRYSRCDOWNLOAD RETRYDOWNLOADCNT DOWNLOADTIMEOUT \21 SERVER RETRYSRCDOWNLOAD RETRYDOWNLOADCNT DOWNLOADTIMEOUT \ 22 22 RUNMAKE" 23 23 local -r BUILD_chroot="TEST STRIP" … … 36 36 37 37 # Full list of books settings 38 local -r lfs_PARAM_LIST="$LFS_book $GENERAL_common $LFS_build $LFS_system $ADVANCED_chroot ALL_CORES CPUSETN_PARALLEL REALSBU SAVE_CH5 $ADVANCED_common"38 local -r lfs_PARAM_LIST="$LFS_book $GENERAL_common $LFS_build $LFS_system $ADVANCED_chroot N_PARALLEL REALSBU SAVE_CH5 $ADVANCED_common" 39 39 # local -r blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR" 40 40 … … 130 130 TARGET32) [[ -n "${TARGET32}" ]] && echo -e "`eval echo $PARAM_VALS`" ;; 131 131 MIPS_LEVEL) [[ "${ARCH}" = "mips" ]] && echo -e "`eval echo $PARAM_VALS`" ;; 132 SERVER) [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;; 132 133 RETRYSRCDOWNLOAD) [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;; 133 134 RETRYDOWNLOADCNT) [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;; 134 135 DOWNLOADTIMEOUT) [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;; 135 CPUSET) [[ "$HAVE_CGROUP" = "y" ]] && [[ "$ALL_CORES" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;136 N_PARALLEL) [[ "$ALL_CORES" = "n" ]] && echo -e "`eval echo $PARAM_VALS`" ;;136 N_PARALLEL) [[ "$OPTIMIZE" -gt "0" ]] && echo -e "`eval echo $PARAM_VALS`" ;; 137 REALSBU) [[ "$OPTIMIZE" = "2" ]] && echo -e "`eval echo $PARAM_VALS`" ;; 137 138 138 139 # Envars that requires some validation … … 167 168 168 169 # Treatment of LANG parameter 169 LANG ) # See i fthe locale value has been set170 LANG ) # See it the locale value has been set 170 171 echo -n "`eval echo $PARAM_VALS`" 171 172 [[ -z "${!config_param}" ]] && -
common/libs/func_wrt_Makefile
rca368ad r0f7a988 45 45 PKGMNGT = $PKGMNGT 46 46 WRAP_INSTALL = $WRAP_INSTALL 47 CPUSET = $CPUSET48 47 49 48 -
common/urls.xsl
rca368ad r0f7a988 5 5 6 6 <xsl:output method="text"/> 7 8 <!-- The FTP server used as fallback --> 9 <xsl:param name="server">ftp://ftp.osuosl.org</xsl:param> 7 10 8 11 <!-- Do we use a package manager? --> -
jhalfs
rca368ad r0f7a988 176 176 UNICODE=${UNICODE:=n} 177 177 LOCAL=${LOCAL:=n} 178 ALL_CORES=${ALL_CORES:=n}179 178 REALSBU=${REALSBU:=n} 180 179 SAVE_CH5=${SAVE_CH5:=n} … … 289 288 # optimize configurations 290 289 load_file optimize/opt_config 'Loading optimization config' 290 # The number of parallel jobs is taken from configuration now 291 # shellcheck disable=SC2034 292 JH_MAKEFLAGS="-j${N_PARALLEL}" 291 293 # Validate optimize settings, if required 292 294 validate_opt_settings 293 fi294 # Parallelization is outside optimization, because it is now in the book295 if [[ "$ALL_CORES" = "n" ]]; then296 # shellcheck disable=SC2034297 JH_MAKEFLAGS="-j${N_PARALLEL}"298 295 fi 299 296 # … … 324 321 325 322 # Copy common helper files 326 cp "$COMMON_DIR"/{makefile-functions,progress_bar.sh ,run-in-cgroup.sh} "$JHALFSDIR/"323 cp "$COMMON_DIR"/{makefile-functions,progress_bar.sh} "$JHALFSDIR/" 327 324 328 325 # Copy needed stylesheets -
optimize/optimize_functions
rca368ad r0f7a988 17 17 echo -e "asking for support.${OFF}\n" 18 18 19 # [ -n "$JH_MAKEFLAGS" ] && \ 20 # echo -e "BLACK_LIST: ${L_arrow}${BOLD}${BLACK_LIST}${OFF}${R_arrow}\n" 19 echo -e "MAKEFLAGS: ${L_arrow}${BOLD}${JH_MAKEFLAGS}${OFF}${R_arrow}" 20 [ -n "$JH_MAKEFLAGS" ] && \ 21 echo -e "BLACK_LIST: ${L_arrow}${BOLD}${BLACK_LIST}${OFF}${R_arrow}\n" 21 22 22 23 echo -e "DEF_OPT_MODE: ${L_arrow}${BOLD}${DEF_OPT_MODE}${OFF}${R_arrow}\n"
Note:
See TracChangeset
for help on using the changeset viewer.