bash# mkdir /mnt/lib
bash# strip −−strip−unneeded −o /mnt/lib/libdl.so.2 /lib/libdl.so.2
bash# strip −−strip−unneeded −o /mnt/lib/libc.so.6 /lib/libc.so.6
bash# strip −−strip−unneeded −o /mnt/lib/ld−linux.so.2 /lib/ld−linux.so.2
bash# chmod +x /mnt/lib/ld−linux.so.2
Using strip −o might seem an odd way to copy library files from the development system to the ramdisk.
What it does is strip the symbols while the file is in transit from the source location to the destination.
This has the effect of stripping symbols from the library on the ramdisk without altering the libraries on
the development system. Unfortunately file permissions are lost when copying libraries this way which
is why the chmod +x command is then used to set the execute flag for the rootdisk's dynamic loader.
3.3.5. Create a console device
bash# mkdir /mnt/dev
bash# mknod /mnt/dev/console c 5 1
3.3.6. Compress the ramdisk image
bash# cd /
bash# umount /dev/ram7
bash# dd if=/dev/ram7 of=~/phase2−image bs=1k count=4096
bash# gzip −9 ~/phase2−image
3.3.7. Copy the compressed image to diskette
Insert the floppy labeled "root disk" into drive fd0.
bash# dd if=~/phase2−image.gz of=/dev/fd0 bs=1k
3.4. Implementation
Successful implementation of this phase is probably the most difficult part of the Pocket Linux Guide. If you
need help getting things to work please visit the Pocket Linux Guide Resource Site to browse the
troubleshooting forum and subscribe to the mailing list.
3.4.1. System startup
Follow these steps to boot:
Restart the PC using the boot disk from the previous chapter.
•
At the
grub>
prompt, type
kernel (fd0)/boot/vmlinuz init=/bin/sh
root=/dev/fd0 load_ramdisk=1 prompt_ramdisk=1
and press Enter.
•
Type
boot
at the
grub>
prompt and press Enter.
•
Insert the new, compressed root disk when prompted.
•
The screen output should be similar to the following example:
GNU GRUB version 0.95
Pocket Linux Guide
Chapter 3. Saving Space
14