Code Monkey home page Code Monkey logo

alfs's Introduction

Automated Linux From Scratch 10.0 (SysV)

Tested with Debian 10 Buster.

This project is based on the Official LFS 10.0 Book

http://lfs.mirror.fileplanet.com/lfs/view/10.0/

Package Requirements

Add the following packages

sudo apt install build-essential bison gawk git htop texinfo

Set these Enviornment Variables

export LFS=/mnt/lfs
export ALFS=/mnt/lfs/alfs

LFS Partition

⚠️ wipes the /dev/sdb drive

Create a new ext4 parition /dev/sdb1 (option n) and make it bootable (option a)

sudo fdisk /dev/sdb

Mount new ext4 partition

sudo mkdir $LFS
sudo mount -t ext4 /dev/sdb1 $LFS

Prepare Host

Grab the alfs project files

sudo git clone https://github.com/mattwind/alfs.git $ALFS
cd $ALFS

Verify required programs

sudo $ALFS/version_check.sh

Download toolchain source code from wget-list

sudo -E $ALFS/get_packages.sh

Setup the LFS user environment

sudo -E $ALFS/useradd_lfs.sh

Build Toolchain

These scripts are required to run as the new lfs user

sudo su lfs 
$ALFS/scripts/build_toolchain.sh
$ALFS/scripts/build_temp-toolchain.sh
exit

Build LFS System

Run as root with environment variables set earlier

sudo -E $ALFS/scripts/build_lfs.sh

Grub Bootloader

Below the warning is how I installed grub while inside the chrooted LFS system

Consider reading the LFS book for backing up your bootloader.

http://lfs.mirror.fileplanet.com/lfs/view/stable/chapter10/grub.html

⚠️ make certain you are in chroot
grub-install --root-directory=/ /dev/sdb
grub-mkconfig -o /boot/grub/grub.cfg

Grub Tweaks

Updating grub defaults

vi /etc/default/grub

Get friendly eth0 network names and qemu console on boot.

GRUB_TERMINAL=console
GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 biosdevname=0"

Remember to run grub-mkconfig to apply new grub default settings.

grub-mkconfig

Extra Scripts

Confirm that LFS and ALFS environment variables are both set and LFS partition is mounted.

Re-enter chroot and pass partition

sudo -E $ALFS/extras/chroot.sh /dev/sdb1

Emulate the LFS system with qemu (pass drive)

sudo -E $ALFS/extras/qemu.sh /dev/sdb

Notes

The root password in the LFS chrooted system is root.

LFS User

The lfs user on the host system can be deleted with sudo deluser lfs the lfs user /home/lfs folder can also be removed. It is only required to build the first toolchain.

Kernel Panic

This can happen if you are trying to boot from qemu and the entry for root=/dev/??? is not sda

Simply edit vi /boot/grub/grub.cfg and change root references to sda1

root=/dev/sda1

When I am booting from my physical server I had to set it back to sdb1, because sda is my primary Debian installation.

root=/dev/sdb1

References

Linux From Scratch 10 Book

http://lfs.mirror.fileplanet.com/lfs/view/10.0/

Beyond Linux From Scrach 10 Book

http://lfs.mirror.fileplanet.com/blfs/view/10.0/

Added compressed single page versions to the books directory

alfs's People

Contributors

mattwind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.