I finished an automated build over the weekend and wanted to share my experience since it was much easier than anticipated. There are a few preparatory steps that need to be taken before beginning the automated build. First you will need to create the partitions for LFS using fdisk. I have a root partition and a swap partition, /dev/sda5 for swap and /dev/sda6 for root. These will need to have the file systems created
(xxx being your partition - /dev/sda6 in my case), and
for the swap partition (xxx being your partition - /dev/sda5 in my case), then
to make the swap space active. Create a directory for the root partition to be mounted on,
Code:
mkdir -v /mnt/build_dir
Then mount the root partition
Code:
mount -v -t ext3 /dev/xxx /mnt/build_dir
All of the commands listed above will need to be run as root. The following commands need to be run as a regular user. Download jhalfs-2.3.1.tar.bz2 into your home directory and unpack it. Also, it helps to download all the packages for LFS6.3 into a directory of your choice, just be sure to make note of the d/l directory as jhalfs will use this as the source for the install packages. Now you can begin the install. Enter the jhalfs-2.3.1 directory and issue:
I use "make config" because the menu is much easier to deal with than the ncurses menu. Plus, I couldn't get any of the fields to change in the ncurses menu. (Before this will work, your system must meet the system requirements. LFS provides a script to test your system, section iv in the preface of the LFS 6.3 book. Install any missing packages if necessary). Here is the menu and the selections I made:
Code:
make -C menu conf
make[1]: Entering directory `/jhalfs/jhalfs-2.3.1/menu'
HOSTCC conf.o
HOSTCC zconf.tab.o
make[1]: Leaving directory `/jhalfs/jhalfs-2.3.1/menu'
*
* JHALFS Configuration
*
*
* --- BOOK Settings
*
Use BOOK
> 1. Linux From Scratch (BOOK_LFS) (NEW)
2. Cross-Compiled Linux From Scratch (BOOK_CLFS) (NEW)
3. Cross-Compiled Linux From Scratch (Sysroot method) (BOOK_CLFS2) (NEW)
4. Cross-Compiled Linux From Scratch (Embedded Systems) (BOOK_CLFS3) (NEW)
5. Hardened Linux From Scratch (BOOK_HLFS) (NEW)
6. Beyond Linux From Scratch (BOOK_BLFS) (NEW)
choice[1-6?]: choose 1
Release
> 1. SVN (relSVN) (NEW)
2. Working Copy (WORKING_COPY) (NEW)
3. Branch or stable book (BRANCH) (NEW)
choice[1-3]: choose 3
Book Version (mandatory) (BRANCH_ID) [**EDIT ME**] (NEW)enter 6.3
Add custom tools support (CUSTOM_TOOLS) [N/y/?] (NEW) No
Add blfs-tool support (BLFS_TOOL) [N/y/?] (NEW) No
*
* --- General Settings
*
Change the default user/group and homedir for this build (CONFIG_USER) [N/y/?] (NEW) No
Build Directory (BUILDDIR) [/mnt/build_dir] (NEW) change if your build dir is different
Retrieve source files (GETPKG) [N/y/?] (NEW) Yes, enter the path to your LFS 6.3 packages, mine was /home/andy/packages
Run the makefile (RUNMAKE) [N/y/?] (NEW) If you choose yes, the Makefile will run automatically. If you choose no, you will need to change into the /mnt/build_dir/jhalfs directory and run the makefile manually
Rebuild files (CLEAN) [N/y/?] (NEW) only choose yes if you have run jhalfs before and need to clean out the /mnt/build_dir/jhalfs directory
*
* --- Build Settings
*
Run testsuites (CONFIG_TESTS) [Y/n/?] (NEW)
Tests level
> 1. Only final system Glibc, GCC and Binutils testsuites (TST_1) (NEW)
2. All final system testsuites (TST_2) (NEW)
3. Both temporary tools and final system testsuites (TST_3) (NEW)
choice[1-3]: I chose 1, it's a matter of preference here. The build gets much longer with the other options.
Flavour
> 1. Don't stop on test suite failures (NO_BOMB) (NEW)
2. Abort the build at the first test suite failure (BOMB) (NEW)
choice[1-2]: choose 1, matter of preference though
Create installed files logs (INSTALL_LOG) [N/y/?] (NEW) either
Use a custom fstab file (HAVE_FSTAB) [N/y/?] (NEW) no
Build the kernel (CONFIG_BUILD_KERNEL) [N/y/?] (NEW) no, this tries to use a .config file if you choose yes
Strip Installed Binaries/Libraries (STRIP) [Y/n] (NEW) yes
Install vim-lang package (VIMLANG) [Y/n/?] (NEW) yes
TimeZone (TIMEZONE) [GMT] (NEW) hit enter
Language (LANG) [$LANG] (NEW) hit enter
Groff page size
> 1. letter (PAGE_LETTER) (NEW)
2. A4 (PAGE_A4) (NEW)
choice[1-2?]: hit enter
*
* --- Advanced Features
*
Create SBU and disk usage report (REPORT) [Y/n] (NEW) hit enter
Run comparison analysis on final stage (COMPARE) [N/y/?] (NEW) hit enter
Use optimization (see help) (CONFIG_OPTIMIZE) [N/y/?] (NEW) hit enter
*
* --- Internal Settings (WARNING: for jhalfs developers only)
*
Scripts root (SCRIPT_ROOT) [jhalfs] (NEW) hit enter
jhalfs directory (JHALFSDIR) [$BUILDDIR/$SCRIPT_ROOT] (NEW) hit enter
Build logs directory basename (LOGDIRBASE) [logs] (NEW) hit enter
Build logs directory (LOGDIR) [$JHALFSDIR/$LOGDIRBASE] (NEW) hit enter
Test suites logs directory basename (TESTLOGDIRBASE) [test-logs] (NEW) hit enter
Test suites logs directory (TESTLOGDIR) [$JHALFSDIR/$TESTLOGDIRBASE] (NEW) hit enter
Installed files logs directory basename (FILELOGDIRBASE) [installed-files] (NEW) hit enter
Installed files logs directory (FILELOGDIR) [$JHALFSDIR/$FILELOGDIRBASE] (NEW) hit enter
ICA logs directory (ICALOGDIR) [$LOGDIR/ICA] (NEW) hit enter
farce logs directory (FARCELOGDIR) [$LOGDIR/farce] (NEW) hit enter
Makefile (MKFILE) [$JHALFSDIR/Makefile] (NEW) hit enter
XSL stylesheet (XSL) [$PROGNAME.xsl] (NEW) hit enter
Package contents list (PKG_LST) [unpacked] (NEW) hit enter
Rebuild the Makefile (see help) (REBUILD_MAKEFILE) [N/y/?] (NEW) hit enter
To start the build enter
This will take you into the ncurses menu. Don't change any setting in here. The config you just completed is set, select exit and the build will start. If you get some errors about the host systems requirements being too old, just hit c and continue. I knew my system was ok and don't know why the errors were generated. Not an issue since the build went ok. You will be asked for your sudo password, and off it goes. My build took about 3 hrs total, down from about 8 if I did it manually. Once the build starts you can end it and start over, just be sure to choose the clean option the next time through the menu. The menu will keep your selections each time through until you change a setting. After the build is complete you will need to enter the chroot environment and change /etc/fstab, /etc/hosts, set up grub to your liking. Section 7 of the LFS 6.3 book lists them. Complete section 8, configuring the kernel. Keep the hardware list of your host system handy so you get all the necessary options added to the kernel. You can chroot as much as necessary to add BLFS packages, such as net-tools, DHCP, and wget. I also added openssl and openssh so I could remote in. That should be it, hopefully this helps. Let me know if I left something out.