Skip to contentSkip to conversation

Initrd Question

DISCUSSION Jim Gifford 2 participants 2 messages Feb 13, 2004

lore
Share & tools
lore
#0 lore raw

I wrote the initrd hint for the Linux from Scratch. I have followed the initrd.txt exactly to the letter. The problem I have noticed is with one of the commands, and I checked other mkinitrd scripts and they have the workaround in it.

According to initrd.txt the echo 0x301 >/proc/sys/kernel/real-root-dev is for the old change root mechanism, but I have tried to elminate that from my script and it fails everytime saying it can't find the root, the infamous

Kernel panic: VFS: Unable to mount root fs on xx:xx. Here is my linuxrc

script that is built from my mkinitrd script which can be viewed at
http://cvs.jg555.com/viewcvs.cgi/scripts/system/mkinitrd.

I use busybox for my script so I can keep the size down. My current size is only 387k.

#!/bin/sh

echo "Initial RAMDISK Loading Starting..." insmod /lib/megaraid.ko
insmod /lib/aic7xxx.ko
insmod /lib/uhci-hcd.ko
echo "Mounting proc..."
mount -n -t proc none /proc
echo 0x0100 > /proc/sys/kernel/real-root-dev echo "Mounting real root dev..."
mount -n -o ro /dev/sda2 /new_root
echo "Running pivot_root..."
pivot_root /new_root /new_root/initrd
if [ -c initrd/dev/.devfsd ]
then
echo "Mounting devfs..."
mount -n -t devfs none dev
fi
if [ $$ = 1 ]
then
echo "Running init..."
exec chroot . sbin/init dev/console 2>&1
else
echo "Using bug circumvention for busybox..." exec chroot . sbin/linuxrc dev/console 2>&1
fi
echo "Initial RAMDISK Loading Completed..."

----
Jim Gifford
[email protected]

#1 lore raw
Quoted 4 lines · Jim Gifford

I wrote the initrd hint for the Linux from Scratch. I have followed the initrd.txt exactly to the letter. The problem I have noticed is with one of the commands, and I checked other mkinitrd scripts and they have the workaround in it.

With regards to the initrd.txt hint. (2.4.x kernels)

It does not work with the " root=/dev/rd/0 (with devfs) "
unless { "rd/0", 0x0100 }, is added to the root_dev_names[]
__initdata array; (init/do_mounts.c)

You need to use "root=/dev/ram0" with or without devfs. (or change init/do_mounts.c). Patches to either code or documentation if you want.

Chris