Hi,
I'm trying to boot Sandpoint linux on my board but I can't get initrd
to load. I'm not using any special bootloader.
I compiled the kernel using make zImage.initrd (my initrd ramdisk is
smaller than 4 MB) and I added root=/dev/ram to the cmd_line in the
function sandpoint_setup_arch() from sandpoint_setup.c. I know I
shouldn't have to do this (acording to the HOWTO), but I am so
clueless about the cause of the problem that I'm ready to try anything.
The kernel loads until the function mount_root() (in fs/super.c).
This is where it stops:
retval = blkdev_get(bdev, mode, 0, BDEV_FS);
if (retval == -EROFS) {
root_mountflags |= MS_RDONLY;
retval = blkdev_get(bdev, FMODE_READ, 0, BDEV_FS);
}
if (retval) {
/*
* Allow the user to distinguish between failed open
* and bad superblock on root device.
*/
printk ("VFS: Cannot open root device \"%s\" or %s\n",
root_device_name, kdevname (ROOT_DEV));
printk ("Please append a correct \"root=\" boot
option\n");
panic("VFS: Unable to mount root fs on %s",
kdevname(ROOT_DEV));
}
With the help of a debugger, I found out that:
root_device_name = ram
ROOT_DEV = 0x0100 /* which is ram according to init/main.c */
So if the root_device points to ram like it should, does anybody know
why it can't open the root device?
The kernel has been copied at address 0 of the RAM on the board along
with initrd (there's no hard-drive or flash, just ram). Do I need to
set something before I launch the kernel? I tought everything was setup
up correctly when I did make zImage.initrd ! (INITRD_OFFSET and
INITRD_SIZE should be set by make zImage.initrd, right?)
Any help would be appreciated !
Sébastien Côté
(Sorry if you received this e-mail twice but it didn't seem to go
through the first time)
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
I finally figured out a small part of the problem... My initrd_start
was overwritten (to 0) by the function start_kernel in init/main.c :
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start && !initrd_below_start_ok &&
initrd_start < min_low_pfn << PAGE_SHIFT) {
printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
"disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT);
initrd_start = 0;
}
#endif
I don't really understand this function... Why would my initrd be
overwritten?!? Anyways, I commented it out to see what would happen.
This time, it opened the root device (in function mount_root()) but
didn't go very far:
sb = get_super(ROOT_DEV);
if (sb) {
fs_type = sb->s_type;
goto mount_it;
}
...
panic("VFS: Unable to mount root fs on %s", kdevname(ROOT_DEV));
sb is NULL. Damn.. What now? Is it possible that my initrd has been
erased like the kernel told me? What else could it be?
I was also wondering if I loaded the kernel correctly. I put my
zImage+initrd (zvmlinux.initrd) at address 0 of ram. Since I compiled
the kernel with debug symbols, it takes a few Megs... Could it be too
large for it's own good? Maybe somebody knows about the answer to that
one!
By the way, I forgot to mention it in the first email but I'm using
linux-2.4.0-test2.
Sébastien Côté
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
From: Mark A. Greer <hidden> Date: 2001-01-19 01:13:21
Where did you get this version of that kernel? From the MontaVista CDK or from
the website? If from the website, when did you get it?
Try this (if its not already done). Go into arch/ppc/boot/head.S and add the
following lines after the set up of r6 to hold the cmd_line.
/* r4,r5 have initrd_start, size */
lis r2,initrd_start@h
ori r2,r2,initrd_start@l
lwz r4,0(r2)
lis r2,initrd_end@h
ori r2,r2,initrd_end@l
lwz r5,0(r2)
Go into arch/ppc/kernel/sandpoint_setup.c. Find sandpoint_setup_arch() and add
something like (again, if its not already there).
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
#endif
Try it now and see if that helps...
Mark
--
Sébastien Côté wrote:
I finally figured out a small part of the problem... My initrd_start
was overwritten (to 0) by the function start_kernel in init/main.c :
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start && !initrd_below_start_ok &&
initrd_start < min_low_pfn << PAGE_SHIFT) {
printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
"disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT);
initrd_start = 0;
}
#endif
I don't really understand this function... Why would my initrd be
overwritten?!? Anyways, I commented it out to see what would happen.
This time, it opened the root device (in function mount_root()) but
didn't go very far:
sb = get_super(ROOT_DEV);
if (sb) {
fs_type = sb->s_type;
goto mount_it;
}
...
panic("VFS: Unable to mount root fs on %s", kdevname(ROOT_DEV));
sb is NULL. Damn.. What now? Is it possible that my initrd has been
erased like the kernel told me? What else could it be?
I was also wondering if I loaded the kernel correctly. I put my
zImage+initrd (zvmlinux.initrd) at address 0 of ram. Since I compiled
the kernel with debug symbols, it takes a few Megs... Could it be too
large for it's own good? Maybe somebody knows about the answer to that
one!
By the way, I forgot to mention it in the first email but I'm using
linux-2.4.0-test2.
Sébastien Côté
--
Mark A. Greer (mgreer@mvista.com; 480-517-0287)
MontaVista Software, Inc.
2141 E. Broadway Road, Suite 108
Tempe, AZ 85282
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Where did you get this version of that kernel? From the MontaVista CDK or from
the website? If from the website, when did you get it?
I'm pretty sure it came from the web.. I think it was downloaded at the
end of November but I can't be sure... I could probably answer this
next week.
Try this (if its not already done). Go into arch/ppc/boot/head.S and add the
following lines after the set up of r6 to hold the cmd_line.
/* r4,r5 have initrd_start, size */
lis r2,initrd_start@h
ori r2,r2,initrd_start@l
lwz r4,0(r2)
lis r2,initrd_end@h
ori r2,r2,initrd_end@l
lwz r5,0(r2)
Go into arch/ppc/kernel/sandpoint_setup.c. Find sandpoint_setup_arch() and add
something like (again, if its not already there).
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
#endif
I tried that patch that I found in the list archives but it didn't make
any difference.
Sébastien Côté
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
From: Michael Pruznick <hidden> Date: 2001-01-23 21:03:00
I'd had a similar problem with a 2.5 kernel from late nov
or early dec. I had to comment out the follow code from
init/main.c::do_basic_setup() to get it working. I also
had to apply the head.S and <board>_setup.c file as
already mentioned in this thread. I also played with devfs
support but don't remember if either enabled or disabled was
required. I never followed up on this, but I suspect this
is a bad kludge and that there is a better way to solve this
problem. Let me know if this works for you.
718 #if 0
719 #ifdef CONFIG_BLK_DEV_INITRD
720 root_mountflags = real_root_mountflags;
721 if (mount_initrd && ROOT_DEV != real_root_dev
722 && MAJOR(ROOT_DEV) == RAMDISK_MAJOR && MINOR(ROOT_DEV) == 0) {
723 int error;
724 int i, pid;
725
726 pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
727 if (pid>0)
728 while (pid != wait(&i));
729 if (MAJOR(real_root_dev) != RAMDISK_MAJOR
730 || MINOR(real_root_dev) != 0) {
731 error = change_root(real_root_dev,"/initrd");
732 if (error)
733 printk(KERN_ERR "Change root to /initrd: "
734 "error %d\n",error);
735 }
736 }
737 #endif
738 #endif
Sébastien Côté wrote:
"Mark A. Greer" wrote:
quoted
Where did you get this version of that kernel? From the MontaVista CDK or from
the website? If from the website, when did you get it?
I'm pretty sure it came from the web.. I think it was downloaded at the
end of November but I can't be sure... I could probably answer this
next week.
quoted
Try this (if its not already done). Go into arch/ppc/boot/head.S and add the
following lines after the set up of r6 to hold the cmd_line.
/* r4,r5 have initrd_start, size */
lis r2,initrd_start@h
ori r2,r2,initrd_start@l
lwz r4,0(r2)
lis r2,initrd_end@h
ori r2,r2,initrd_end@l
lwz r5,0(r2)
Go into arch/ppc/kernel/sandpoint_setup.c. Find sandpoint_setup_arch() and add
something like (again, if its not already there).
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
#endif
I tried that patch that I found in the list archives but it didn't make
any difference.
Sébastien Côté
--
Michael Pruznick, michael_pruznick@mvista.com, www.mvista.com
MontaVista Software, 1237 East Arques Ave, Sunnyvale, CA 94085
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/