2020-05-31 16:22:10 -04:00
|
|
|
# OVERVIEW:
|
2020-05-31 13:19:17 -04:00
|
|
|
This build tracks linux from scratch version 9.1
|
2020-05-31 16:22:10 -04:00
|
|
|
|
|
|
|
# REQUIREMENTS:
|
2019-05-24 08:27:40 -04:00
|
|
|
1. git installed on the host
|
|
|
|
2. wget on host system
|
|
|
|
3. Directory for build, mounted at /mnt/lfs
|
|
|
|
|
2020-05-31 16:22:10 -04:00
|
|
|
There will need to be a partition mounted there.
|
2019-05-24 08:27:40 -04:00
|
|
|
You will be responsible for that.
|
2020-05-31 16:22:10 -04:00
|
|
|
This build system uses whatever filesystem that is present at ${LFS}
|
2019-05-24 08:27:40 -04:00
|
|
|
|
|
|
|
4. run version-check.sh and install required packages if needed
|
2020-05-31 16:22:10 -04:00
|
|
|
|
|
|
|
# WARNING:
|
2019-05-24 08:27:40 -04:00
|
|
|
This build system is designed in such a way to not be
|
|
|
|
able to trash your host system. Mistakes can happen.
|
2020-05-31 16:22:10 -04:00
|
|
|
I am not responsible for trashed host systems. You
|
2019-05-24 08:27:40 -04:00
|
|
|
bear all responsibilities for any failures.
|
2020-05-31 16:22:10 -04:00
|
|
|
|
|
|
|
# GENERAL NOTES:
|
2019-05-24 08:27:40 -04:00
|
|
|
This system was designed and debugged on an AMD64 {x86_64} system
|
2020-05-31 13:19:17 -04:00
|
|
|
and does not support i686.
|
2019-05-24 08:27:40 -04:00
|
|
|
|
|
|
|
The build system installs/work directory:
|
|
|
|
/mnt/lfs/usr/src/LFS-RPM
|
|
|
|
|
2020-05-31 16:22:10 -04:00
|
|
|
This build has a mkinitramfs step (which requires cpio) this step
|
2019-05-24 08:27:40 -04:00
|
|
|
creates an initrd so cpu updates and firmware is loaded.
|
|
|
|
Your lfs kernel should be configured to use this.
|
|
|
|
|
2020-05-31 13:19:17 -04:00
|
|
|
This build has linux-firmware to provide firmware for various
|
|
|
|
hardware.
|
2019-05-24 08:27:40 -04:00
|
|
|
See BLFS book for more information.
|
|
|
|
|
|
|
|
I have installed rpm macro files in:
|
|
|
|
/home/lfs/.rpmmacros
|
|
|
|
This makes the rpm environment correct so it builds
|
|
|
|
the base system correctly.
|
2020-05-31 16:22:10 -04:00
|
|
|
|
|
|
|
# ADDITIONS:
|
|
|
|
- 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
|
|
|
|
|
|
|
|
# BUILD PROCEDURE:
|
2019-05-24 08:27:40 -04:00
|
|
|
login as root user
|
2020-05-30 23:07:41 -04:00
|
|
|
fdisk /dev/sdx partition drive, you need to do this
|
2019-05-24 08:27:40 -04:00
|
|
|
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
|
2020-05-31 13:19:17 -04:00
|
|
|
git clone https://git.cromer.cl/cromer/LFS-RPM.git
|
2019-05-24 08:27:40 -04:00
|
|
|
|
|
|
|
cd LFS-RPM Lets do this
|
|
|
|
./setup.sh setup environment and fetches source tarballs
|
|
|
|
./lfs.sh build it
|
|
|
|
./cleanup.sh 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
|
2020-05-31 16:22:10 -04:00
|
|
|
|
|
|
|
This completes the build.
|
|
|
|
|
2020-05-31 16:24:05 -04:00
|
|
|
# GRUB EXAMPLES:
|
2019-05-24 08:27:40 -04:00
|
|
|
|
|
|
|
GPT partitioned drive
|
2020-05-31 13:19:17 -04:00
|
|
|
menuentry 'Linux From Scratch (9.1) (on /dev/sdxx)' {
|
2019-05-24 08:27:40 -04:00
|
|
|
insmod part_gpt
|
|
|
|
insmod ext2
|
|
|
|
set root='hdx,gptx'
|
2020-05-31 13:19:17 -04:00
|
|
|
linux /boot/vmlinuz-5.5.3 root=/dev/sdxx
|
|
|
|
initrd /boot/initrd.img-5.5.3
|
2019-05-24 08:27:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
MSDOS/BIOS partitioned drive
|
2020-05-31 13:19:17 -04:00
|
|
|
menuentry 'Linux From Scratch (9.1) (on /dev/sdxx)' {
|
2019-05-24 08:27:40 -04:00
|
|
|
insmod part_msdos
|
|
|
|
insmod ext2
|
|
|
|
set root='hdx,msdosx'
|
2020-05-31 13:19:17 -04:00
|
|
|
linux /boot/vmlinuz-5.5.3 root=/dev/sdxx
|
|
|
|
initrd /boot/initrd.img-5.5.3
|
2019-05-24 08:27:40 -04:00
|
|
|
}
|
|
|
|
Change the x's to the proper drives and partition
|
2020-05-31 16:22:10 -04:00
|
|
|
|
|
|
|
# INSTALLER SCRIPT:
|
|
|
|
The installer.sh script will take the binary rpms (chapter 6) and
|
|
|
|
install them into a partition that YOU mounted on /mnt. If you want
|
2019-05-24 08:27:40 -04:00
|
|
|
to install else where then change ROOTPATH="/mnt" to the installation
|
|
|
|
partition mounted by YOU.
|
2020-05-31 16:22:10 -04:00
|
|
|
|
|
|
|
# SCRIPTS:
|
|
|
|
- base.sh
|
|
|
|
- builds chapter 6
|
|
|
|
- cleanup.sh
|
|
|
|
- cleanup host system after build
|
|
|
|
- installer.sh
|
|
|
|
- install rpm binaries to mounted partition
|
|
|
|
- lfs.sh
|
|
|
|
- builds the whole thing
|
|
|
|
- setup.sh
|
|
|
|
- configure for build
|
|
|
|
- tools.sh
|
|
|
|
- builds chapter 5
|
|
|
|
- version-check.sh
|
|
|
|
- checks host system for requirements
|