bash# make
bash# cp disk−utils/mkfs ~/staging/sbin
bash# cp fdisk/fdisk ~/staging/sbin
bash# cp login−utils/agetty ~/staging/sbin
bash# ln −s agetty ~/staging/sbin/getty
bash# cp login−utils/login ~/staging/bin
bash# cp misc−utils/kill ~/staging/bin
bash# cp mount/mount ~/staging/bin
bash# cp mount/umount ~/staging/bin
bash# cp mount/swapon ~/staging/sbin
bash# cp sys−utils/dmesg ~/staging/bin
5.3.3. Check library requirements
bash# ldd ~/staging/bin/* | more
bash# ldd ~/staging/sbin/* | more
bash# ls ~/staging/lib
All of the dependencies revealed by the ldd command are for libraries already present in the staging area so
there is no need to copy anything new.
5.3.4. Strip binaries to save space
bash# strip ~/staging/bin/*
bash# strip ~/staging/sbin/*
5.3.5. Create additional device files
bash# mknod ~/staging/dev/ram0 b 1 0
bash# mknod ~/staging/dev/fd0 b 2 0
bash# mknod ~/staging/dev/null c 1 3
5.3.6. Create the fstab and mtab files
bash# cd ~/staging/etc
Use an editor like vi, emacs or pico to create the following file and save it as
~/staging/etc/fstab
.
proc /proc proc defaults 0 0
/dev/ram0 / ext2 defaults 1 1
Create an empty mtab file.
bash# echo −n >mtab
5.3.7. Write a script to check and mount local filesystems
Use an editor to create the following shell script and save it as
~/staging/etc/init.d/local_fs
:
#!/bin/sh
#
# local_fs − check and mount local filesystems
#
PATH=/sbin:/bin ; export PATH
Pocket Linux Guide
Chapter 5. Checking and Mounting Disks
24