Changes in / [0f7a988:ca368ad]


Ignore:
Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • BLFS/xsl/scripts.xsl

    r0f7a988 rca368ad  
    306306      </xsl:when><!-- @role="package" -->
    307307
    308       <xsl:when test="@role = 'qt4-prefix' or @role = 'qt5-prefix'">
     308      <xsl:when test="@role = 'qt5-prefix' or @role = 'qt6-prefix'">
    309309        <xsl:apply-templates select=".//screen[./userinput]"/>
    310310      </xsl:when>
     
    458458      </xsl:call-template>
    459459    </xsl:variable>
    460     <xsl:variable name="first_letter"
    461                   select="translate(substring($package,1,1),
    462                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
    463                                     'abcdefghijklmnopqrstuvwxyz')"/>
    464460    <xsl:text>&#xA;</xsl:text>
    465461    <xsl:value-of select="$varname"/>
     
    477473    <xsl:value-of select="$varname"/>
    478474    <xsl:text>"
    479   else&#xA;</xsl:text>
    480     <!-- Download from upstream http -->
    481     <xsl:if test="string-length($httpurl) &gt; 10">
    482       <xsl:text>    wget -T 30 -t 5 "</xsl:text>
    483       <xsl:value-of select="$httpurl"/>
    484       <xsl:text>" ||&#xA;</xsl:text>
    485     </xsl:if>
    486     <!-- Download from upstream ftp -->
    487     <xsl:if test="string-length($ftpurl) &gt; 10">
    488       <xsl:text>    wget -T 30 -t 5 "</xsl:text>
    489       <xsl:value-of select="$ftpurl"/>
    490       <xsl:text>" ||&#xA;</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"/>
     475  else<!-- Download from upstream http -->
     476    wget -T 30 -t 5 "</xsl:text>
     477    <xsl:value-of select="$httpurl"/>
    497478    <xsl:text>"
    498479  fi
  • Config.in

    r0f7a988 rca368ad  
     1# Check for "nproc" presence:
     2config HAVE_NPROC
     3    def_bool $(shell,if nproc &>/dev/null; then echo y; else echo n; fi)
     4
     5# Check for "cpuset controller in cgroup v2" presence:
     6config HAVE_CGROUP
     7    def_bool $(shell,if grep -q cpuset /sys/fs/cgroup/cgroup.controllers 2>/dev/null; then echo y; else echo n; fi)
     8
    19menu "BOOK Settings"
    210
     
    422430            #   timing out.
    423431
    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 
    434432    config    RUNMAKE
    435433        bool    "Run the makefile"
     
    451449menu "Build Settings"
    452450depends on !BOOK_BLFS
     451
     452    #--- Parallelism
     453    menu "Parallelism settings"
     454    if HAVE_NPROC
     455        config ALL_CORES
     456        bool "Use all cores"
     457        default y
     458        help
     459              If you answer y, MAKEFLAGS will be set to "-j$(nproc)" at the
     460              beginning of each package script, and book instructions will not
     461              be changed otherwise. This will run the scripts with the same
     462              settings as in the book since version r12.0-87 included. Before
     463              that version, this will run the builds with all cores, but some
     464              test suites may still be run sequentially. You'll be asked for
     465              a CPU set to use, so that the number of jobs can still be limited
     466              in this way (useful for measuring SBU values at -j4, for
     467              example).
     468              If you answer n, then jhalfs will fall back to a static number
     469              of cores, defined below.
     470
     471        if ALL_CORES && HAVE_CGROUP
     472            config CPUSET
     473            string "set of cpus to use, or 'all' for all cpus"
     474            default "all"
     475            help
     476                 See "List format" in cpuset(7). Choosing cpus depend
     477                 on the topology of your processors. Sometimes two
     478                 hyperthreads on the same core are numbered consecutively.
     479                 For example for using all cores and no hyperthreading on
     480                 a Haswell, use "0,2,4,6". Other brands may have a different
     481                 topology, and may require e.g. "0-3" to use the first 4 cores.
     482                 If not sure, keep the default.
     483        endif
     484
     485    endif # HAVE_NPROC
     486    if !HAVE_NPROC
     487        config ALL_CORES
     488        bool
     489        default n
     490    endif
     491
     492    config    N_PARALLEL
     493        int "Number of parallel `make' jobs"
     494        depends on !ALL_CORES
     495        default 1
     496        help
     497            #-- The usual recommandation is (number of CPU cores)+1
     498            #   Do not set for meaningful SBU calculations.
     499
     500    config    REALSBU
     501        bool    "Build Binutils pass1 without parallelism (Real SBU)"
     502        default    n
     503        help
     504           #-- Use -j1 in make invokation for Binutils pass1 to
     505           #   get a valid SBU value.
     506    endmenu # parallelism
    453507
    454508    #--- Test Suites
     
    468522            #  do not stop on test suite failures.
    469523
    470     menu "Test settings"
    471     depends on    CONFIG_TESTS
    472524    choice
     525        depends on    CONFIG_TESTS
    473526        prompt    "Tests level"
    474527        default    TST_1
     
    490543
    491544    endchoice
    492 
    493     endmenu # test settings
    494545
    495546    config    TEST
     
    764815depends on !BOOK_BLFS
    765816
     817    #--- Optimizations
     818    config    CONFIG_OPTIMIZE
     819        bool    "Optimization"
     820        default    n
     821        help
     822            #   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 rebuild
     828            #   without optimizations before asking for support.
     829    menu    "Optimization settings"
     830        depends on CONFIG_OPTIMIZE
     831
     832    choice
     833        prompt "Optimization level"
     834        default OPT_1
     835        help
     836            #-- Optimization values are set in optimize/* files
     837
     838        config    OPT_1
     839            bool    "Final system only"
     840
     841        config    OPT_2
     842            bool    "Both temp tools and final system"
     843
     844    endchoice
     845
     846    endmenu # Optimization settings
     847    config    OPTIMIZE
     848        int
     849        default    "0"    if !CONFIG_OPTIMIZE
     850        default    "1"    if OPT_1
     851        default    "2"    if OPT_2
     852
     853    #--- End Optimizations
     854
    766855    config    REPORT
    767856        bool "Create SBU and disk usage report"
     
    769858
    770859    config    SAVE_CH5
    771         bool "Save Chapter 5 work"
     860        bool "Save temporary system work"
    772861        depends on BOOK_LFS || BOOK_LFS_SYSD
    773862        default n
    774863        help
    775             Save the state of jhalfs at the end of chapter 5:
     864            Save the state of jhalfs after finishing building the temporary
     865            system
    776866           
    777867            if you tick this item, the whole $LFS directory is
    778             saved when chapter 5 is finished. It'll be in an xz
    779             compressed tarball in the $LFS/jhalfs directory
     868            saved when chapter 7 is finished. It'll be in a .tar
     869            file in the $BUILD_DIR/jhalfs directory
    780870
    781871    #--- ICA
     
    809899
    810900    #--- 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
    864901
    865902    #-- Internal Settings
  • LFS/lfs.xsl

    r0f7a988 rca368ad  
    2828  -->
    2929  <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"/>
    3036
    3137  <!-- Install non wide character ncurses 5? -->
     
    618624        <xsl:value-of select="$hostname"/>
    619625      </xsl:when>
     626      <xsl:when test="contains(string(.),'$(nproc)')">
     627        <xsl:value-of select="$jobs"/>
     628      </xsl:when>
    620629      <xsl:otherwise>
    621630        <xsl:text>**EDITME</xsl:text>
     
    12441253</xsl:text>
    12451254    </xsl:if>
     1255    <xsl:text>
     1256export 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>
    12461267    <xsl:text>SECONDS=${PREV_SEC}
    12471268
  • LFS/master.sh

    r0f7a988 rca368ad  
    128128      # If using optimizations, write the instructions
    129129      case "${OPTIMIZE}$1${nb_chaps}${this_script}${REALSBU}" in
    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" ;;
     130          0* | *binutils-pass1y | 15* | 167* | 177*) ;;
     131          *kernel*) ;; # No CFLAGS for kernel
     132          *)  wrt_optimize "$name" ;;
    136133      esac
    137     fi
     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
    138141
    139142# Some scriptlet have a special treatment; otherwise standard
     
    287290  done
    288291
     292  # If CPUSET is defined and not equal to "all", then we define a first target
     293  # that calls a script which re-enters make calling target all
     294  if [ -n "$CPUSET" ] && [ "$CPUSET" != all ]; then
     295(
     296    cat << EOF
     297
     298all-with-cpuset:
     299        @CPUSPEC="\$(CPUSET)" ./run-in-cgroup.sh \$(MAKE) all
     300EOF
     301) >> $MKFILE
     302  fi
    289303  # Drop in the main target 'all:' and the chapter targets with each sub-target
    290304  # as a dependency. Also prevent running targets in parallel.
  • README

    r0f7a988 rca368ad  
    111. INTRODUCTION::
    22
    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.
     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!).
    3133
    32342. PREREQUISITES::
    3335
    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.
     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.
    4144
    42453. INSTALLATION::
    4346
    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.
     47      No installation is required. You may want to move the files in this
     48   directory to a convenient location, and then follow the instructions below.
    4649
    47504. CONFIGURATION::
    4851
    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.
     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.
    9995
    100965. RUNNING::
    10197
    102   IMPORTANT::
    103       You must be logged as a normal user with sudo privileges to run
     98   IMPORTANT::
     99         You must be logged as a normal user with sudo privileges to run
    104100      the Makefile. Furthermore, you are supposed to have enough privilege
    105101      to become any user. If you are not bothered about security issues,
    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.
     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
    148266
    149267     Once you have set the parameters and saved the configuration, the script
     
    276394       machine.
    277395
    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 
    293396    Q. "How could I stop the build at a predefined chosen point?"
    294397    A. Launch the Makefile manually passing the last numbered target to be build
  • common/chroot.xsl

    r0f7a988 rca368ad  
    66      extension-element-prefixes="exsl"
    77      version="1.0">
     8
     9  <xsl:param name="jobs_2" select="1"/>
    810
    911  <xsl:template match="/">
     
    5658    <xsl:param name="instructions" select="''"/>
    5759    <xsl:choose>
     60      <xsl:when test="contains($instructions, '$(nproc || echo 1)')">
     61        <xsl:call-template name="extract-chroot">
     62          <xsl:with-param
     63            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>
    5867      <xsl:when test="not(starts-with($instructions,'&#xA;chroot')) and
    5968                      contains($instructions, '&#xA;chroot')">
  • common/libs/func_book_parser

    r0f7a988 rca368ad  
    6464  popd > /dev/null
    6565
     66  if [ "$ALL_CORES" = "y" ]; then
     67          JOBS="\$(nproc)"
     68  else
     69          JOBS="$N_PARALLEL"
     70  fi
     71  if [ "$REALSBU" = y ]; then JOBSBP1=1; else JOBSBP1="$JOBS"; fi
     72
    6673  # First profile the book, for revision and arch. Note that
    6774  # MULTIBLIB is set to "default" if pure 64 bit book. In this case,
     
    103110           --stringparam log-level      "$LOG_LEVEL"    \
    104111           --stringparam script-root    "$SCRIPT_ROOT"  \
     112           --stringparam jobs           "$JOBS"         \
     113           --stringparam jobs-bp1       "$JOBSBP1"      \
    105114           --output "./${COMMANDS}/"                    \
    106115           $XSL                                         \
     
    142151  echo -n "... "
    143152  xsltproc --nonet --xinclude \
    144            -o chroot-scripts/ chroot.xsl \
     153           --stringparam jobs_2 "$JOBS_2" \
     154           -o chroot-scripts/ chroot.xsl  \
    145155           $BOOK/chapter0?/*chroot*.xml >> $LOGDIR/$LOG 2>&1
    146156  echo "done"
  • common/libs/func_download_pkgs

    r0f7a988 rca368ad  
    133133  echo -n "Creating URLs file... "
    134134  xsltproc --nonet --xinclude                \
    135            --stringparam server "$SERVER"    \
    136            --stringparam family lfs          \
    137135           --stringparam pkgmngt "$PKGMNGT"  \
    138136           --stringparam revision "$INITSYS" \
  • common/libs/func_install_blfs

    r0f7a988 rca368ad  
    137137BUILD_ROOT=/sources
    138138BUILD_SUBDIRS=y
    139 JOBS=$(if [ -n "$N_PARALLEL" ]; then echo $N_PARALLEL; else echo 1; fi)
     139JOBS=$(if [ "$ALL_CORES" = y ]; then echo 0; else echo $N_PARALLEL; fi)
    140140EOF
     141# The 0 value above is for using all cores
    141142for OPT_VAR in CFLAGS CXXFLAGS LDFLAGS; do
    142143  eval optVal=\$${OPT_VAR}_$DEF_OPT_MODE
     
    180181sudo find . -name unpacked -exec rm \{\} \;
    181182if [ "$GETPKG" = "y" ]; then
    182     JH_FTP_SERVER=$SERVER/pub/blfs/ \
    183183    JH_SRC_ARCHIVE=${SRC_ARCHIVE:-/dev/null}     \
    184184    $BUILDDIR$BLFS_ROOT/download_script
     
    219219# updating to the end of the process, adding an 'update' target
    220220sed -i -e '/xsltproc/,+6d' \
    221        -e '/^all/s@$@ update@' \
     221       -e '/^all/i update:' \
    222222       -e 's/touch/@touch/' Makefile
    223223cat >> Makefile << EOF
    224 update:
     224update: all
    225225        @echo Updating the tracking file
    226226        @for pack in \$\$(grep '<productname' ../$LFS_XML/tmp/lfs-full.xml | \\
  • common/libs/func_validate_configs.sh

    r0f7a988 rca368ad  
    1919  local -r     BOOK_common="COMMIT BOOK CUSTOM_TOOLS"
    2020  local -r  GENERAL_common="LUSER LGROUP LHOME BUILDDIR CLEAN GETPKG SRC_ARCHIVE \
    21                             SERVER RETRYSRCDOWNLOAD RETRYDOWNLOADCNT DOWNLOADTIMEOUT \
     21                            RETRYSRCDOWNLOAD RETRYDOWNLOADCNT DOWNLOADTIMEOUT \
    2222                            RUNMAKE"
    2323  local -r    BUILD_chroot="TEST STRIP"
     
    3636
    3737  # Full list of books settings
    38   local -r   lfs_PARAM_LIST="$LFS_book   $GENERAL_common $LFS_build $LFS_system  $ADVANCED_chroot N_PARALLEL REALSBU SAVE_CH5 $ADVANCED_common"
     38  local -r   lfs_PARAM_LIST="$LFS_book   $GENERAL_common $LFS_build $LFS_system  $ADVANCED_chroot ALL_CORES CPUSET N_PARALLEL REALSBU SAVE_CH5 $ADVANCED_common"
    3939#  local -r  blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR"
    4040
     
    130130      TARGET32)         [[ -n "${TARGET32}" ]] &&  echo -e "`eval echo $PARAM_VALS`" ;;
    131131      MIPS_LEVEL)       [[ "${ARCH}" = "mips" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    132       SERVER)           [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    133132      RETRYSRCDOWNLOAD) [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    134133      RETRYDOWNLOADCNT) [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    135134      DOWNLOADTIMEOUT)  [[ "$GETPKG" = "y" ]] && 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`" ;;
     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`" ;;
    138137
    139138      # Envars that requires some validation
     
    168167
    169168        # Treatment of LANG parameter
    170       LANG )  # See it the locale value has been set
     169      LANG )  # See if the locale value has been set
    171170               echo -n "`eval echo $PARAM_VALS`"
    172171               [[ -z "${!config_param}" ]] &&
  • common/libs/func_wrt_Makefile

    r0f7a988 rca368ad  
    4545PKGMNGT          = $PKGMNGT
    4646WRAP_INSTALL     = $WRAP_INSTALL
     47CPUSET           = $CPUSET
    4748
    4849
  • common/urls.xsl

    r0f7a988 rca368ad  
    55
    66  <xsl:output method="text"/>
    7 
    8   <!-- The FTP server used as fallback -->
    9   <xsl:param name="server">ftp://ftp.osuosl.org</xsl:param>
    107
    118  <!-- Do we use a package manager? -->
  • jhalfs

    r0f7a988 rca368ad  
    176176UNICODE=${UNICODE:=n}
    177177LOCAL=${LOCAL:=n}
     178ALL_CORES=${ALL_CORES:=n}
    178179REALSBU=${REALSBU:=n}
    179180SAVE_CH5=${SAVE_CH5:=n}
     
    288289  # optimize configurations
    289290  load_file optimize/opt_config 'Loading optimization config'
    290   # The number of parallel jobs is taken from configuration now
     291  # Validate optimize settings, if required
     292  validate_opt_settings
     293fi
     294# Parallelization is outside optimization, because it is now in the book
     295if [[ "$ALL_CORES" = "n" ]]; then
    291296  # shellcheck disable=SC2034
    292297  JH_MAKEFLAGS="-j${N_PARALLEL}"
    293   # Validate optimize settings, if required
    294   validate_opt_settings
    295298fi
    296299#
     
    321324
    322325# Copy common helper files
    323   cp "$COMMON_DIR"/{makefile-functions,progress_bar.sh} "$JHALFSDIR/"
     326  cp "$COMMON_DIR"/{makefile-functions,progress_bar.sh,run-in-cgroup.sh} "$JHALFSDIR/"
    324327
    325328# Copy needed stylesheets
  • optimize/optimize_functions

    r0f7a988 rca368ad  
    1717  echo -e "asking for support.${OFF}\n"
    1818
    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"
     19#  [ -n "$JH_MAKEFLAGS" ] && \
     20#  echo -e "BLACK_LIST: ${L_arrow}${BOLD}${BLACK_LIST}${OFF}${R_arrow}\n"
    2221
    2322  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.