/LFSInstaller

Linux From Scratch Installation Script Template Generator

Primary LanguageHTMLMIT LicenseMIT

LFSInstaller - Linux From Scratch Script Template Installer

Logo Banner

Linux From Scratch installation script template generator that produces installation script(s) that matches your preference on how you want to install Linux From Scratch automatically. LFSInstaller extends from the original implementation of ALFS by version selection of older LFS release builds and preference of the installation types with minimum requirement of manual interference.

Getting LFSInstaller

Clone LFSInstaller repository to a suitable directory.

git clone https://github.com/eliaz5536/LFSInstaller.git

Go into the repository directory and add execute permission to LFSInstaller.sh.

cd /LFSInstaller
chmod +x LFSInstaller.sh

Execute the shell script (It is recommended that you execute as a root user).

./LFSInstaller.sh

To create your first LFS installation script to start your installation, perform the following command which will go through interactive mode if no arguments have passed:

./LFSInstaller.sh -c

Interactive Installation

If you want to immediately create LFS Installation script with arguments, you can pass those arguments with the following command with this example to have a head start of creating the installation script(s):

./LFSInstaller.sh -c -v=<VERSION> -p=<PARTITION> -sp=<SWAP_PARTITION> -vc=<VERSION_CODENAME> -dc=<DISTRIBUTION_CODENAME> -c
./LFSInstaller.sh -c --version=<VERSION> --partition=<PARTITION> --swap-partition=<SWAP_PARTITION> --version-codename=<VERSION_CODENAME> --distribution-codename=<DISTRIBUTION_CODENAME> -c

Interactive Installation with arguments

You can easily initialize the installation process (single or phase-by-phase) after the creation of the installation script(s) by executing one of the following commands:

./LFSInstaller.sh --install
./LFSInstaller.sh -i

Features

Installation Types

You can select two types of installation scripts that you want to produce which are the following and can be executed as it follows:

Single

The installation will be produced as a single script that will append the installation of packages into the main installation script install.sh. The commands can be executed through the following:

./LFSInstaller.sh --install-type=single -c
./LFSInstaller.sh --install-type=s -c
./LFSInstaller.sh -it=single -c
./LFSInstaller.sh -it=s -c

Phases

The installation will be installed in phases, meaning that each stage of the installation will be created as each script in order to ensure that the following target machine meets its requirements. The phases can be represented as such:

Version 10 and above
Installation Lifecycle Installation State Installation Description
Phase 1 Build Preparation Creating and setting up LFS partition in order to build the LFS system.
Phase 2 Cross Toolchain Compiling and installing cross toolchain (binutils, gcc and glibc) and temporary tools using the cross-toolchain.
Phase 3 Chroot Entering chroot environment on the isolated LFS system to install selected packages.
Phase 4 System Configuration Setting up system configuration such as the kernel and bootloader.
Version 9
Installation Lifecycle Installation State Installation Description
Phase 1 Build Preparation Creating and setting up LFS partition in order to build the LFS system.
Phase 2 Cross Toolchain & Chroot Compiling cross toolchain with temporary tools and entering chroot environment to install selected packages.
Phase 4 System Configuration Setting up system configuration such as the kernel and bootloader.

The commands can be executed through the following:

./LFSInstaller.sh --install-type=phase -c
./LFSInstaller.sh --install-type=p -c
./LFSInstaller.sh -it=phase -c
./LFSInstaller.sh -it=p -c

Warning

It is highly recommended that you compile and install Linux From Scratch through phase-by-phase installation type to ensure that your isolated system is properly configured and set up correctly from each step of the installation to your own liking.

Important

It is essential and a must that you must review and modify the installation script(s) before initializing the installation to ensure that there are no conflicts or major errors prone to interfere during the installation process.

Automatic Mounting and Unmounting

You can mount the LFS mounting point to the target partition and unmount automatically with certain flags that you can pass through to perform such process through the following: You can mount your preferred target partition to the LFS mounting point and vice-versa automatically by executing one of the following commands that will also create directories for further modification of the LFS filesystem such as the virtual kernel file systems:

Mounting

./LFSInstaller.sh --mount
./LFSInstaller.sh -m

Mounting

Unmounting

./LFSInstaller.sh --unmount
./LFSInstaller.sh -um

Unmounting

Entering Chroot Environment

If the mount is successful and you completed two phases of installation, you can enter chroot environment to install packages of your choice in an isolated environment. However, your LFS drives must be mounted and with addition that the cross toolchain tools are compiled such as coreutils to access environment:

