best way to distribute lfs to other systems

Alexander E. Patrakov see at the.sig
Fri Apr 23 07:25:58 PDT 2004

Duane Cox wrote:
> Hello
> I've just compiled my first LFS system, based on the current CVS but
 > substituing a few enhancements and Glibc-2.3.2.
> I want to distribute this across my network to other servers.
 > What would be the best way to do this?
 > Tar up my LFS and put it on a CD, create a bootable CD and untar it
 > to the approprate disks, then edit a few of the files, and be done?

Yes, this is a working method. I used it to install cross-compiled LFS 
to i586 computers used as routers and fax servers.

> I'm curious if someone has a "best practices" to deploy your LFS to other hosts. 

The method described above leads to maintenance nightmare if you want to 
support two dozens of identical computers in a lab. Sofware updates 
become a horror even with a package manager. Instead, I set up a NFS 
server and configured all workstations to boot from the network (via 
Etherboot) with their root filesystem on NFS. Note that you must have a 
gigabit ethernet card and a fast RAID array on your server, and that's 
still slow as compared to a local hard disk on each workstation. Yes, my 
workstations are completely diskless.

Since there is always some per-host configuration, I created a script 
that does some additional mounting to achieve this. Put it into 
/etc/rc.d/init.d/owncopy and make the S45owncopy symlink in 
/etc/rc.d/rcsysinit.d. It will create directories named 
/tmp/PER_HOST/xxx, /var/PER_HOST/xxx and /etc/local/PER_HOST/xxx where 
xxx is the last octet of the IP address of the client. The initial 
contents of these directories are copied from /tmp, /var and /etc/local 
excluding the PER_HOST subdirectory and they persist until a forced 
update. To force an update for one workstation, create empty files 
/tmp/PER_HOST/xxx/OLD, /var/PER_HOST/xxx/OLD and /etc/local/xxx/OLD.

Then the script mounts these directories on top of /tmp, /var and 
/etc/local, respectively. The script also replaces the "--IP--" string 
in all template files in /etc/local with the last octet of the IP address.

Oh, I forgot to tell you the purpose of /etc/local! All host-specific 
config files (like smb.conf) are moved there, and replaced by symlinks 
pointing to there. One exception is /etc/mtab, a symlink to /proc/mounts.

I also modified the "swap" script to create a swap file in 
/var/swap/pagefile (remember that /var/PER_HOST/xxx is mounted on top of 
/var). I had to move its start symlink to S55swap.

Since the kernel configures the ethernet card automatically via DHCP 
when built properly, you have to disable the "network" initscript.

Don't list the NFS root filesystem in /etc/fstab.

Looks like that's all. Use the scripts at your own risk - they are for 
LFS 4.x but may still work. Questions and comments are welcome.

Alexander E. Patrakov
To get my address: echo '0!42!+/6 at 5-3.535.25' | tr [!-:] [a-z] | tr n .
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: owncopy
URL: <>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: swap
URL: <>

More information about the blfs-support mailing list