kinit problem with cciss root device
kinit converts "root=/dev/cciss/c0d0p1" to "cciss.c0d0", which doesn't exist under /sys/block because register_disk() converts "cciss/c0d0" to "cciss!c0d0" (note "!", not ".").
I don't know whether it's the *right* fix, but the patch below makes things work. It still doesn't make kinit exactly match the register_disk() behavior because register_disk() only changes the first "/" in the string.
This was a nuisance to debug because when it failed, the only output I got was this:
...
Adding console on ttyS0 at I/O port 0x3f8 (options '115200')
Time: tsc clocksource has been installed.
Freeing unused kernel memory: 260k freed
argc == 4
Kernel panic - not syncing: Attempted to kill init!
argv[0]: "/ini So you might consider something like the "drain output" hunk below, which allowed all the useful messages to get out.
usr/kinit/kinit.c +5 -0
@@ -317,5 +317,10 @@if (mnt_sysfs)umount2 ("/sys" ,0 ); +/* +* Allow time for messages to drain before kernel panics +* because init is exiting. +* */ +sleep (10 );exit (ret); }
usr/kinit/name_to_dev.c +1 -1
@@ -151,7 +151,7 @@for (p = s; *p; p++)if (*p =='/' ) - *p ='.' ; + *p ='!' ; res =try_name (s,0 );if (res)return res;
Quoted 4 lines · Bjorn Helgaas
So you might consider something like the "drain output" hunk below, which allowed all the useful messages to get out.
Hm. That's rather ugly. Anyone knows if TCFLSB works on /dev/console?
Quoted 6 lines
Index:
work-mm8/usr/kinit/kinit.c
===================================================================
usr/kinit/kinit.c line 326
Quoted 10 lines
usr/kinit/kinit.c +5
-0@@ -317,5 +317,10 @@if (mnt_sysfs)umount2 ("/sys" ,0 ); +/* +* Allow time for messages to drain before kernel panics +* because init is exiting. +* */ +sleep (10 );exit (ret); }
-hpa
Quoted 8 lines · H. Peter Anvin
Quoted 4 lines · Bjorn Helgaas
So you might consider something like the "drain output" hunk below, which allowed all the useful messages to get out.
Hm. That's rather ugly. Anyone knows if TCFLSB works on
/dev/console?
That should of course have been TCSBRK(1), as in tcdrain().
-hpa
Quoted 9 lines · Bjorn Helgaas
kinit converts "root=/dev/cciss/c0d0p1" to "cciss.c0d0", which doesn't exist under
/sys/blockbecauseregister_disk()converts "cciss/c0d0" to "cciss!c0d0" (note "!", not ".").I don't know whether it's the *right* fix, but the patch below makes things work. It still doesn't make kinit exactly match the
register_disk()behavior becauseregister_disk()only changes the first "/" in the string.
That's still the right thing; obviously register_disk() will need to change if we ever have deeper trees.
Could you re-send that hunk as a proper patch with Signed-off-by: et al?
Thanks,
-hpa