rootfs on USB storage device
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Does anybody have a clue as to what the USB bus has to do with
/dev/console?It's a timing issue, and has nothing to do with
/dev/console. If you sit and spin before you try to mount the root fs, the USB subsystem will have enough time to find the drive. There's a few patches that do this in the lkml archives.
Quoted 7 lines
Quoted 1 line
greg k-h
It does not seem so. I included several seconds of
mdelay()(and lots of printk()'s) while I was debugging, and that didnt change a thing. I added a.o. 4 seconds ofmdelay()right before theopen(), and 2 seconds right after theopen()and the two dup()'s. The storage device was detected at the beginning of that last delay. [...]
I think khubd needs to run to complete whole process and mdelay() locks it out. You need something that calls schedule() for USB detection to work. Try to use schedule_timeout() instead of mdelay().
-- Pete
Quoted 3 lines · Pete Zaitcev
I think khubd needs to run to complete whole process and
mdelay()locks it out. You need something that callsschedule()for USB detection to work. Try to useschedule_timeout()instead ofmdelay().
This patch works for me.
Eric
fs/super.c renamed from fs/super.c.orig +6 -4
@@ -1009,11 +1009,13 @@* Allow the user to distinguish between failed open * and bad superblock on root device. */ -printk ("VFS: Cannot open root device \"%s\" or %s\n" , +printk ("VFS: Cannot open root device \"%s\" or %s, retrying in 1s.\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 )); + +/* wait 1 second and try again */ + current->state =TASK_INTERRUPTIBLE ; +schedule_timeout (HZ ); + goto retry; }check_disk_change (ROOT_DEV );
Quoted 11 lines
Date: Fri, 16 Nov 2001 14:21:04 +0100 (CET)
From: Eric Lammerts <[email protected]>
To: Pete Zaitcev <[email protected]>
cc: [email protected], Greg KH <[email protected]>,
<[email protected]>Quoted 3 lines
I think khubd needs to run to complete whole process and
mdelay()locks it out. You need something that callsschedule()for USB detection to work. Try to useschedule_timeout()instead ofmdelay().This patch works for me.
Looks like a well done patch but what does happen if root= was indeed incorrect? I wish there was a way to print something meaningful for the operator.
-- Pete
P.S. - quoting the patch, saved for future reference
Quoted 20 lines
fs/super.c renamed from fs/super.c.orig +6
-4@@ -1009,11 +1009,13 @@* Allow the user to distinguish between failed open * and bad superblock on root device. */ -printk ("VFS: Cannot open root device \"%s\" or %s\n" , +printk ("VFS: Cannot open root device \"%s\" or %s, retrying in 1s.\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 )); + +/* wait 1 second and try again */ + current->state =TASK_INTERRUPTIBLE ; +schedule_timeout (HZ ); + goto retry; }check_disk_change (ROOT_DEV );