Linux SIG - Building a Linux System from Scratch
Building a Linux System from Scratch
by Matthew Feldt
Preparing to install Linux
- Run
fdisk
to create Linux partitions
- Create Linux filesystems in newly created partitions
mke2fs -c /dev/hdb2
- Copy Linux boot/root diskette to the target root file system
cp -dpR /dev/fd0 /mount
- Set up fstab and kernel image to boot fixed disk image
Add /dev/hdb2 / ext2 defaults
to
fstab
rdev /vmlinuz /dev/hdb2
- Installed binary GCC
- Upgraded to ELF using disc3/tsx-11/packages/GCC files
Potentially Useful Hints
- Had to add runlevels 0 and 6 to
/etc/inittab
to
handle halts and reboots respectively. Fix boot/root disk.
- 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.
- 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.
- Stripped binaries reduced to 25% of their size.
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.
- 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
.
make -n install
prints the actions make
install
would perform without doing it.
- Many GNU utilities come with
make check
.
- Needed to add devices lpt1 and lpt2. Fix boot/root disk.
- Sunsite:/pub/Linux/system has most of the system source code files
needed to implement a basic Linux system.
- Slackware has binaries in
/etc/fs
<- evil dig against
their FSSTND compliance, or lack thereof.
- 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.
- Highlights of fileutils:
chgrp, chmod, chown, cp, dd, df, du,
install, ls, mkdir, mv, rm, sync, version
.
- Highlights of textutils:
cat, head, join, paste, sort, split,
sum, tail, tr, uniq, wc
.
- 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