[pocket-linux] Chapter 3 Question/Problem
David Horton
dhorton at speakeasy.net
Wed Feb 25 18:50:54 CST 2004
James Maki wrote:
> First, thanks for the reply and ideas. More comments below.
>
>
>>-----Original Message-----
>>
>>
>>James Maki wrote:
>>
>>>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.
>>
>>Just out of curiosity, what was your first computer?
>
>
> An Atari 800 with 48k of memory and a single 88 K 5-1/4" floppy. Followed
> with a Kaypro IV, Atari 520ST, Sharp 8086 based laptop, and my first desktop
> clone, a Gateway 386/20.
>
Cool. I had a TI-99/4A from the same era as the Atari.
>
>>>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
>>>
>>
>>Good idea using scripts. It saves time and typographical errors.
>>
>>
>>>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
>>>
>>
>>As far as I can tell this /lib/tls thing does not create a problem. I
>>have used Redhat 9.0 to build the pocket linux guide without any
>>problems. RH9 has the /lib/tls as well.
>>
>>My understanding is that 'libc.so.6' is what the bash binary is actually
>>looking for, not the full path. Bash tells ld-linux.so.2, "Hey, I need
>>libc.so.6" and it's up to ld-linux to figure out what file it is and
>>what the path is. ld-linux looks in /lib and /usr/lib by default.
>>
>>So, in short, I don't think that is where the problem lies.
>>
>>
>>>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.
>>>
>>
>>I'm not a GRUB expert, but his error makes me think that your kernel
>>might not have support for ramdisk or that the kernel option to load fd0
>>into ramdisk is not being specified correctly in the grub config file.
>>Try downloading and using the LILO bootdisk just to see if the problem
>>is with the root disk or the boot disk.
>
>
> I downloaded the disk files from the website and copied the
> ch2-bootdisk.image to a floppy. The boot disk with LILO and the chapter 3
> root disk I created seemed to work fine. So it is either a problem with the
> kernel I compiled or the GRUB loader. More work!
>
>
If you are feeling adventurous you can mount the LILO floppy and copy
the kernel from it onto your GRUB diskette. That will narrow down the
bad kernel vs. bad grub question since you'll have a known good kernel.
>>>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.
>>>
>>
>>Are you sure the 8.0 is in Meg or is it in blocks? Some commands give
>>sizes in 512b blocks rather than kilobytes. Just a thought.
>
>
> ls- l for the gzipped and uncompressed files gives the following:
>
> total 8968
> -rw-r--r-- 1 root root 8388608 Feb 25 15:52 phase2-image
> -rw-r--r-- 1 root root 778002 Feb 25 15:12 phase2-image.gz
>
> Looks like approximately 8.0 M.
>
>
It could be that your fedora system's kernel is configured to use an 8M
ramdisk. I don't know enough about fedora to say if that's the case.
>>>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
>>>
>>>
>>
>>Glad to hear you are learning and enjoying. Good luck tracking down the
>>errors.
>>
>>Dave
>
>
> Thanks. Back to work.
>
> Jim
>
Good Luck!
Dave
More information about the Pocket-Linux
mailing list