PDA

View Full Version : Problems with custom kernel: "/linuxrc: cannot create..



mkg
11-09-2003, 12:17 AM
I am remastering Knoppix to produce a demo disk for some kernel monitoring software I have been developing. As a first step, I am just trying to remaster with a kernel I compiled using the configuration file in /boot of the Knoppix CD (v3.3 2003/09/22 EN). I have read through the Knoppix Custom Kernel Howto and have followed the directions. These are the general steps I took (details available on demand):


Installed new kernel and cloop module using dpkg (in chroot environment)
Added an entry in lilo.conf for new kernel (in chroot environment)
Remastered miniroot.gz with modules from above kernel
Remastered boot.img with above kernel
Install boot.img on floppy and reboot (/cdrom files on root of /dev/hda4)


Syslinux uncompresses miniroot and starts to boot vmlinuz. When linuxrc gets to "Creating directories and symlinks on ramdisk..." it dies with the following error messages:



/linuxrc: cannot create /etc/ioctl.save: file system full
FAT: bogus logical sector size 61440
Kernel panic: VFS: Unable to mount root fs on 03:01


The custom kernel howto says that changing the size of miniroot causes problems (although not specifically this problem), so I kept the same size when I used dd to create the empty file to be mounted as miniroot. (I had to increase the number of inodes to 1024 when creating the file system so I wouldn't run out when copying things onto it.) I don't think that is the problem either. In fact, I have no idea what the problem is or how to look for it. I have been stuck on this problem for over a week. I would greatly appreciate any help you can give. If there is a more detailed explanation of how to install a custom kernel on Knoppix, I would appreciate knowing about that too.

BTW, my ultimate goal is to be able to select at boot time the original kernel or the kernel with my monitoring instrumentation in it. Does anyone know how to create boot floppies that can do that or will I have to go with isolinux? Is there a way to boot using isolinux without having to burn a CD each time? (My mastering machine does not have a CD-R/RW drive in it so I would need to move everything to another machine if I need to burn a CD each time. Not to mention that burning CDs are a bother... CD-RWs take a long time to erase.)

Mark

boochaka
11-10-2003, 06:25 PM
Do you know whether the problem is with the kernel you've compiled or with the method you are remastering boot.img.

Try remaster boot.img and change something other than the kernel.
(like the image or something)

>>BTW, my ultimate goal is to be able to select at boot time the original kernel or the kernel with my monitoring instrumentation in it.<<

Why not just use lilo?

mkg
11-11-2003, 01:02 AM
Do you know whether the problem is with the kernel you've compiled or with the method you are remastering boot.img.

Try remaster boot.img and change something other than the kernel.
(like the image or something)
Thank you for your reply.

I have had no problem changing the background image in syslinux or Knoppix. I have also had no problems adding or deleting packages (as long as I remain within 700 MB total). Where I am having trouble is in creating the boot floppy. Somewhere along the line, something is getting foobar'd.

I rebuilt miniroot and the boot floppy using the files from the Knoppix boot floppy (rather than the new kernel files I compiled) using the following commands:



### As root (in RC shell):

# Step 1: mount old boot image and miniroot
mkdir -p old/boot old/initrd
cp -p /KNOPPIX/boot.img old
cd old
mount -t msdos -o rw,loop boot.img boot
zcat boot/miniroot.gz > miniroot
mount -t ext2 -o rw,loop miniroot initrd
cd ..

# Step 2: create new miniroot
mkdir -p new/boot new/initrd
cd new
dd 'if=/dev/zero' 'of=miniroot' 'bs=3004k' 'count=1'
mke2fs -N 1024 -m 0 miniroot
mount -t ext2 -o rw,loop miniroot initrd
rmdir initrd/lost+found
@{cd ../old/initrd;tar cf - *} | @{cd initrd;tar xpf -}
diff -qr ../old/initrd initrd # Only differences are special files and symlinks
umount initrd
umount ../old/initrd
gzip -9 -c miniroot > miniroot.gz

# Step 3: create new boot image
dd 'if=/dev/zero' 'of=boot.img' 'bs=1440k' 'count=1'
mkdosfs boot.img
mount -t msdos -o rw,loop boot.img boot
@{cd ../old/boot;sudo tar cf - boot.msg f2 german.kbd logo.16 syslinux.cfg \
vmlinuz} | @{cd boot;sudo tar xpf -}
cp -p miniroot.gz boot
umount boot
syslinux boot.img
mount -t msdos -o ro,loop boot.img boot
diff -qr ../old/boot boot # Only differences are ldlinux.sys and miniroot.gz
umount boot
umount ../old/boot
cd ..

# Step 4: create boot floppy and reboot
cd new
dd 'if=boot.img' 'of=/dev/fd0' 'bs=1440k' 'count=1'
reboot

### Result:
# Right after the boot message:
# Creating directories and symlinks on ramdisk...
# the following error message occurs:
# /linuxrc: cannot create /etc/ioctl.save: file system full
# FAT: bogus logical sector size 0
# Kernel panic: VFS: Unable to mount root fs on 01:01


I also tried rebuilding just the boot floppy (steps 3 & 4) but using the original miniroot.gz file. This seems to work fine. Therefore, my problem appears to be in creating miniroot.gz. I will look at it again tonight. In the mean time, if anyone has suggestions...

Mark