LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 01-06-2009, 08:52 PM   #1
guyFromThere
LQ Newbie
 
Registered: Oct 2008
Posts: 4

Rep: Reputation: 1
Automated LFS using jhalfs-2.3.1


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
Code:
mke2fs -j /dev/xxx
(xxx being your partition - /dev/sda6 in my case), and
Code:
mkswap /dev/xxx
for the swap partition (xxx being your partition - /dev/sda5 in my case), then
Code:
swapon /dev/xxx
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:
Code:
make config
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
Code:
make
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.
 
Old 01-06-2009, 09:13 PM   #2
guyFromThere
LQ Newbie
 
Registered: Oct 2008
Posts: 4

Original Poster
Rep: Reputation: 1
My host system is Ubuntu Server LTS 8.04. To get this set up properly, apt-get build-essentials is needed. It will suggest additional packages to install. I copied and pasted them to install them all. Then ran the script in the LFS book.
 
Old 01-07-2009, 10:28 AM   #3
bines
Member
 
Registered: Dec 2008
Location: Hereford, UK
Distribution: LFS (when it's finished)
Posts: 30

Rep: Reputation: 16
Very many thanks for sharing your experience with others. I haven't been brave enough to attempt an auto-build yet - I'm still struggling to do it manually (nearly there though!). I have printed your post and will keep it for when I have a go with jhalfs.

I think that your information would make an excellent HINT, I would consider it a valuable addition to the list.

Allan
 
Old 11-10-2010, 06:20 AM   #4
elenger
LQ Newbie
 
Registered: Jul 2010
Distribution: CRUX 3.3
Posts: 3

Rep: Reputation: 0
it works with lfs-livecd 6.3-r2145
thanks elenger
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile error with jhalfs 2.3.1 on 032-linux-headers fahadsadah Linux From Scratch 3 06-12-2008 01:06 PM
LFS & jhalfs problem guenther_r Linux From Scratch 0 08-17-2007 10:22 AM
need some help with jhalfs-1.0 arcile Linux - Newbie 2 08-30-2006 09:06 PM
AHLFS (Automated Hardened LFS) Profile for nALFS - See progress reports here... bisailb Linux From Scratch 2 09-28-2004 01:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 06:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration