[pocket-linux] Chapter 3 Question/Problem
James Maki
jwmaki at att.net
Wed Feb 25 13:12:21 CST 2004
I have been going through the Pocket Linux as a means to learn more about
Linux. I am a Linux newbie, but have been using computers for 20 years. I
was able to get the boot disk/root disk from chapter 2 to work as
advertised. I am using the GRUB loader rather than LILO. I am creating the
boot disks on a Fedora Core 1 system.
After creating the root disk several times, I automated with a BASH script.
Creating the Chapter 2 root disk with the following script gives me a system
that works as is should according to Chapter 2:
# SCRIPT ch2_bash.sh
dd if=/dev/zero of=/dev/fd0 bs=1k count=1440
mke2fs -m0 /dev/fd0
mount /dev/fd0 /mnt
cd /usr/src/bash-2.05a
export CC="gcc -mcpu=i386"
./configure --enable-static-link --enable-minimal-config --host=i386-pc-linu
x-gnu
make
strip bash
mkdir /mnt/bin
cp bash /mnt/bin/bash
ln -s bash /mnt/bin/sh
mkdir /mnt/dev
mknod /mnt/dev/console c 5 1
cd /
umount /mnt
echo "Script is DONE"
# End of ch2_bash.sh
When I go onto Chapter 3 to create the compressed root disk, I use the
following BASH script:
# SCRIPT ch3_bash.sh
dd if=/dev/zero of=/dev/ram7 bs=1k count=4096
mke2fs -m0 /dev/ram7 4096
mount /dev/ram7 /mnt
cd /usr/src/bash-2.05a
make distclean
export CC="gcc -mcpu=i386"
./configure --enable-minimal-config --host=i386-pc-linux-gnu
make
strip bash
ldd bash
#
# Note the output from the ldd command. It should look similar to the
example below.
# bash# ldd bash
# libdl.so.2 => /lib/libdl.so.2 (0x4001d000)
# libc.so.6 => /lib/libc.so.6 (0x40020000)
# /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
#
mkdir /mnt/bin
cp bash /mnt/bin
ln -s bash /mnt/bin/sh
mkdir /mnt/lib
strip --strip-unneeded -o /mnt/lib/libdl.so.2 /lib/libdl.so.2
strip --strip-unneeded -o /mnt/lib/libc.so.6 /lib/libc.so.6
strip --strip-unneeded -o /mnt/lib/ld-linux.so.2 /lib/ld-linux.so.2
chmod +x /mnt/lib/*
mkdir /mnt/dev
mknod /mnt/dev/console c 5 1
cd /
umount /dev/ram7
dd if=/dev/ram7 of=~/phase2-image bs=1k
gzip -9 ~/phase2-image
ls -l
dd if=~/phase2-image.gz of=/dev/fd0 bs=1k
echo " "
echo "Script is DONE"
echo " "
# End of script ch3_bash.sh
The only discrepancy I see is that the ldd bash output gives the following:
libc.so.6 => /lib/tls/libc.so.6
RATHER THAN
libc.so.6=> /lilb/libc.so.6
When I use this Chapter 3 created boot disk, I get the following error after
GRUB runs -
kernel panic : VFS : unable to mount root fs on 02:00
If I try to mount the floppy with : mount /dev/fd0, I get the error message:
mount: you must specify the filesystem type.
If I try to mount the floppy from chapter 2, it works.
The phase2-image.gz file is 758.9k on the hard drive
Looking "inside" the gzipped file gives an image file of 8.0 MB.
I do not understand all of the inner workings of all of the commands. Any
hints or ideas as to the problem would be appreciated. So far, this has
been a great learning experience.
TIA
Jim Maki
jwmaki at att.net
More information about the Pocket-Linux
mailing list