LC_ALL=POSIX
I have successfully built LFS 7.0 i686 on my 2011 qdesk (AMD Phenom X4 8GB - see Computer Build - 2011 qDesk) machine. The host distro used to build it is i686 ArchLinux installed on my sda12, hostname is archdev, GCC is 4.6.2. A single SBU on that host machine is 27 seconds. The largest compile of GCC (the final build, not the temporary) was 47 SBU which took about 20 minutes. The actual partition on qdesk holding the new LFS build is sda13
LFS 7.0 build on ArchLinux around 2011-12-16 using GCC 4.6.2, do NOT upgrade that archdev distro!!!
This is for development, to package up the latest build to be installed below
Takes my current working LFS partition, tar.gz it, and send it to my website so I can install if on another computer. From archdev as root NOT in chroot, make sure /mnt/lfs/dev/shm, /mnt/lfs/dev/pts, /mnt/lfs/dev, /mnt/lfs/proc, /mnt/lfs/sys are NOT mounted
Package LFS
mount /dev/sda13 /mnt/lfs cd /mnt/lfs tar -zcvf /mnt/lfs-current.tar.gz --exclude=./usr/src/ --directory=/mnt/lfs/ . mv /mnt/lfs-current.tar.gz /nwq/admin/www/data/mrcore_files/lfs/i686/build/
When I rebuild the kernel from archdev its nice to deploy it to all other machines running my LFS From archdev as root NOT in chroot
Package Kernel
mount /dev/sda13 /mnt/lfs cd /mnt/lfs/boot tar -zcvf /mnt/boot-current.tar.gz System.map-3.1 config-3.1 vmlinuz-3.1-lfs-7.0 mv /mnt/boot-current.tar.gz /nwq/admin/www/data/mrcore_files/lfs/i686/build/
This is how to install the final build on your machine (Install my own custom distro). The idea is to simply download my root directories tar.gz and extract it to your partition then setup grub...
chroot
mount -v --bind /dev /mnt/dev mount -vt devpts devpts /mnt/dev/pts mount -vt tmpfs shm /mnt/dev/shm mount -vt proc proc /mnt/proc mount -vt sysfs sysfs /mnt/sys chroot /mnt /usr/bin/env -i HOME=/root TERM="$TERM" /bin/bash --login
/boot/grub/grub.cfg
cat > /boot/grub/grub.cfg << "EOF" # Begin /boot/grub/grub.cfg set default=0 set timeout=5 insmod ext2 set root=(hd0,2) menuentry "GNU/Linux, Linux 3.1-lfs-7.0" { linux /boot/vmlinuz-3.1-lfs-7.0 root=/dev/sda2 ro } EOF
All build files are at /nwq/admin/www/data/mrcore_files/lfs/i686/build/ or http://mreschke.com/files/lfs/i686/build/ All versions here are LFS 7.0 i686
These are NOT my main deployable build backups (those would be in the i686/build directory like lfs-1.0.1-tar.gz...) These are backups of different stages during the actual building of the LFS system itself. All backups are in /nwq/admin/www/data/mrcore_files/lfs/i686/backups/
I have decided to leave the base LFS (my sda13) pretty much bare. Basically just after the last page in the LFS 7.0 manual I only basically only do the following to my sda13 base # install bc # install openssl # install nettle # install gnutls # install wget
In other words, I want my LFS system to be as bare as possible, then add what you want to each individual install instance with the ports manager! So my LFS system is simply raw LFS 7.0 + wget
Any changes you make to this base system should then be wrapped up into a build tar.gz (see How to Package LFS for Installation above)
Host system info
as root from archdev
mount /dev/sda13 /mnt/lfs mount -v --bind /dev /mnt/lfs/dev mount -vt devpts devpts /mnt/lfs/dev/pts mount -vt tmpfs shm /mnt/lfs/dev/shm mount -vt proc proc /mnt/lfs/proc mount -vt sysfs sysfs /mnt/lfs/sys chroot /mnt /usr/bin/env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin /bin/bash --login
ignore this stuff below, since I now use the base LFS, then use ports from there
This is continued configuration of my LFS system, just after the last page of the LFS manual, either from within chroot or from actual booted LFS
Follow this order, for dependencies Simply google packagename LFS to find it, its usually in the BLF book. I also attempt the latest versions of the software instead of what BLFS has. REMEMBER: I download all software to /home/lfs/build and configure as the lfs user, then install using fakeroot as the ROOT user
Remember I install all packages to /usr/local
Remember with fakeroot its not always make DESTDIR=$FAKEROOT install sometimes DESTDIR is INSTALL_PREFIX or INSTALL_ROOT... read the INSTALL file for each package to find out.
Since I install all additional software to /usr/local all their libraries are also installed to /usr/local/lib and sometimes the program is looking for /usr/lib instead, one example is wget and libgnutls.so.28. One solution is to find all libraries with ldd /usr/local/bin/wget and make sure none say "not found", if one is not found then create a ln -s ../local/lib/libgnutls.so.28 /usr/lib. There is also an environment variable that allows you to change the search paths for libraries, though Its not recommended, see http://www.wiredrevolution.com/system-administration/how-to-correctly-use-ld_library_path
Downloaded blfs directory on 2012-01-19 for my LFS 7.0 build. Find it at /nwq/admin/www/data/mrcore_files/lfs/manual/blfs or http://mreschke.com/files/lfs/manual/blfs
I choose to install all additional software beyond the regular LFS base into /usr/local NOT /usr! This means use ./configure --prefix=/usr/local etc...
Recommends configuring all packages as a normal user, then installing with root
These are not installed on sda13 yet, just for notes
When customizing the kernel, any item marked as M means it will not be compiled directly into the kernel but placed on your filesystem (your regular root fs, not an initrd) as a module in /lib/modules. LFS recommends that most items NOT be marked as module, but compiled directly (denoted by a *). Also note the LFS does NOT use any sort of initrd, so any modules required to boot must be compiled (like sata, pata, ext3/4...). I have less than 1mb of /lib/modules while ubuntu has 117mb Though the more modules or build-in items you have the more hardware your kernel can boot.
I moved the kernel from /source/linux-3.1 to /usr/src/linux-3.1 so I can re-compile later
Get the boot penguin logo: http://www.articleworld.org/index.php/How_to_change_the_Linux_penguin_boot_logo
http://mreschke.com/files/lfs/manual/7.0/chapter08/kernel.html
From chroot on archdev Customize the kernel config with cd /usr/src/linux-3.1; make menuconfig Then to deploy the new kernel use
compile and install the kernel
make make modules_install cp -v arch/x86/boot/bzImage /boot/vmlinuz-3.1-lfs-7.0 cp -v System.map /boot/System.map-3.1 cp -v .config /boot/config-3.1