Linux SIG - Building a Linux System from Scratch

Building a Linux System from Scratch

by Matthew Feldt

Preparing to install Linux

  1. Run fdisk to create Linux partitions
  2. Create Linux filesystems in newly created partitions
    mke2fs -c /dev/hdb2
  3. Copy Linux boot/root diskette to the target root file system
    cp -dpR /dev/fd0 /mount
  4. Set up fstab and kernel image to boot fixed disk image
    Add /dev/hdb2 / ext2 defaults to fstab
    rdev /vmlinuz /dev/hdb2
  5. Installed binary GCC
  6. Upgraded to ELF using disc3/tsx-11/packages/GCC files


Potentially Useful Hints

  1. Had to add runlevels 0 and 6 to /etc/inittab to handle halts and reboots respectively. Fix boot/root disk.
  2. Kernel handle mounting root file system read only so it can be checked, a line to remount the root file system read/write must be added to an rc script. Fix boot/root disk.
  3. If a particular directory is used as a mount point all the file in that directory and below will not be seen while the other partition is mounted there.
  4. Stripped binaries reduced to 25% of their size.
  5. ls_lr and the LSM were instrumental in finding the utilities needed to build the system. The INDEX files in all the sunsite subdirectories were also useful when choosing which particular implementation of a utility I wanted when there was a choice.
  6. For the GNU configure scripts to work the following utilities were needed: bison, cmp, cp, echo, find, grep, gzip, install, ln, mkdir, ranlib, rm, sed, tar, tr, vi, yacc.
  7. make -n install prints the actions make install would perform without doing it.
  8. Many GNU utilities come with make check.
  9. Needed to add devices lpt1 and lpt2. Fix boot/root disk.
  10. Sunsite:/pub/Linux/system has most of the system source code files needed to implement a basic Linux system.
  11. Slackware has binaries in /etc/fs <- evil dig against their FSSTND compliance, or lack thereof.
  12. If Linux display gets destroyed due to cat'ing a binary or something the command echo ^O (typed echo CTRL-v CTRL-o) will fix the display.
  13. Highlights of fileutils: chgrp, chmod, chown, cp, dd, df, du, install, ls, mkdir, mv, rm, sync, version.
  14. Highlights of textutils: cat, head, join, paste, sort, split, sum, tail, tr, uniq, wc.
  15. Highlights of sh-utils: basename, date, dirname, echo, env, expr, false, hostname, id, nice, pwd, sleep, stty, su, test, true, users, who, yes.


Last Modified: 18 October 1995
St. Louis Unix Users Group - Linux SIG