This repo contains software to build linux from scratch and package it into rpm files.
Go to file
Chris Cromer 726e6c5fc8 Merge pull request '9.1' (#1) from 9.1 into master 2020-06-02 00:45:18 -04:00
BOOK update book to 9.1 2020-05-31 11:47:17 -04:00
SOURCES update specs for 9.1 2020-06-01 16:11:06 -04:00
SPECS fix missing folder 2020-06-02 00:14:20 -04:00
.gitignore update gitignore 2020-05-30 23:17:42 -04:00
LICENSE 2019-05-24 2019-05-24 08:27:40 -04:00
README.MD fix case of examples in readme 2020-05-31 16:24:05 -04:00
TODO 2019-05-25 2019-05-25 20:27:33 -04:00 remove python 2 2020-06-01 22:41:14 -04:00 update scripts for 9.1 2020-05-31 13:19:17 -04:00
cromer-todo update todo 2020-06-01 16:11:32 -04:00 update scripts for 9.1 2020-05-31 13:19:17 -04:00 update scripts for 9.1 2020-05-31 13:19:17 -04:00 fix spacing 2020-05-31 14:15:18 -04:00 remove openmp since lfs doesn't have it 2020-05-31 19:07:56 -04:00 2019-05-24 2019-05-24 08:27:40 -04:00



This build tracks linux from scratch version 9.1


1. git installed on the host
2. wget on host system
3. Directory for build, mounted at /mnt/lfs

	There will need to be a partition mounted there.
	You will be responsible for that.
	This build system uses whatever filesystem that is present at ${LFS}

4. run and install required packages if needed


This build system is designed in such a way to not be
able to trash your host system.  Mistakes can happen.
I am not responsible for trashed host systems.  You
bear all responsibilities for any failures.


This system was designed and debugged on an AMD64 {x86_64} system
and does not support i686.

The build system installs/work directory:

This build has a mkinitramfs step (which requires cpio) this step
creates an initrd so cpu updates and firmware is loaded.
Your lfs kernel should be configured to use this.

This build has linux-firmware to provide firmware for various
See BLFS book for more information.

I have installed rpm macro files in:
This makes the rpm environment correct so it builds
the base system correctly.


  • rpm
    • the package manager
  • mkinitramfs
    • to create initramfs
  • cpio
    • needed for mkinitramfs
  • popt
    • needed for rpm
  • python2
    • needed for rpm
  • wget
    • needed to fetch packages
  • linux-firmware
    • needed to boot under certain hardware


login as root user
fdisk /dev/sdx				partition drive, you need to do this
mkfs.ext4 /dev/sdxx			create ext4 filesystem

install -vdm 755 /mnt/lfs		create lfs directory
mount /dev/sdxx /mnt/lfs		mount partition to work directory
install -vdm 755 /mnt/lfs/usr/src	create build directory
cd /mnt/lfs/usr/src			goto build directory

Now fetch the build system it will go into /mnt/lfs/usr/src/LFS-RPM by default
git clone

cd LFS-RPM				Lets do this
./				setup environment and fetches source tarballs
./				build it
./				cleanup host

Build at this point is complete.
All that is needed is to install grub and/or add a menu item in the
the grub configuration file /boot/grub.cfg

This completes the build.


GPT partitioned drive
menuentry 'Linux From Scratch (9.1) (on /dev/sdxx)' {
	insmod part_gpt
	insmod ext2
	set root='hdx,gptx'
	linux /boot/vmlinuz-5.5.3 root=/dev/sdxx
	initrd /boot/initrd.img-5.5.3

MSDOS/BIOS partitioned drive
	menuentry 'Linux From Scratch (9.1) (on /dev/sdxx)' {
	insmod part_msdos
	insmod ext2
	set root='hdx,msdosx'
	linux /boot/vmlinuz-5.5.3 root=/dev/sdxx
	initrd /boot/initrd.img-5.5.3
Change the x's to the proper drives and partition


The script will take the binary rpms (chapter 6) and
install them into a partition that YOU mounted on /mnt. If you want
to install else where then change ROOTPATH="/mnt" to the installation
partition mounted by YOU.


    • builds chapter 6
    • cleanup host system after build
    • install rpm binaries to mounted partition
    • builds the whole thing
    • configure for build
    • builds chapter 5
    • checks host system for requirements