GNU fileutils −− chgrp, chmod, chown, cp, dd, df, ln, ls, mkdir, mknod, mv, rm, rmdir, sync
•
GNU sh−utils −− date, hostname, stty, su, uname
•
These four packages do not contain all of the commands in the
/bin
directory, but they do represent of over
70% of them. That should be enough to accomplish our goal of adding some of the commonly used external
commands. We can worry about the other commands in later phases of the project.
4.2.4. Downloading Source Code
To fetch the source code we simply need to connect to GNU's FTP site and navigate to the appropriate
package directory.
When we get to the directory for textutils there are several versions available. There is also a note informing
us that the package has been renamed to coreutils. The same message about coreutils appears in the fileutils
and sh−utils directories as well. So instead of downloading three separate packages we can get everything in
one convenient bundle in the coreutils directory.
4.3. Construction
Rather than copying files directly to the ramdisk, we can make things easier by setting up a staging area. The
staging area will give us room to work without worrying about the space constraints of the ramdisk. It will
also provide a way to save our work and make it easier to enhance the rootdisk in later phases of the project.
The staging procedure will work like this:
Create a directory structure as defined in the FHS.
1.
Copy in the files from phase 2's root disk.
2.
Build the new package from source code.
3.
Install files into the correct FHS directories.
4.
Strip the binaries to save space.
5.
Check library dependencies.
6.
Copy to the whole directory structure to the ramdisk.
7.
Compress the ramdisk and write it out to floppy.
8.
4.3.1. Create a staging area
bash# mkdir ~/staging
bash# cd ~/staging
bash# mkdir bin boot dev etc home lib mnt opt proc root sbin tmp usr var
bash# mkdir var/log var/run
4.3.2. Copy contents of phase 2 rootdisk
bash# dd if=~/phase2−image.gz | gunzip −c > /dev/ram7
bash# mount /dev/ram7 /mnt
bash# cp −dpR /mnt/* ~/staging
bash# umount /dev/ram7
bash# rmdir ~/staging/lost+found
Pocket Linux Guide
Chapter 4. Some Basic Utilities
17