Linux From Scratch
Find a file
Victor-ray, S. 79acb5c8f9
❯ Readme
᛫ Changed the readme slightly.

Signed-off-by: Victor-ray, S. <git@zendai.net.eu.org>
2026-04-08 22:04:57 +02:00
.gitignore ❯ Creation 2026-04-03 19:37:32 +02:00
10-create_iso.sh Some minor changes in the files. 2026-04-03 22:05:00 +02:00
20-mount.sh Some minor changes in the files. 2026-04-03 22:05:00 +02:00
22-unmount.sh Some minor changes in the files. 2026-04-03 22:05:00 +02:00
30-download_packages.sh Some minor changes in the files. 2026-04-03 22:05:00 +02:00
40-build_user.sh Some minor changes in the files. 2026-04-03 22:05:00 +02:00
42-build_user_script.sh Some minor changes in the files. 2026-04-03 22:05:00 +02:00
50-chroot.sh ❯ edit: 60-build_system.sh 2026-04-04 01:12:07 +02:00
51-enter_chroot.sh ❯ Last steps 2026-04-05 17:52:34 +02:00
52-chroot_shutdown.sh ❯ edit: 60-build_system.sh 2026-04-04 01:12:07 +02:00
60-build_system.sh ❯ fix: extra pkg curl 2026-04-05 23:51:36 +02:00
70-system_configuration.sh ❯ Last step 2026-04-05 19:06:35 +02:00
80-bootable.sh ❯ fix: name 2026-04-05 23:06:56 +02:00
90-finalize.sh ❯ Last step 2026-04-05 19:06:35 +02:00
lib ❯ Last step 2026-04-05 19:06:35 +02:00
LICENSE.txt ❯ Tidy 2026-04-08 19:14:20 +02:00
README.md ❯ Readme 2026-04-08 22:04:57 +02:00
ready_to_build.sh ❯ edit: 60-build_system.sh 2026-04-04 01:12:07 +02:00
variables ❯ Tidy 2026-04-08 19:14:20 +02:00
version-check.sh ❯ Creation 2026-04-03 19:37:32 +02:00
wget-list-systemd ❯ Complete! 2026-04-05 17:24:29 +02:00

Linux From Scratch

This is a personal project of mine where I learned from Linux From Scratch and created these build scripts to build a linux distribution.

I have changed it somewhat though and I'm instead building within a disk image (img/iso).

v. 12.4-systemd

🚨 🚧 Important 🚧 🚨

  • ⛑️ Run version-check.sh to check for the necessary development tools.
  • Turn off/disable automatic mounting, i.e udiskie.
  • Always run 52-chroot_shutdown.sh after you exit chroot or exit with CTRL + C.
    • 💥 If you reboot or shutdown your computer while {dev,proc,sys,run} are mounted the system may become unbootable.

Project overview
├── version-check.sh Use to check for the required build dependencies of LFS.
├── variables Set configurations here.
├── ready_to_build.sh This script will go through the steps to complete a build.
├── wget-list-systemd This file contains all the package URL's to download with wget.
├── lib Bash library file containing helper functions.
├── 10-create_iso.sh Creates the ISO disk image file that will become the build environment.
├── 20-mount.sh Creates and mounts the disk image to designated mountpoints.
├── 22-unmount.sh Can be used to unmount the disk image.
├── 30-download_packages.sh Downloads the packages using the URL's listed in the wget-list-systemd file.
├── 40-build_user.sh Creates the build user.
├── 42-build_user_script.sh The build script that the build user runs to compile necessary build tools and packages.
├── 50-chroot.sh Prepares the chroot environment then enters it.
├── 51-enter_chroot.sh Can be used to enter the chroot environment of an existing ISO disk image build.
├── 52-chroot_shutdown.sh Must be used after exiting the chroot environment to safely disconnect. IMPORTANT!
├── 60-build_system.sh Builds the system packages and tools.
├── 70-system_configuration.sh Configures the system.
├── 80-bootable.sh Makes the system bootable. (EFI/UEFI)
└── 90-finalize.sh The final steps.

Build disk image (IMG)

This repository is for creating a base linux system with a disk image file.

Run the following as root user.

bash ready_to_build.sh

This will start the build process and create a disk image file, build all the necessary tools, download packages to the chroot environment, enter the chroot enironment and then complete the system build within chroot.

Root password: builderpass

During the installation a new password is required to be set for the new OS's root user inside chroot as the shadow package is being installed.

You can change this in 60-build_system.sh.

Once you have a disk image locally you can use the helper scripts to enter or exit the image.

51-enter_chroot.sh will take you into the chroot environment of an existing ISO disk image.

52-chroot_shutdown.sh will unmount the disk image after you exit chroot including disconnecting the loop devices, the device tree from your local kernel ({dev,proc,sys,run}), and the regular mountpoints.

Chapters progression

  • 01
  • 02
  • 03
  • 04
  • 05
  • 06
  • 07
  • 08
  • 09
  • 10
  • 11 🎉