CNT5605 - 2017 Summer

Assignment: Linux From Scratch 8.0 (LFS 8.0) installation preliminaries

Objective

Build a new Linux From Scratch (LFS) system using QEMU's x86_64 emulation for your platform. ALL WORK ON THIS ASSIGNMENT MUST BE DONE IN THE NETWORKING LAB IN LOVE 016. I will verify that your machine has been used to do this assignment. All testing of your work products will be done on your assigned machine.

DO NOT RUN QEMU AS ROOT!

Assignment Details

Building Linux From Scratch (LFS) is a challenging and rewarding exercise for a system administrator. In doing this assignment, you will become thoroughly familiar with all of the parts of a Linux system.

First, install QEMU, a virtualization environment; you can read about using QEMU in Debian at https://wiki.debian.org/QEMU, but the fundamental step is along the lines of

% apt-get install qemu qemu-kvm qemu-system

Now create two new QEMU image files:

% cd qemu-images
% qemu-img create salix.img 11G
% qemu-img create lfs.img 11G
      

Please use two 11 gigabyte partitions; LFS is a source code install with heavy testing requirements, and 11 gigabytes give you a generous amount of space to work in. Likewise, your host system should need about 11 gigabytes.

As to your "host system", please use Salix 14.2's XFCE install image. Salix is a Slackware distribution, and it is an outstanding platform to build LFS from.

Once you have your installation image, you can boot it and install Salix to the salix.img image:

% qemu-system-x86_64 -cdrom salix64-xfce-14.2.iso -hda salix.img -boot d -m 2048 -enable-kvm
      

One thing to note about the Salix installation: when I chose the default site for updates, it was "http://salix.hostingxtreme.com", but the website was not responsive (and when I check this morning (2017-06-19), it still wasn't), I changed the files in /etc/slapt-get/ to use "http://mirrors.xmission.com/salix" instead.

Once you have installed Salix to the image salix.img, you can now boot it up, adding your target lfs.img image where you will begin building LFS 8.0:

% qemu-system-x86_64 -hda salix.img -hdb lfs.img -boot c -m 8192 -enable-kvm
      

The installation book for LFS 8.0 can be found here. Please start reading from the beginning; you should be finished with Chapter 5 by June 26. Please note that your mount point /mnt/lfs should be pointed at /dev/sdb1.

Filesystem        Size    Used  Avail  Use%  Mounted on
/dev/root         10.8G    4.2G   6.1G   45%  /
/dev/sdb1         10.8     374M   9.9G    4%  /mnt/lfs
      

I would suggest adding an entry to /etc/fstab so that you don't have to remount /mnt/lfs by hand each time you reboot.

/dev/sdb1   /mnt/lfs     ext4   defaults   0   1
    

The admonitions in chapter 2 "Building LFS in stages" are an excellent checklist for making sure that your build is a success. In particular, you must make sure that each time that you reboot your Salix host system that you follow the guidelines in Mounting and Populating /dev and Mounting Virtual Kernel File Systems

Please note that the final deliverables for this project will be a completed LFS 8.0 lfs.img file, and an intermediate copy of the same file from the end of Chapter 5 named lfs-CHAPTER5.img.

(Chapter 5 is where you build your intermediate tool chain before going into the chroot environment.) You should be finished with Chapter 5 by Monday, June 26; please come by my office hours on Monday, June 26 so that we can verify your progress (I will also be available from 10:45 to noon to verify your work, if that's more convenient.) You must have networking enabled and working; I will retrieve a webpage (probably http://www.google.com), so please make sure that your installation is able to do this before we review your work.

The deadline for finishing this project is July 17.

Extra credit opportunity: You can earn extra credit for each week that you turn this assignment early.

  1. Submit entire and functional LFS project (both lfs.img and lfs-CHAPTER5.img) by June 26: 5 points.
  2. Submit entire and functional LFS project (both lfs.img and lfs-CHAPTER5.img) by July 3: 4 points.
  3. Submit entire and functional LFS project (both lfs.img and lfs-CHAPTER5.img) by July 10: 2 points.