[09:08] <fabbione> bah
[09:08] <fabbione> Keybuk: the patch I did for grub-installer fixes only half of the problems :/
[09:08] <fabbione> i just figured that there is another section that needs love
[09:08] <Keybuk> oh?
[09:08] <fabbione> and it's WAYYYYYY complicate to touch
[09:09] <fabbione> the first patch fix the writing of the MBR
[09:09] <fabbione> and it works
[09:09] <fabbione> the issue is now all the references to groot/root/kopt
[09:10] <fabbione> that involves changing grub as well
[09:10] <fabbione> or update-grub
[09:11] <Keybuk> cute
[09:11] <Keybuk> :D
[09:11] <fabbione> no
[09:11] <fabbione> painful
[09:38] <fabbione> grub is the shit
[09:38] <fabbione> it has the same code duplicated 3 times!
[09:47] <fabbione> Keybuk: you still around?
[09:50] <fabbione> nevermind ... i found
[09:53] <Keybuk> yup, just reading bugs
[09:57] <fabbione> Keybuk: i just noticed that my usb hd installation is showing a different symptoms from yesterday
[09:58] <fabbione> basically i can see initramfs that attempts to drop me to a shell
[09:58] <fabbione> at the same time the hd is recognized as sda
[09:58] <fabbione> and it deadlocks
[09:58] <fabbione> no shell
[09:58] <fabbione> no boot
[09:58] <fabbione> so i assume we are getting closer
[09:58] <Keybuk> interesting
[09:58] <fabbione> my temporary fix is to just run udevplug
[09:58] <fabbione> with no options
[09:58] <fabbione> and sleep a few secs for the device to be available
[09:59] <fabbione> but clearly is suboptimal
[09:59] <Keybuk> can you find out what device you actually need to be plugged?
[09:59] <Keybuk> walk /sys doing echo > .../uevent for each thing that exists until it works
[10:01] <fabbione> meh dude
[10:01] <fabbione> the problem is that the device is recognized later during the boot
[10:01] <fabbione> how can i do that in initramfs since it doesn't even drop me to a shell anymore?
[10:07] <Keybuk> break=premount
[10:07] <Keybuk> (on the kernel command line)
[10:07] <Keybuk> if a plain "udevplug" finds the device, then it means that my filter in the initramfs excludes it
[10:07] <Keybuk> so we need to find the device, and then add some detail (usually the PCI class) to the filter
[10:09] <fabbione> i think i know which one it is
[10:09] <fabbione> what i notice when i do udevplug manually
[10:10] <fabbione> is that i get the usb host controller module loaded
[10:10] <fabbione> do you actually load them?
[10:10] <fabbione> and if you can tell me what class it is i can easily test it
[10:10] <Keybuk> I should load them
[10:11] <fabbione> well i notice the message of "overcurrent from USB"
[10:11] <Keybuk> I load everything of class 0x0c*
[10:11] <fabbione> like if the device is initialized for the first time
[10:11] <fabbione> ok.. workrave is yelling at me.. brb
[10:23] <fabbione> re
[10:59] <fabbione> ahh
[11:00] <fabbione> Keybuk: i think i know what's wrong
[11:00] <fabbione> it might be a PEBCAK
[11:00] <fabbione> i am checking again now
[11:00] <fabbione> it's difficult to test this env cleanly
[11:38] <fabbione> Keybuk: i did check again.. i think there is race somewhere
[11:39] <fabbione> usplash is telling me that the system is waiting for root
[11:39] <fabbione> it drops me back that /dev/foo doesn't exists and wants to go to console
[11:39] <Keybuk> fabbione: interesting
[11:39] <fabbione> at the same time i see that the modules are loaded
[11:39] <Keybuk> drops you back after 30s or so?
[11:39] <fabbione> no, much faster than that
[11:39] <fabbione> it seems like it's happening outside the loop
[11:40] <Keybuk> weird
[11:40] <fabbione> i know, it takes something like 2 seconds to get there once Waiting for root appears
[11:40] <Keybuk> so it's dropping out of the loop?
[11:40] <fabbione> i guess so
[11:40] <Keybuk> that suggests the root device has appeared
[11:40] <fabbione> yes
[11:40] <fabbione> but it fails to mount it?
[11:40] <Keybuk> right
[11:41] <fabbione> the error is: "ALERT! /dev/sda1 doens't exists. Dropping to a shell!"
[11:41] <fabbione> but i never get to the shell
[11:41] <fabbione> even waiting forever
[11:41] <fabbione> and after that message i see that sda did appear
[11:44] <Keybuk> ok ...
[11:44] <Keybuk> kooky
[11:44] <Keybuk> are you using root=/dev/sda1 ?
[11:44] <fabbione> yes
[11:45] <Keybuk> does /dev/sda1 exist?
[11:45] <fabbione> after the modprobing yes
[11:45] <fabbione> http://people.ubuntu.com/~fabbione/grub.diff
[11:45] <Keybuk> huh?
[11:45] <Keybuk> right
[11:45] <Keybuk> so you get Waiting for root filesystem
[11:46] <Keybuk> after 2s you get "/dev/sda1 doesn't exist"
[11:46] <Keybuk> at the point you're dropped to a shell
[11:46] <Keybuk> and /dev/sda1 doesn't exist
[11:46] <Keybuk> if you modprobe <something> then it exists?
[11:46] <fabbione> i can't modprobe anything
[11:46] <fabbione> the shell is not there
[11:46] <fabbione> even it tells me that's dropping to a shell
[11:46] <Keybuk> is the shell on a different vt?
[11:46] <fabbione> nope
[11:46] <fabbione> already checked
[11:46] <Keybuk> (I assume you're doing this without "splash" in the kernel command line?)
[11:47] <fabbione> ah yes
[11:47] <fabbione> if i type exit at the shell, it just works
[11:47] <Keybuk> at what shell?!
[11:47] <fabbione> because the device is there
[11:47] <Keybuk> you just said you didn't have a shell
[11:47] <fabbione> i was wrong
[11:47] <Keybuk> oh
[11:47] <fabbione> it was on alt+f8
[11:47] <Keybuk> heh
[11:47] <fabbione> i did stop at alt+f6
[11:48] <Keybuk> ok...
[11:48] <fabbione> YOU ALL HATE ME YOU BASTARDS!
[11:48] <Keybuk> so do that again
[11:48] <Keybuk> take out splash and quiet
[11:48] <fabbione> you are driving me insate
[11:48] <fabbione> insane
[11:48] <Keybuk> and tell me exactly what you see for each part of the boot
[11:48] <Keybuk> how long it waits
[11:48] <Keybuk> etc.
[11:48] <fabbione> ok
[11:48] <fabbione> gimme a few.. it takes long to boot that stuff
[11:52] <fabbione> ok
[11:52] <fabbione> this is what i see:
[11:52] <fabbione> Waiting for root
[11:52] <fabbione> done
[11:53] <fabbione> Mounting root f
[11:53] <fabbione> Running local-top
[11:53] <fabbione> done
[11:53] <fabbione> ALERT! /dev/sda1...blabla shell!
[11:53] <Keybuk> right
[11:53] <fabbione> i get the shell in busy box
[11:53] <Keybuk> how long does it wait after "Waiting for root" ?
[11:53] <fabbione> probably 2 seconds
[11:53] <Keybuk> oh meh
[11:53] <Keybuk> I see the bug
[11:53] <Keybuk> I dropped a "0"
[11:54] <fabbione> as soon as I enter the busybox
[11:54] <Keybuk> must have done that by accident when I stopped usplash from timing out
[11:54] <fabbione> i see the messages from the kernel that sda is appearing
[11:54] <fabbione> ok
[11:54] <fabbione> good
[11:55] <fabbione> Keybuk: do you want me to test a patch before you upload?
[11:55] <fabbione> i can do that easily
[11:56] <fabbione> it just takes a few minutes to reboot the thingy :)
[11:56] <Keybuk> change the slumber=30 line to 300 in the udev initramfs premount hook
[11:57] <Keybuk> /usr/share/initramfs-tools/scripts/init-premount/udev
[11:57] <Keybuk> and update-initramfs -u
[11:58] <fabbione> testing
[12:04] <fabbione> Keybuk: score
[12:05] <fabbione> but i need to lart you for uploading glibc!
[12:10] <Keybuk> why?
[12:10] <fabbione> i was almost at the end of the build on sparc :P
[12:12] <Keybuk> lol
[12:13] <fabbione> well it's all ccached
[12:13] <fabbione> it won't take ages
[01:04] <Mithrandir> Keybuk: I don't see any /dev/disk/by-* in the initramfs, is that intentional?
[01:15] <fabbione> if that's intentional, we can't implement prob-for-root :)
[01:17] <Mithrandir> sure we can
[01:18] <Mithrandir> I have persistent live cds almost working already.
[01:28] <fabbione> Mithrandir: no wwithout disk-by-uuid
[03:22] <Keybuk> Mithrandir: kinda
[03:22] <Keybuk> it's more that there's nothing unneeded in the initramfs
[03:22] <Keybuk> when we come to need those, we'll add them
[03:22] <Keybuk> is just a matter of copying the rules and helpers
[03:22] <Mithrandir> Keybuk: apparently, the rule is there already
[03:23] <Keybuk> it is?
[03:23] <Keybuk> hmm
[03:23] <Keybuk> wonder why they don't work then
[03:25] <Mithrandir> also, how can I wait until usb hotplugging is done?
[03:31] <Mithrandir> Keybuk: ^^
[03:32] <Keybuk> define "done"
[03:32] <Mithrandir> when the nodes are in /dev and accessing them will yield a sensible result.
[03:32] <Keybuk> while [ ! -e $NODE ] ; do
[03:32] <Keybuk>     sleep 1
[03:32] <Keybuk> done
[03:33] <Keybuk> pretty much like the udev init-remount script does for scsi/usb/ieee1394/etc. devices
[03:33] <Mithrandir> well, it might never appear. :-)
[03:33] <Keybuk> yeh
[03:33] <Mithrandir> I want to use a block device with a specified label as the backend storage for casper
[03:33] <Keybuk> the kernel guys take on this is that you should do it in a udev event or something
[03:34] <Mithrandir> but if it's not there, I'll use a tmpfs
[03:34] <Keybuk> they refuse to add any kind of "I've finished scanning the bus" notification
[03:34] <Keybuk> to either USB, SCSI, SATA, etc.
[03:35] <Mithrandir> so there's no way to accomodate my use case?
[03:37] <Mithrandir> I obviously don't want to just sleep five seconds and see if anything comes by.
[03:40] <Keybuk> does that existing affect what you'd ordinarily do next?
[03:41] <Mithrandir> yes.
[03:41] <Keybuk> then yeah, no easy way
[03:41] <Mithrandir> since if a device with a given label exists, I'll mount that.  If not, I'll mount something else.
[03:41] <Mithrandir> then, I'll mount the cd and unionfs mount those together.
[03:44] <Mithrandir> can I do something like udevplug -Busb, or won't that give me what I think it might?
[03:45] <Keybuk> won't do what you think
[03:45] <Keybuk> that will wait for anything already known to be on the USB bus to be configured
[03:45] <Keybuk> it won't find new things on the bus
[03:46] <Mithrandir> I'm not too worried about the use-case of somebody plugging it in halfway
[03:47] <Mithrandir> so if I can just say "please plug any USB and tell me when you're done", that's fine.
[03:47] <Keybuk> right, but USB isn't instant
[03:47] <Keybuk> in theeeeeory
[03:48] <Keybuk> if you run after the udev init-premount script, then any USB devices the kernel knows about are there, or not there
[03:48] <Keybuk> but if you have a slow USB hub or controller somewhere, you're racing it
[03:49] <Mithrandir> it might be that the device hasn't settled yet as well?
[03:50] <Keybuk> indeed
[03:51] <Mithrandir> this situation really sucks.
[03:57] <Mithrandir> I guess the /sys entries aren't there either?
[04:00] <Keybuk> exactly
[04:00] <Keybuk> the kernel pov is that if the device hasn't settled, then how's the kernel supposed to know it's there?
[04:00] <Keybuk> the kernel does a USB scan, and announces the devices as and when they report back
[04:01] <Keybuk> if they wanted to add a "finished!" thing, they'd have to sleep-and-loop-and-timeout
[04:01] <Keybuk> which is the kind of thing that belongs in userspace
[04:02] <Mithrandir> so I can say "please scan the USB bus" and then sleep for a couple of seconds, then look in /sys/block and it should be ok-ish?
[04:02] <Keybuk> yeah
[04:02] <Mithrandir> and udevplug -Busb does the first part?
[04:03] <Keybuk> no
[04:03] <Keybuk> udevplug is a cold-plugging tool, it's for catching up on missed kernel events
[04:03] <Keybuk> udev already takes care of the -Busb thing
[04:04] <Mithrandir> so I can just sleep five seconds or something and scan, then?
[04:05] <Keybuk> I assume you're running after the udev init-premount script?
[04:05] <Mithrandir> yeah, this is a replacement for /scripts/local
[04:05] <Keybuk> right
[04:06] <Keybuk> you may be able to just look for the device straight away
[04:06] <Keybuk> the time taken to get there should be enough for the device to show up
[04:06] <Keybuk> and udevd will handle making the device node for you in the background
[04:06] <Mithrandir> doesn't appear to be on my system
[04:06] <Keybuk> does it appear if you sit and wait for a few seconds?
[04:07] <Mithrandir> let me check with break=premount
[04:07] <Keybuk> break=mount would maybe be better ;)
[04:07] <Mithrandir> well, yes.
[04:07] <Mithrandir> :-)
[04:08] <Mithrandir> "Spawning shell..\n", then messages about sdb (which is the usb memory stick in question here)
[04:10] <Keybuk> "the red car and the blue car had a race"
[04:10] <Mithrandir> the blue is consistently winning on my system, though.
[04:11] <Keybuk> that's because smart ol' Blue chose the Milky Way
[04:39] <Mithrandir> ok, that works now.
[04:57] <Mithrandir> huzza!  Working live cd persistency.