./LFSInstaller.sh --chroot

Version Selection (Release Selection)

If you're unsure if the latest release build of LFS is compatible with your kernel or hardware for installation, you can select the version of your choice by passing the argument '--version' or '-v' of the following which you can specify the build version to install specific version of packages of your choice:

./LFSInstaller --version=12.2 -c
./LFSInstaller -v=12.2 -c

If you are uncertain about the version that you can choose from, you can execute this command to display the list of release builds of LFS:

./LFSInstaller --version-list

version-list

The following release builds of LFS that you can select from are the following:

Release Build Version Release Date
LFS-12.2 Release 12.2 2024/09/01
LFS-12.2-rc1 Release 12.2-rc1 2024/08/18
LFS-12.1 Release 12.1 2024/03/01
LFS-12.2-rc1 Release 12.2 2024/02/15
LFS-12.0 Release 12.0 2023/09/01
LFS-12.0-rc1 Release 12.0-rc1 2023/08/15
LFS-11.3 Release 11.3 2023/03/01
LFS-11.3-rc1 Release 11.3-rc1 2023/02/14
LFS-11.2 Release 11.2 2022/09/01
LFS-11.2-rc1 Release 11.2-rc1 2022/08/21
LFS Stable Version 11.1 Release 11.1 2022/03/01
LFS-11.1-rc1 Release 11.1-rc1 2022/02/15
LFS-11.0 Release 11.0 2021/09/01
LFS-11.0-rc3 Release 11.0-rc3 2021/08/25
LFS-11.0-rc2 Release 11.0-rc2 2021/08/20
LFS-11.0-rc1 Release 11.0-rc1 2021/08/15
LFS Stable Version 10.1 Release 10.1 2021/03/01
LFS-10.1-rc1 Release 10.1-rc1 2021/02/19
LFS Stable Version 10.0 Release 10.0 2020/09/01
LFS-10.0-rc1 Release 10.0-rc1 2020/08/15
LFS Stable Version 9.1 Release 9.1 2020/03/01
LFS 9.1-rc1 Release 9.1-rc1 2020/02/14
LFS Stable Version 9.0 Release 9.0 2019/09/01
LFS 9.0-rc1 Release 9.0-rc1 2019/08/15

Automatic Disk Management & Partition Selection

If you have not created a partition before initializing the LFS installation and you do not want to go through the manual configuration of creating such partition, you can create your partition through LFSInstaller by the following command:

./LFSInstaller --create-partition

partition

The following process scans a list of disk utility and management application in your host machine, by which you can select such software in order to proceed with partitioning.

Disk Utility Programs
cfdisk
fdisk
parted
gparted
gdisk

Help

LFSInstaller
 
LFS Script Installer by which the user can decide how they want to customize their own package.
This is designed to be a template starter for Linux enthusiasts who want to 

Usage: ./LFSInstaller.sh [modes] [options] [others]
It is recommended to execute this script as a root user.

Modes: 
  -c, --create									Generates LFS installation script
  -i, --install									Starts LFS Installation script
  -it, --install-type								Specifies installation type
  --create-partition								Specifies new device blocks of partition
  -m, --mount									Mounts LFS to a target partition
  -um, --unmount								Unmounts LFS from a target partition
  --chroot									Enters chroot environment on an isolated machine

Options:
  -v, --version									Specifies LFS Release Build Version
  -p, --partition								Specifies partition
  -sp, --swap-partition								Specifies SWAP partition
  -vc, --version-codename							Specifies version codename
  -dc, --distrib-codename							Specifies distrib codename
 
Others:
  -h, --help									Show help message
  -u, --usage									Show usage information
  --version-list								Show list of LFS Release Builds
 
Examples:
  ./LFSInstaller -m								Initializes mounting procedure
  ./LFSInstaller -c								Creates standard installation script in interactive mode (if no values have passed)
  ./LFSInstaller --partition=/dev/sda1 --install-type=phase -c		        Creates installation script, on the '/dev/sda1' partition, which will create shell script as phases.
  ./LFSInstaller --version=9.0 -c						Creates installation script that uses the release build version '9.0'

Usage

LFSInstaller
 
Usage: ./LFSInstaller.sh [modes] [options] [others]
It is recommended to execute this script as a root user.

License

This project is licensed under MIT License. See the LICENSE file for details.