From 2ee1d113d416fe0ba8e9b8c8ec9522b246fd7afc Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Sat, 7 Oct 2006 19:14:47 +0000 Subject: [PATCH] Merged r3147:3173 from trunk. --- BLFS/TODO | 6 +- CLFS/master.sh | 45 +++-- CLFS2/master.sh | 3 - Config.in | 23 ++- HLFS/master.sh | 41 ---- LFS/master.sh | 43 +---- README | 261 +++++++++++++------------- README.BLFS | 109 ++++++----- README.HLFS | 1 - blfs-tool | 2 +- common/blfs-tool-deps/901-libxml2 | 2 +- common/blfs-tool-deps/902-libxslt | 2 +- common/blfs-tool-deps/903-tidy | 6 +- common/blfs-tool-deps/904-unzip | 1 + common/blfs-tool-deps/906-docbook-xsl | 1 + common/blfs-tool-deps/907-gpm | 1 + common/blfs-tool-deps/908-links | 1 + common/blfs-tool-deps/909-sudo | 1 + common/blfs-tool-deps/910-wget | 1 + common/blfs-tool-deps/911-subversion | 1 + common/common-functions | 38 ++-- common/func_check_version.sh | 2 +- common/makefile-functions | 2 +- jhalfs | 25 ++- 24 files changed, 300 insertions(+), 318 deletions(-) diff --git a/BLFS/TODO b/BLFS/TODO index 70aa5f4..1bf7326 100644 --- a/BLFS/TODO +++ b/BLFS/TODO @@ -15,8 +15,4 @@ This is an on-going and never-end task due that, ideally, each commit to the BLFS book should be revised and validated, but our time is limited. --- Bugs hunting. - --- Improve README.BLFS. - --- Develop a script to make cofee. \ No newline at end of file +-- Bugs hunting. \ No newline at end of file diff --git a/CLFS/master.sh b/CLFS/master.sh index 7354432..bebe6e4 100755 --- a/CLFS/master.sh +++ b/CLFS/master.sh @@ -1116,18 +1116,22 @@ set -e $bootscripts_cmds # mk_BOOTSCRIPT (CHROOT) $bootscripttools $bootable_cmds # mk_BOOTABLE (CHROOT) $bootabletools + # Add the BLFS_TOOL targets, if needed + [[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets + # Add a header, some variables and include the function file # to the top of the real Makefile. ( cat << EOF $HEADER -SRC = /sources -MOUNT_PT = $BUILDDIR -PKG_LST = $PKG_LST -LUSER = $LUSER -LGROUP = $LGROUP -SCRIPT_ROOT = $SCRIPT_ROOT +SRC = /sources +MOUNT_PT = $BUILDDIR +PKG_LST = $PKG_LST +LUSER = $LUSER +LGROUP = $LGROUP +SCRIPT_ROOT = $SCRIPT_ROOT +ADD_BLFS_TOOLS = $BLFS_TOOL BASEDIR = \$(MOUNT_PT) SRCSDIR = \$(BASEDIR)/sources @@ -1177,7 +1181,7 @@ if [[ "${METHOD}" = "chroot" ]]; then ( cat << EOF -all: ck_UID mk_SETUP mk_CROSS mk_SUDO mk_SYSTOOLS create-sbu_du-report +all: ck_UID mk_SETUP mk_CROSS mk_SUDO mk_SYSTOOLS create-sbu_du-report mk_BLFS_TOOL @sudo make do-housekeeping @\$(call echo_finished,$VERSION) @@ -1226,12 +1230,19 @@ mk_SYSTOOLS: mk_SUDO @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT_JAIL") @touch \$@ - +mk_BLFS_TOOL: mk_SYSTOOLS + @\$(call echo_PHASE,Building BLFS-TOOLS); \\ + @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\ + sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\ + sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"; \\ + fi + @touch \$@ SETUP: $host_prep AS_LUSER: $cross_tools $temptools SUDO: $orphan_scripts CHROOT_JAIL: ${chroottools}${boottools} $testsuitetools $basicsystem $bootscripttools $bootabletools +BLFS_TOOL: $blfs_tool do-housekeeping: @-umount \$(MOUNT_PT)/dev/pts @@ -1262,6 +1273,7 @@ EOF ) >> $MKFILE else echo -e "\t@true\n" >> $MKFILE; fi + fi ################### BOOT ##################### @@ -1275,7 +1287,7 @@ all: ck_UID mk_SETUP mk_CROSS mk_SUDO @sudo make do-housekeeping @\$(call echo_boot_finished,$VERSION) -makesys: mk_FINAL +makesys: mk_FINAL mk_BLFS_TOOL @\$(call echo_finished,$VERSION) @@ -1305,7 +1317,7 @@ mk_CROSS: mk_SETUP @(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make AS_LUSER" ) @touch \$@ -mk_SUDO: mk_SYSTOOLS +mk_SUDO: mk_CROSS @sudo make SUDO @touch \$@ @@ -1316,10 +1328,19 @@ mk_FINAL: @( make AS_ROOT ) @touch \$@ +mk_BLFS_TOOL: mk_FINAL + @\$(call echo_PHASE,Building BLFS-TOOLS) + @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\ + mkdir -p $TRACKING_DIR; \\ + make BLFS_TOOL; \\ + fi + @touch \$@ + SETUP: $host_prep AS_LUSER: $cross_tools $temptools ${chroottools}${boottools} SUDO: $orphan_scripts AS_ROOT: $testsuitetools $basicsystem $bootscripttools $bootabletools +BLFS_TOOL: $blfs_tool do-housekeeping: @-rm /tools /cross-tools @@ -1335,10 +1356,6 @@ fi ( cat << EOF - -restart: - @echo "This feature does not exist for the CLFS makefile. (yet)" - restore-luser-env: @\$(call echo_message, Building) @if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\ diff --git a/CLFS2/master.sh b/CLFS2/master.sh index 2424643..3e2b328 100755 --- a/CLFS2/master.sh +++ b/CLFS2/master.sh @@ -499,9 +499,6 @@ LUSER: $cross_tools $basicsystem $bootscripttools $bootable ROOT: $chowning -restart: - @echo "This feature does not exist for the CLFS-2 makefile. (yet)" - restore-luser-env: @\$(call echo_message, Building) @if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\ diff --git a/Config.in b/Config.in index 8ca6751..41e9a0c 100644 --- a/Config.in +++ b/Config.in @@ -57,7 +57,7 @@ menu "--- BOOK Settings" #-- A local working copy config BRANCH - bool "Branch or stable book" if !BOOK_HLFS && !BOOK_CLFS2 + bool "Branch or stable book" if !BOOK_CLFS2 help #-- A supported SVN branch or stable released book endchoice @@ -271,7 +271,8 @@ menu "--- BOOK Settings" config BLFS_TOOL bool "Add blfs-tool support" default n - depends on !BOOK_BLFS +# depends on !BOOK_BLFS + depends on BOOK_LFS || BOOK_CLFS help #--- Activating this option additional packages needed to # use blfs-tool will be installed. @@ -285,9 +286,9 @@ menu "--- BOOK Settings" # directory and files owner, before start # using blfs-tool. # - # Also, be sure to create the $TRACKING_DIR directory - # and bring to the build user the right privileges - # over it. + # Also, be sure to bring to that user read and write + # privileges over the $TRACKING_DIR directory and + # the files that it contains. # # And don't forget to configure sudo properly. @@ -489,12 +490,16 @@ menu "--- General Settings" # if possible. config GETKERNEL - bool "Always retrieve kernel package" - default n + bool "Always retrieve kernel package (see help)" + default y if BOOK_LFS && relSVN depends GETPKG help - #-- Get the kernel package and patches even if no configuration - # file has been supplied. + #-- Get the kernel package and patches even if no kernel + # configuration file has been supplied. + + # NOTE: + # The kernel package must be available when building + # the SVN version of LFS to can install the headers files. config RUNMAKE bool "Run the makefile" diff --git a/HLFS/master.sh b/HLFS/master.sh index 657ee17..f74f7ce 100755 --- a/HLFS/master.sh +++ b/HLFS/master.sh @@ -614,8 +614,6 @@ CHROOT: $chapter6 BOOT: $chapter7 -#restart: restart_code all - restore-luser-env: @\$(call echo_message, Building) @if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\ @@ -641,45 +639,6 @@ do-housekeeping: rm -rf /home/\$(LUSER); \\ fi; -restart_code: - @echo ">>> This feature is experimental, BUGS may exist" - - @if [ ! -L /tools ]; then \\ - echo -e "\\nERROR::\\n /tools is NOT a symlink.. /tools must point to \$(MOUNT_PT)/tools\\n" && false;\\ - fi; - - @if [ ! -e /tools ]; then \\ - echo -e "\\nERROR::\\nThe target /tools points to does not exist.\\nVerify the target.. \$(MOUNT_PT)/tools\\n" && false;\\ - fi; - - @if ! stat -c %N /tools | grep "\$(MOUNT_PT)/tools" >/dev/null ; then \\ - echo -e "\\nERROR::\\nThe symlink \\"/tools\\" does not point to \\"\$(MOUNT_PT)/tools\\".\\nCorrect the problem and rerun\\n" && false;\\ - fi; - - @if [ -f ???-kernfs ]; then \\ - mkdir -pv \$(MOUNT_PT)/{proc,sys};\\ - if ! mount -l | "\$(MOUNT_PT)/dev" >/dev/null ; then \\ - mount -vt ramfs ramfs \$(MOUNT_PT)/dev;\\ - fi;\\ - if [ ! -e \$(MOUNT_PT)/dev/console ]; then \\ - mknod -m 600 \$(MOUNT_PT)/dev/console c 5 1;\\ - fi;\\ - if [ ! -e \$(MOUNT_PT)/dev/null ]; then \\ - mknod -m 666 \$(MOUNT_PT)/dev/null c 1 3;\\ - fi;\\ - if ! mount -l | grep "\$(MOUNT_PT)/dev/pts" >/dev/null ; then \\ - mount -vt devpts -o gid=4,mode=620 devpts \$(MOUNT_PT)/dev/pts;\\ - fi;\\ - if ! mount -l | grep "\$(MOUNT_PT)/dev/shm" >/dev/null ; then \\ - mount -vt tmpfs shm \$(MOUNT_PT)/dev/shm;\\ - fi;\\ - if ! mount -l | grep "\$(MOUNT_PT)/proc" >/dev/null ; then \\ - mount -vt proc proc \$(MOUNT_PT)/proc;\\ - fi;\\ - if ! mount -l | grep "\$(MOUNT_PT)/sys" >/dev/null ; then \\ - mount -vt sysfs sysfs \$(MOUNT_PT)/sys;\\ - fi;\\ - fi; EOF diff --git a/LFS/master.sh b/LFS/master.sh index 56dd6e0..db9385e 100755 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -498,8 +498,6 @@ CHROOT: $chapter6 BOOT: $chapter789 -restart: restart_code all - restore-luser-env: @\$(call echo_message, Building) @if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\ @@ -525,45 +523,6 @@ do_housekeeping: rm -rf /home/\$(LUSER); \\ fi; -restart_code: - @echo ">>> This feature is experimental, BUGS may exist" - - @if [ ! -L /tools ]; then \\ - echo -e "\\nERROR::\\n /tools is NOT a symlink.. /tools must point to \$(MOUNT_PT)/tools\\n" && false;\\ - fi; - - @if [ ! -e /tools ]; then \\ - echo -e "\\nERROR::\\nThe target /tools points to does not exist.\\nVerify the target.. \$(MOUNT_PT)/tools\\n" && false;\\ - fi; - - @if ! stat -c %N /tools | grep "\$(MOUNT_PT)/tools" >/dev/null ; then \\ - echo -e "\\nERROR::\\nThe symlink \\"/tools\\" does not point to \\"\$(MOUNT_PT)/tools\\".\\nCorrect the problem and rerun\\n" && false;\\ - fi; - - @if [ -f ???-kernfs ]; then \\ - mkdir -pv \$(MOUNT_PT)/{dev,proc,sys};\\ - if [ ! -e \$(MOUNT_PT)/dev/console ]; then \\ - mknod -m 600 \$(MOUNT_PT)/dev/console c 5 1;\\ - fi;\\ - if [ ! -e \$(MOUNT_PT)/dev/null ]; then \\ - mknod -m 666 \$(MOUNT_PT)/dev/null c 1 3;\\ - fi;\\ - if ! mount -l | grep bind >/dev/null ; then \\ - mount --bind /dev \$(MOUNT_PT)/dev;\\ - fi;\\ - if ! mount -l | grep "\$(MOUNT_PT)/dev/pts" >/dev/null ; then \\ - mount -vt devpts devpts \$(MOUNT_PT)/dev/pts;\\ - fi;\\ - if ! mount -l | grep "\$(MOUNT_PT)/dev/shm" >/dev/null ; then \\ - mount -vt tmpfs shm \$(MOUNT_PT)/dev/shm;\\ - fi;\\ - if ! mount -l | grep "\$(MOUNT_PT)/proc" >/dev/null ; then \\ - mount -vt proc proc \$(MOUNT_PT)/proc;\\ - fi;\\ - if ! mount -l | grep "\$(MOUNT_PT)/sys" >/dev/null ; then \\ - mount -vt sysfs sysfs \$(MOUNT_PT)/sys;\\ - fi;\\ - fi; EOF ) >> $MKFILE @@ -589,7 +548,7 @@ EOF ( cat << EOF @\$(call echo_CHROOT_request) - @ sudo mkdir $BUILDDIR$TRACKING_DIR + @ sudo mkdir -p $BUILDDIR$TRACKING_DIR @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL") @touch \$@ diff --git a/README b/README index dacfa71..1fe9c31 100644 --- a/README +++ b/README @@ -2,14 +2,17 @@ $Id$ 1. INTRODUCTION:: - This collection of scripts, known as jhalfs-X, strives to create + This collection of scripts, known as jhalfs, strives to create accurate makefiles from the Linux From Scratch book series XML files. - This software is an evolution of the original "jhalfs-0.2" code. + This software is an evolution of the original "jhalfs-0.2" code developed + by Jeremy Huntwork. The usage of this script assumes you have read and are familiar with - the book(s) and, therefore, the configuration variables found in config - files will have meaning to you. There are a number of command line switches - which, if used, will override the config file settings. + the book(s) and, therefore, the configuration variables found in menuconfig + interface will have meaning to you. + + The list of supported books can be found at + http://wiki.linuxfromscratch.org/alfs/wiki/SupportedBooks NOTES:: *. The resulting Makefile takes considerable time to run to completion. @@ -31,156 +34,145 @@ $Id$ - be able to trace build failures and to find what is causing it (user error, package bug, {c,h,b}LFS command bug, or jhalfs code bug) - If you don't have the above skill, please don't use this tool. + If you do not have the above skills, please don't use this tool. 3. INSTALLATION:: - No installation is required. System-wide installation is not allowed - for now. -4. CONFIGURATION FILES:: - Each book in the LFS series has its own set of configurable parameters - as well as the common parameters file. - - ::NEWS:: There is new configuration method for jhalfs. - + No installation is required. System-wide installation is not allowed. + +4. CONFIGURATION:: + + ::NEWS:: + There is a new configuration method for jhalfs. + We have installed the familiar menu based configuration tool driven by - make. If you type the command - make - you will be presented with a list of configurable parameters (starting - with the book you wish to use). All the parameters found in the individual - config files are available. Once you have finished setting the parameters - and exit the make file will launch the chosen book version of jhalfs. - JHALFS will import your created file and overider the values found in normal - "config" files. - ..note.. The generated file is only used by jhalfs if you - run jhalfs via make otherwise it is ignored. - - If you want to try out the new configuration system without running jhalfs - issue the following. - make menuconfig - This will create a new file named configuration but will not launch jhalfs. - + GNU make. see the section RUNNING, for details + 5. RUNNING:: - The script master.sh cannot be invoked directly but only via the - supplied symlinks. After editing the config file for the project you wish - to build, run the script. - IMPORTANT: - If you use the switch -M (automatically run the generated makefile) you - must be 'root' or you can run the scripts using 'sudo' - i.e. sudo ./lfs -G -M + ::NEWS:: + jhalfs is now launched via GNU make instead of individual symlinks. - If you want to run make manually you can only do so if you are 'root' or - via 'sudo' - i.e (from within the jhalfs directory) sudo make + The command will launch a menu based configuration program. You will + recognize the layout from building the kernel or uClibc/BusyBox. The + underlying menu code was borrowed from BusyBox and slightly modified for + our use. - The term refers to the 1 of 3 package symlinks, lfs,hlfs,clfs. - Replace with your choice of packages; i.e.: ./lfs + Help on parameter function is available from the online help. Please + make use of that feature for additional information not in this file. - ./ eg: ./lfs or ./hlfs - Create a makefile based on the settings found in the config files. - You must enter the build partition/jhalfs directory and manually run + Once you have set the parameters you wish and have saved your work the + jhalfs script is launch. The script verify first that the host can run + it and build the xLFS system, then validate the configuration and present + you with your selections which you may accept or reject. - ./ -G eg: ./lfs -G - Download the packages and patches necessary to build + If you accepted the displayed settings jhalfs will proceed to create the + Makefile, optionally download packages. - ./ -G -M eg: ./lfs -G -M - Download the packages, create and automatically run the Makefile + ::NEWS:: + You must be logged as a normal user with sudo privileges to run + the Makefile. - ./ --help eg: ./lfs --help - will give you a context sensitive list of command line switches. + NOTE:: + If you run the jhalfs script directly the only function you can select + is to display the version number running <./jhalfs -v> - >>>> an expanded example +6. BLFS_TOOL SUPPORT:: - export SRC_ARCHIVE=/mnt/SourceFiles + For books that support it, there is an option to install blfs-tool and its + dependendencies on the final system. - ./lfs -D /mnt/partition4 \ - -K ~/jhalfs_configs/linux-2.6.16.19-LFS.config \ - -F ~/jhalfs-configs/fstab-sda3 \ - -G -T 0 -M + After booting the new xLFS system some steps are needed to finish + blfs-tool installation: - explanation::: + - A user account must be created. You must be logged on that user + account to use blfs-tool. - export SRC_ARCHIVE=/mnt/SourceFiles - # This points to a local archive of existing packages. If the version in - the archive is incorrect jhalfs will access the net and download the - necessary version and store it here for later use. DO NOT set this to - $BUILDDIR/sources. If you do not set this variable to a valid directory - ALL package tarballs will be downloaded from the 'net. + - Move /blfs-root to that user's home and change ownership of the + directory and files to the user. - -D /mnt/partition4 - # where everything takes place. ..NOTE it must already exist and be mounted + - Give the user read and write privileges over the $TRACKING_DIR + directory and the files that it contains. - -K ~/jhalfs_configs/linux-2.6.16.19-LFS.config - # If you want to automatically build a the kernel you MUST supply a valid - kernel configuration file. The file you supply will be copied and renamed. + - Configure sudo, adding the needed privileges for the user. - -F ~/jhalfs-configs/fstab-sda3 - # If you have a fstab file you wish to use it will be copied and renamed + We assume that blfs-tool will be used on a running fresh xLFS system. + To use it to build BLFS packages from the chroot jail is also possible, + but is for you to figure out how to do that. - -G # Retrieve the package files. You MUST enable this flag at least once if you - wish to do a build or whenever you update the book. + To know how to blfs-tool works, see README.BLFS. - -T 0 # don't run any testsuites +7. LAYOUT:: - -M # automatically run make against Makefile once jhalfs finishes its work. + /BLFS (see README.BLFS) + /CLFS/master.sh + /clfs.xsl -6. LAYOUT:: + /CLFS2/master.sh + /clfs2.xsl - /CLFS/config - /master.sh - /xxxx.xsl + /HLFS/master.sh + /hlfs.xsl - /CLFS2/config - /master.sh - /xxxx.xsl + /LFS/master.sh + /lfs.xsl - /HLFS/config - /master.sh - /xxxx.xsl - - /LFS/config - / master.sh - /xxxx.xsl - - /common/config - /common_functions + /common/common_functions /makefile_functions /func_check_versions.sh /func_validate_configs.sh + /packages.xsl + /urls.xsl + /create-sbu_du-report.sh + /func_compare.sh + /progress_bar.sh + /blfs-tool-deps/9xx-* /contrib/jhalfs-paco.patch - /extras/do_copy_files + /extras/do_copy_files /do_ica_prep /do_ica_work /farce /filelist - README - README.PACO - TODO + /optimize/opt_config + /opt_override + /optimize_functions + /opt_config.d/noOpt + /noSymbols + /O3pipe + /O3pipe_march + /defOpt_fPIC - ./clfs ---| - ./clfs2 ---| - ./hlfs ---|+---> master.sh - ./lfs ---| + /menu/* + README + README.BLFS + README.HLFS + README.PACO + TODO + LICENSE -7. FAQ:: + Config.in + Makefile + jhalfs + blfs-tool + +8. FAQ:: Q. "This 'help' file is very sparse" A. Yes, it is. This tool, jhalfs, is for those who understand the LFS books and wish to automate the build. 99% of any problems that arise can be solved by reading the book(s). Q. "It doesn't work!" - A. Yes it does, try ./lfs --help - Remember you must either be 'root' to run this script or have 'sudo' privileges. + A. Yes it does, try >> make + Remember you must have 'sudo' privileges. Q. "It still doesn't work" - A. jhalfs was designed to work against the developement versions of the LFS + A. jhalfs was designed to work against the development versions of the LFS series of books. Consequently changes in a book(s) sometimes breaks older versions of jhalfs. Before you start pulling out your hair download the latest version of jhalfs to see if that solves your problem. @@ -193,42 +185,50 @@ $Id$ The layout below $BUILDDIR is as follows. $BUILDDIR/ - jhalfs (makefile,cmd scripts,logs..etc) - sources (where packages reside) - tools (temporary bootstrap system) - cross-tools (temporary CLFS only) - ... - FHS dir structure - ... + jhalfs (Makefile, cmd scripts, logs, etc..) + sources (where packages reside) + tools (temporary bootstrap system) + cross-tools (temporary CLFS only) + ... + FHS dir structure + ... + blfs_root (files to use blfs-tool if selected to install it) Q. "What is the function of the SRC_ARCHIVE variable?" - A. When then symlinked master.sh runs it creates a local copy of the - necessary packages in BUILDDIR/sources by downloading the files. If - the variable SRC_ARCHIVE is defined the software will first look in - this location for the file and, if found, will copy it to BUILDDIR/sources. + A. When jhalfs runs and packages download was selected, it creates a local + copy of the necessary packages in BUILDDIR/sources by downloading the + files. If the variable SRC_ARCHIVE is defined the software will first + look in this location for the file and, if found, will copy it to + BUILDDIR/sources. If the files are not found in SRC_ARCHIVE _and_ you have write priv to the directory any downloaded files will be mirrored there. Q. "How do I set the SRC_ARCHIVE location?" A. The best way to set the value of SRC_ARCHIVE is + export SRC_ARCHIVE=/wherever/you/store/downloaded/packages - OR - you can change the setting in common/config. + + or you can set the full path in the proper menu entry. Q. "Why have 2 copies of the files?" A. The package files must be visible during the chroot phase and this is a simple and reliable method of doing so. This method also handles the CLFS - build method where the final build may be done on a separate machine. + boot build method where the final build may be done on a separate machine. - Q. "What is the function of LUSER and LGROUP? There is no cmd line switch" - A. If you are running jhalfs from a low or non-priveledged account you may not - have the priv to create/delete accounts. These variables are adjustable - when invoking make. - make LUSER=myaccount LGROUP=mygroup - Then only changes to your account will be the creation of a NEW .bashrc after - saving your original to .bashrc.XXX - - Q. "When I try to build 'xxx' with clfs the makefile fails at the mid-point" + Q. "What is the function of "User account" and "Group account" menu settings?" + A. If you are running jhalfs from a low or non-privileged account you may not + have the priv to create/delete the user needed to build temporally tools. + These settings allow you to use your own user and group name to do that + build steps. + + These variables are adjustable also when invoking make: + + $BUILDDIR make LUSER=myaccount LGROUP=mygroup + + The only changes to your account will be the creation of a NEW .bashrc + after saving your original to .bashrc.XXX + + Q. "When I try to build CLFS the Makefile fails at the mid-point" A. There could be numerous reasons for the failure but the most likely reason is you are doing a cross-build using the 'chroot' method and the target is not compatible with the host. If you choose to build using the chroot @@ -237,9 +237,9 @@ $Id$ it means the host and target are not compatible an you should use the 'boot' method to create your target code. As an extreme example: You can build a sparc target on a x86 platform but - only the temptools phase. You must run ./clfs using the 'boot' method and - not the 'chroot.' You must transfer the toolchain to a sparc platform, reboot - the sparc box and continue the build. + only the temptools phase. You must select the 'boot' method and not the + 'chroot.' You must transfer the toolchain to a sparc platform, reboot the + sparc box and continue the build. Of all the LFS series of books Cross-LFS requires the greatest understanding of host/target hardware combination. Please read the book carefully and don't skip the easy parts (there are none..) @@ -247,4 +247,3 @@ $Id$ Authors: George Boudreau Manuel Canales Esparcia - Jeremy Huntwork diff --git a/README.BLFS b/README.BLFS index 498f9d6..36e9f0f 100644 --- a/README.BLFS +++ b/README.BLFS @@ -8,14 +8,12 @@ $Id$ installed on a non default prefix, build commands can change based on what dependencies will be used, etc. - Said that, the goal of jhalfs is try to help you solving packages - dependencies and creating your own build scripts/Makefile. Some of the - auto-generated build scripts and Makefile could work "as is", but as a + Said that, the goal of blfs-tool is try to help you solving packages + dependencies and creating your own build scripts and Makefile. Few of the + auto-generated build scripts and Makefile could work "as is", thus as a general rule you will need to review and edit the scripts while reading the book. - NOTE:: The code is still under development and may contains several bugs - 2. PREREQUISITES:: @@ -27,19 +25,36 @@ $Id$ - be able to trace build failures and to find what is causing it (user error, package bug, BLFS command bug, or jhalfs code bug) - If you don't have the above skill, please don't use this tool. + If you do not have the above skills, please don't use this tool. 3. USAGE:: - Due the complexity of the BLFS book, the scripts/Makefile generation is + Due the complexity of the BLFS book, the scripts and Makefile generation is done in several steps: - 3.1 INSTALLATION:: + 3.1 INSTALLED PACKAGES TRACKING SYSTEM + + This tool includes a very simple tracking system to know what packages + has been installed using the tool. It is used to skip installed packages + from target selection menu and to know if an installed package has been updated + on the BLFS book. Don't rely on this feature as a packages management tool. + + The directory where tracking files will be stored need be created + before installing blfs-tool. You can place that directory anywhere, taking + care that the builder user must have read and write privileges on that + directory and on all files it contains. + + To use the default path set in the installation menu, run as root: + + install -d -m1777 /var/lib/jhalfs/BLFS + + 3.2 BLFS_TOOL INSTALLATION:: Run "make" to launch the jhalfs menuconfig interface. Select the BLFS book and it version. Then set the installation directory (default - $HOME/blfs_root) and the BLFS sources directory (default blfs-xml). + $HOME/blfs_root), the BLFS sources directory (default blfs-xml), and + the installed packages tracking directory (default /var/lib/jhalfs/BLFS). All required files will be placed in the installation directory and BLFS XML sources will be checkout to the named sub-directory. @@ -69,45 +84,55 @@ $Id$ From now on, all the work must be done from inside the installation root directory. - 3.2 UPDATING BOOK SOURCES:: + When finished the installation, the configuration and target selection + menu is launch. + + 3.3 UPDATING BOOK SOURCES:: If using the development book version, and if you want to update already installed packages to the new version found in that book, you need to update the XML sources and packages database. - To do that run "./update_book.sh" + To do that run "./update_book.sh" - 3.3 CONFIGURING AND PARSING THE BOOK:: (obsolete, to be rewritten) + On the next configuration run, packages already installed but listed + with a new version in the book will be available for target selection and + used to solve dependencies. + + 3.4 CONFIGURING AND PARSING THE BOOK:: Next step is to create a book and build scripts in dependencies build order - for a target package. A target package can be any of the ones listed in the - packages file. That is done using the blfs-parser.sh script, but we are trying - to make a menuconfig based system. + for a target package. A target can be a package or a meta-package. - The script need three arguments: + Run to launch the configuration interface. The main menu contains + three block: meta-package selection, individual package selection, and + build options. - package name as listed in packages file - dependencies level 1 for required, - 2 for required an recommended - 3 for required, recommended, and optional - sudo usage y if sudo will be used (you want build as a normal user) - n if sudo isn't needed (you want build as root) + Only one meta-package or individual package must be selected on each run. + That is due that there is no way to solve dependencies properly when + more than one target are selected at the same time. - For example: + When a meta-package is selected is possible to unselect unwanted components. + That unselected components will be skipped if no other components depends + on them. - ./blfs-parser galeon 3 y + In the build options section the dependencies level and default packages + used to solve alternatives are set. Can be set also if the build will be + made as a normal user or as root. That settings are saved to be reused on + future configuration runs. - will create a directory named "galeon". Inside that directory you find a - directory named "HTML" that contains a galeon-based HTML book with all - dependencies in build order and a "scripts" directory with build scripts - that uses sudo for commands that need root privileges. + If, for example, your target selection is Xsoft-->Graphweb-->galeon a + directory named "galeon" will be created. Inside that directory you will + find a directory named "HTML" that contains a galeon-based HTML book with + its dependencies in build order, and a "scripts" directory with build + scripts for that packages. - There is also two other directories, dependencies and xincludes, that + There is also two other directories, "dependencies" and "xincludes", that contains files generated while resolving dependencies trees. - 3.4 EDITING BUILD SCRIPTS + 3.5 EDITING BUILD SCRIPTS - Now is the time to review the generated book and scripts, making in the + Now is time to review the generated book and scripts, making in the scripts any changes required to fix generation bugs or to fit your needs. Scripts for additional packages (i.e., for non-BLFS packages) can be @@ -116,24 +141,20 @@ $Id$ "foo" script is named "064-z-foo", you need to create a "064-y-bar" build script. - Note that the packages tracking system isn't a packages management tool + Remember that the packages tracking system isn't a packages management tool and know nothing about packages not in the BLFS book. - 3.5 CREATING THE MAKEFILE + Also, review and edit envars.conf. That file is used to set global envars + needed by the build scripts. + + 3.6 CREATING THE MAKEFILE + When the build scripts are ready to be run, the Makefile can be created. Be sure that you cd into the "package" directory and run ../gen_makefile.sh - Review the Makefile and if all look sane, start the build. - - -(Text is needed about meta-packages, the installed packages tracking system -and like) - -(The TRACKING_DIR directory must be created before using this tool running as root - -install -d -m1777 /var/lib/jhalfs/BLFS ) + Review the Makefile and if all looks sane, start the build. 4. GENERATED BUILD SCRIPTS ISSUES:: @@ -176,8 +197,8 @@ install -d -m1777 /var/lib/jhalfs/BLFS ) to make it to use your local packages. Also, you will need to edit the scripts to fix the commands that must - be applied only to a concret individual sub-package. For example the "for" - loop to install xotg7-util packages may read like: + be applied only to a concrete individual sub-package. For example the "for" + loop to install xorg7-util packages may read like: for package in $(cat $WGET_LST) ; do packagedir=$(echo $package | sed 's/.tar.bz2//') diff --git a/README.HLFS b/README.HLFS index 6df4d28..a9076cf 100644 --- a/README.HLFS +++ b/README.HLFS @@ -14,5 +14,4 @@ $Id$ Automation failures: 1.Directory /dev and devices nodes /dev/null, /dev/console needed to be created in kernfs - 2.Linux-headers does not contain /net. 3.Remove the creation of /null and /console node from the devices script. \ No newline at end of file diff --git a/blfs-tool b/blfs-tool index 72ae6d8..bcb3d40 100755 --- a/blfs-tool +++ b/blfs-tool @@ -144,7 +144,7 @@ echo "${SD_BORDER}${nl_}" echo -n "Are you happy with these settings? yes/no (no): " read ANSWER if [ x$ANSWER != "xyes" ] ; then - echo "${nl_}Fix the configuration options and rerun the script.${nl_}" + echo "${nl_}Rerun make to fix the configuration options.${nl_}" exit 1 fi echo "${nl_}${SD_BORDER}${nl_}" diff --git a/common/blfs-tool-deps/901-libxml2 b/common/blfs-tool-deps/901-libxml2 index 7fead12..e2c2222 100644 --- a/common/blfs-tool-deps/901-libxml2 +++ b/common/blfs-tool-deps/901-libxml2 @@ -3,7 +3,7 @@ # $Id$ set -e - +cd $PKGDIR ./configure --prefix=/usr make make install diff --git a/common/blfs-tool-deps/902-libxslt b/common/blfs-tool-deps/902-libxslt index 7fead12..e2c2222 100644 --- a/common/blfs-tool-deps/902-libxslt +++ b/common/blfs-tool-deps/902-libxslt @@ -3,7 +3,7 @@ # $Id$ set -e - +cd $PKGDIR ./configure --prefix=/usr make make install diff --git a/common/blfs-tool-deps/903-tidy b/common/blfs-tool-deps/903-tidy index 49fd979..c8b70b4 100644 --- a/common/blfs-tool-deps/903-tidy +++ b/common/blfs-tool-deps/903-tidy @@ -3,12 +3,14 @@ # $Id$ set -e +cd $PKGDIR patch -Np1 -i ../tidy-051026-prevent_PRE_newlines-1.patch sh build/gnuauto/setup.sh ./configure --prefix=/usr make make install +(cd ../ && tar -xvf tidy_docs_051020.tgz) cd htmldoc tidy -xml-help > tidy-help.xml tidy -xml-config > tidy-config.xml @@ -16,7 +18,7 @@ xsltproc -o tidy.1 tidy1.xsl tidy-help.xml xsltproc -o quickref.html quickref-html.xsl tidy-config.xml cd .. install -v -m644 htmldoc/tidy.1 /usr/share/man/man1 -install -v -m755 -d /usr/share/doc/tidy-051026 -install -v -m644 htmldoc/quickref.html /usr/share/doc/tidy-051026 +install -v -m755 -d /usr/share/doc/tidy-051020 +cp -v -R htmldoc/* /usr/share/doc/tidy-051020 exit diff --git a/common/blfs-tool-deps/904-unzip b/common/blfs-tool-deps/904-unzip index b11acca..28dcf1f 100644 --- a/common/blfs-tool-deps/904-unzip +++ b/common/blfs-tool-deps/904-unzip @@ -3,6 +3,7 @@ # $Id$ set -e +cd $PKGDIR make -f unix/Makefile LOCAL_UNZIP=-D_FILE_OFFSET_BITS=64 linux make prefix=/usr install diff --git a/common/blfs-tool-deps/906-docbook-xsl b/common/blfs-tool-deps/906-docbook-xsl index 2545812..38fa37b 100644 --- a/common/blfs-tool-deps/906-docbook-xsl +++ b/common/blfs-tool-deps/906-docbook-xsl @@ -3,6 +3,7 @@ # $Id$ set -e +cd $PKGDIR install -v -m755 -d /usr/share/xml/docbook/xsl-stylesheets-1.69.1 cp -v -R VERSION common eclipse extensions fo html \ diff --git a/common/blfs-tool-deps/907-gpm b/common/blfs-tool-deps/907-gpm index 67190be..cd977b5 100644 --- a/common/blfs-tool-deps/907-gpm +++ b/common/blfs-tool-deps/907-gpm @@ -3,6 +3,7 @@ # $Id$ set -e +cd $PKGDIR patch -Np1 -i ../gpm-1.20.1-segfault-1.patch patch -Np1 -i ../gpm-1.20.1-silent-1.patch diff --git a/common/blfs-tool-deps/908-links b/common/blfs-tool-deps/908-links index c6129b8..310e617 100644 --- a/common/blfs-tool-deps/908-links +++ b/common/blfs-tool-deps/908-links @@ -3,6 +3,7 @@ # $Id$ set -e +cd $PKGDIR ./configure --prefix=/usr make CFLAGS="-O2 -Wno-sign-compare -Wno-pointer-sign" diff --git a/common/blfs-tool-deps/909-sudo b/common/blfs-tool-deps/909-sudo index 96f276a..bfc84ff 100644 --- a/common/blfs-tool-deps/909-sudo +++ b/common/blfs-tool-deps/909-sudo @@ -3,6 +3,7 @@ # $Id$ set -e +cd $PKGDIR patch -Np1 -i ../sudo-1.6.8p12-envvar_fix-1.patch ./configure --prefix=/usr --libexecdir=/usr/lib \ diff --git a/common/blfs-tool-deps/910-wget b/common/blfs-tool-deps/910-wget index cd09409..357a6ca 100644 --- a/common/blfs-tool-deps/910-wget +++ b/common/blfs-tool-deps/910-wget @@ -3,6 +3,7 @@ # $Id$ set -e +cd $PKGDIR ./configure --prefix=/usr --sysconfdir=/etc make diff --git a/common/blfs-tool-deps/911-subversion b/common/blfs-tool-deps/911-subversion index 9892ae6..d02703f 100644 --- a/common/blfs-tool-deps/911-subversion +++ b/common/blfs-tool-deps/911-subversion @@ -3,6 +3,7 @@ # $Id$ set -e +cd $PKGDIR ./configure --prefix=/usr \ --without-berkeley-db \ diff --git a/common/common-functions b/common/common-functions index f9a99a8..2ba92cc 100644 --- a/common/common-functions +++ b/common/common-functions @@ -44,9 +44,19 @@ get_package_tarball_name() { # # hopefully this will not cause problems. # case $script_name in - tcl) echo $(grep "^tcl" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;; - linux-headers) echo $(grep "^linux-headers.*.bz2" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;; - *) echo $(grep "^$script_name-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;; + tcl) echo $(grep "^tcl" $JHALFSDIR/pkg_tarball_list | head -n1 ) + ;; + linux-headers) + if [ "${PROGNAME}" = "lfs" ]; then + # Uses kernel headers directly + echo $(grep "^linux-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) + else + # CLFS/CLFS use massaged headers package + echo $(grep "^linux-headers-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) + fi + ;; + *) echo $(grep "^$script_name-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) + ;; esac } @@ -410,24 +420,21 @@ clean_builddir() { # #----------------------------# # Test if the clean must be done. if [ "${CLEAN}" = "y" ]; then - # Test to make sure we're running the clean as root - if [ "$UID" != "0" ] ; then - echo "You must be logged in as root to clean the build directory." - exit 1 - fi # Test to make sure that the build directory was populated by jhalfs if [ ! -d $JHALFSDIR ] || [ ! -d $BUILDDIR/sources ] ; then echo "Looks like $BUILDDIR was not populated by a previous jhalfs-X run." exit 1 else # Clean the build directory - echo -ne "Cleaning $BUILDDIR...\n" - rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,tools,cross-tools,usr,var} - echo -ne "Cleaning $JHALFSDIR...\n" - rm -rf $JHALFSDIR/{0*,1*,envars,sources-dir,*commands,*logs,Makefile,*.xsl,makefile-functions,pkg_tarball_list,*.config,*.sh} - echo -ne "Cleaning remainig extracted sources in $BUILDDIR/sources...\n" - rm -rf `find $BUILDDIR/sources/* -maxdepth 0 -type d` - echo -ne "done\n" + echo -n "Cleaning $BUILDDIR ..." + sudo rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,tools,cross-tools,usr,var} + echo "done" + echo -n "Cleaning $JHALFSDIR ..." + sudo rm -rf $JHALFSDIR + echo "done" + echo -n "Cleaning remainig extracted sources in $BUILDDIR/sources ..." + sudo rm -rf `find $BUILDDIR/sources/* -maxdepth 0 -type d` + echo "done" fi fi } @@ -813,6 +820,7 @@ add_blfs_deps_urls() { # No easy way to extract it. if [[ "${DEP_TIDY}" = "y" ]] ; then echo "${TIDY_URL} ${BLFS_SERVER}tidy/${TIDY_PKG} ${TIDY_MD5}" >> urls.lst echo "${TIDY_PATCH_URL} ${BLFS_SERVER}tidy/${TIDY_PATCH} ${TIDY_PATCH_MD5}" >> urls.lst + echo "${TIDY_DOCS_URL} ${BLFS_SERVER}tidy/${TIDY_DOCS} ${TIDY_DOCS_MD5}" >> urls.lst fi if [[ "${DEP_UNZIP}" = "y" ]] ; then diff --git a/common/func_check_version.sh b/common/func_check_version.sh index 9b4ff53..d5038e0 100644 --- a/common/func_check_version.sh +++ b/common/func_check_version.sh @@ -83,7 +83,7 @@ check_prerequisites() { # check_version "3.0" "$(gawk --version | head -n1 | cut -d" " -f3)" "GAWK" check_version "2.5" "$(grep --version | head -n1 | cut -d" " -f4)" "GREP" check_version "1.2.4" "$(gzip --version 2>&1 | head -n1 | cut -d" " -f2)" "GZIP" - check_version "3.79.1" "$(make --version | head -n1 | cut -d " " -f3)" "MAKE" + check_version "3.79.1" "$(make --version | head -n1 | cut -d " " -f3 | cut -c1-4)" "MAKE" check_version "2.5.4" "$(patch --version | head -n1 | cut -d" " -f2)" "PATCH" check_version "3.0.2" "$(sed --version | head -n1 | cut -d" " -f4)" "SED" else diff --git a/common/makefile-functions b/common/makefile-functions index 537353e..2333c1d 100644 --- a/common/makefile-functions +++ b/common/makefile-functions @@ -17,7 +17,7 @@ REVERSE = "" define echo_PHASE @clear @echo $(BOLD)-------------------------------------------------------------------------------- - @echo Executing $(BLUE)$(1)$(WHITE) scripts + @echo -e \\t\\tExecuting $(BLUE)$(1)$(WHITE) scripts @echo $(BOLD)-------------------------------------------------------------------------------- #echo $(WHITE) endef diff --git a/jhalfs b/jhalfs index b16e7a3..eef50f0 100755 --- a/jhalfs +++ b/jhalfs @@ -90,10 +90,6 @@ source configuration [[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1 [[ $VERBOSITY > 0 ]] && echo "OK" - #--- Envars not sourced from configuration -declare -r SVN="svn://svn.linuxfromscratch.org" -declare -r LOG=000-masterscript.log - # These are boolean vars generated from Config.in. # ISSUE: If a boolean parameter is not set that # variable is not defined by the menu app. This can @@ -130,6 +126,10 @@ case $BRANCH_ID in LFSVRS=${BRANCH_ID} TREE=branches/${BRANCH_ID#branch-}/BOOK ;; + 2.4-branch ) + LFSVRS=${BRANCH_ID} + TREE=branches/2.4-branch + ;; * ) case $PROGNAME in lfs | hlfs ) @@ -177,6 +177,10 @@ if [[ "${BLFS_TOOL}" = "y" ]] ; then TIDY_PATCH="tidy-051026-prevent_PRE_newlines-1.patch" TIDY_PATCH_URL="http://www.linuxfromscratch.org/patches/blfs/svn/${TIDY_PATCH}" TIDY_PATCH_MD5="82f67f7af58fc2c945b3410ae655cc1a" + # tidy docs + TIDY_DOCS="tidy_docs_051020.tgz" + TIDY_DOCS_URL="http://tidy.sourceforge.net/docs/${TIDY_DOCS}" + TIDY_DOCS_MD5="86de2f198e57399c063d2567b2a25628" # unzip UNZIP_PKG="unzip552.tar.gz" UNZIP_URL="ftp://ftp.info-zip.org/pub/infozip/src/${UNZIP_PKG}" @@ -223,6 +227,15 @@ if [[ "${BLFS_TOOL}" = "y" ]] ; then GPM_PATCH_2_MD5="bf6cbefe20c6f15b587f19ebc1c8a37a" fi +#--- Envars not sourced from configuration +case $PROGNAME in + clfs* ) declare -r SVN="http://svn.cross-lfs.org/svn/repos" ;; + * ) declare -r SVN="svn://svn.linuxfromscratch.org" ;; +esac +declare -r LOG=000-masterscript.log + # Needed to can fetch BLFS book sources when building CLFS +declare -r SVN_2="svn://svn.linuxfromscratch.org" + # Set true internal variables COMMON_DIR="common" PACKAGE_DIR=$(echo $PROGNAME | tr [a-z] [A-Z]) @@ -268,7 +281,7 @@ echo "${SD_BORDER}${nl_}" echo -n "Are you happy with these settings? yes/no (no): " read ANSWER if [ x$ANSWER != "xyes" ] ; then - echo "${nl_}Fix the configuration options and rerun the script.${nl_}" + echo "${nl_}Rerun make to fix the configuration options.${nl_}" exit 1 fi echo "${nl_}${SD_BORDER}${nl_}" @@ -383,7 +396,7 @@ if [[ "${BLFS_TOOL}" = "y" ]] ; then echo -n "Downloading the BLFS document, $BLFS_BRANCH_ID version... " if [[ ! -d ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} ]] ; then mkdir -p ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} - svn co $SVN/BLFS/$BLFS_TREE ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} >>$LOGDIR/$LOG 2>&1 + svn co $SVN_2/BLFS/$BLFS_TREE ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} >>$LOGDIR/$LOG 2>&1 else pushd ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} 1> /dev/null svn up >>$LOGDIR/$LOG 2>&1