* Initramfs and /sbin/hotplug fun @ 2007-01-15 14:16 Andrew Walrond 2007-01-15 16:44 ` Jan Engelhardt 2007-01-15 17:04 ` Olaf Hering 0 siblings, 2 replies; 8+ messages in thread From: Andrew Walrond @ 2007-01-15 14:16 UTC (permalink / raw) To: LKML If the initramfs root filesystem contains /sbin/hotplug, the kernel starts calling it very early in the kernel boot process, well before /init has been called. In my case this resulted in lots of hotplug segfault messages as the kernel boots, followed by a thoroughly unhappy hotplug+udev once /init actually gets control. To solve this, I deleted /sbin/hotplug from the initramfs archive and modified /init to reinstate it once it gets control. This works fine, but seems inelegant. Is there a better solution? Should sbin/hotplug be called at all before the kernel has passed control to /init? Andrew Walrond ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Initramfs and /sbin/hotplug fun 2007-01-15 14:16 Initramfs and /sbin/hotplug fun Andrew Walrond @ 2007-01-15 16:44 ` Jan Engelhardt 2007-01-15 17:04 ` Olaf Hering 1 sibling, 0 replies; 8+ messages in thread From: Jan Engelhardt @ 2007-01-15 16:44 UTC (permalink / raw) To: Andrew Walrond; +Cc: LKML On Jan 15 2007 14:16, Andrew Walrond wrote: > > If the initramfs root filesystem contains /sbin/hotplug, the kernel > starts calling it very early in the kernel boot process, well before > /init has been called. In my case this resulted in lots of hotplug > segfault messages as the kernel boots, followed by a thoroughly > unhappy hotplug+udev once /init actually gets control. Could this be a case of http://lkml.org/lkml/2006/12/3/19 ? -`J' -- ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Initramfs and /sbin/hotplug fun 2007-01-15 14:16 Initramfs and /sbin/hotplug fun Andrew Walrond 2007-01-15 16:44 ` Jan Engelhardt @ 2007-01-15 17:04 ` Olaf Hering 2007-01-15 17:36 ` Andrew Walrond 1 sibling, 1 reply; 8+ messages in thread From: Olaf Hering @ 2007-01-15 17:04 UTC (permalink / raw) To: Andrew Walrond; +Cc: LKML On Mon, Jan 15, Andrew Walrond wrote: > To solve this, I deleted /sbin/hotplug from the initramfs archive and > modified /init to reinstate it once it gets control. This works fine, > but seems inelegant. Is there a better solution? Should sbin/hotplug be > called at all before the kernel has passed control to /init? Yes, it should be called. /sbin/hotplug and /init are two very different and unrelated things. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Initramfs and /sbin/hotplug fun 2007-01-15 17:04 ` Olaf Hering @ 2007-01-15 17:36 ` Andrew Walrond 2007-01-15 17:54 ` Olaf Hering 2007-01-15 19:43 ` Bill Davidsen 0 siblings, 2 replies; 8+ messages in thread From: Andrew Walrond @ 2007-01-15 17:36 UTC (permalink / raw) To: Olaf Hering, Jan Engelhardt; +Cc: LKML Olaf Hering wrote: > On Mon, Jan 15, Andrew Walrond wrote: > >> To solve this, I deleted /sbin/hotplug from the initramfs archive and >> modified /init to reinstate it once it gets control. This works fine, >> but seems inelegant. Is there a better solution? Should sbin/hotplug be >> called at all before the kernel has passed control to /init? > > Yes, it should be called. Ok > /sbin/hotplug and /init are two very different and unrelated things. Well, of course. But looking at the thread provided by Jan, it seems the kernel might not be in any fit state to service the (userspace) hotplug infrastructure when it makes the calls (Ie can't create pipes yet). The kernel wouldn't call /init (or /sbin/init) before it was fully ready to handle userspace processes, so why should it feel able to call the hotplug userspace? Andrew Walrond ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Initramfs and /sbin/hotplug fun 2007-01-15 17:36 ` Andrew Walrond @ 2007-01-15 17:54 ` Olaf Hering 2007-01-15 19:54 ` Andrew Walrond 2007-01-15 19:43 ` Bill Davidsen 1 sibling, 1 reply; 8+ messages in thread From: Olaf Hering @ 2007-01-15 17:54 UTC (permalink / raw) To: Andrew Walrond; +Cc: Jan Engelhardt, LKML On Mon, Jan 15, Andrew Walrond wrote: > >/sbin/hotplug and /init are two very different and unrelated things. > > Well, of course. But looking at the thread provided by Jan, it seems the > kernel might not be in any fit state to service the (userspace) hotplug > infrastructure when it makes the calls (Ie can't create pipes yet). Thats because noone really fixed the init call order. Its going back and forth since /init was added in 2.6.6. Ideally, there could be some /earlyinit that could prepare the enviroment for hotplug calls. Why do you need /sbin/hotplug anyway, just for firmware loading for a non-modular kernel? ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Initramfs and /sbin/hotplug fun 2007-01-15 17:54 ` Olaf Hering @ 2007-01-15 19:54 ` Andrew Walrond 2007-01-16 3:50 ` Mark Rustad 0 siblings, 1 reply; 8+ messages in thread From: Andrew Walrond @ 2007-01-15 19:54 UTC (permalink / raw) To: Olaf Hering; +Cc: Jan Engelhardt, LKML Olaf Hering wrote: > > Why do you need /sbin/hotplug anyway, just for firmware loading for a > non-modular kernel? I guess this is unusual, but FWIW... I have a custom distro and I was just looking for the easiest way to create a bootable rescue pen-drive. So I just took a working distro, added an init->sbin/init symlink, cpio'ed it into an initramfs, and booted it up. Works a treat, except for the early hotplug calls. Andrew ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Initramfs and /sbin/hotplug fun 2007-01-15 19:54 ` Andrew Walrond @ 2007-01-16 3:50 ` Mark Rustad 0 siblings, 0 replies; 8+ messages in thread From: Mark Rustad @ 2007-01-16 3:50 UTC (permalink / raw) To: Andrew Walrond; +Cc: Olaf Hering, Jan Engelhardt, LKML On Jan 15, 2007, at 1:54 PM, Andrew Walrond wrote: > Olaf Hering wrote: >> Why do you need /sbin/hotplug anyway, just for firmware loading for a >> non-modular kernel? > > I guess this is unusual, but FWIW... > > I have a custom distro and I was just looking for the easiest way > to create a bootable rescue pen-drive. So I just took a working > distro, added an init->sbin/init symlink, cpio'ed it into an > initramfs, and booted it up. Works a treat, except for the early > hotplug calls. I have a kernel that needs to have early hotplug calls to load firmware. I just rolled my own simple hotplug scripts to only address that issue and have not had a problem since. The mdev in busybox that is in the gentoo initramfs didn't seem to be able to handle it, so I just made my own scripts. In my case I needed QLogic firmware so root could be on FC. FWIW, it is a real PITA to not be able to build a monolithic kernel that can bring up root on its own. I will stipulate that I am an old- school guy that likes monolithic kernels, but I do feel that something has been lost. Yes, I am aware of the reasons for the change, else I would have written something when I was fighting the battle, but I still don't have to like it. -- Mark Rustad, MRustad@mac.com ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Initramfs and /sbin/hotplug fun 2007-01-15 17:36 ` Andrew Walrond 2007-01-15 17:54 ` Olaf Hering @ 2007-01-15 19:43 ` Bill Davidsen 1 sibling, 0 replies; 8+ messages in thread From: Bill Davidsen @ 2007-01-15 19:43 UTC (permalink / raw) To: Andrew Walrond; +Cc: LKML Andrew Walrond wrote: > Olaf Hering wrote: >> On Mon, Jan 15, Andrew Walrond wrote: >> >>> To solve this, I deleted /sbin/hotplug from the initramfs archive and >>> modified /init to reinstate it once it gets control. This works fine, >>> but seems inelegant. Is there a better solution? Should sbin/hotplug >>> be called at all before the kernel has passed control to /init? >> >> Yes, it should be called. > > Ok > >> /sbin/hotplug and /init are two very different and unrelated things. > > Well, of course. But looking at the thread provided by Jan, it seems the > kernel might not be in any fit state to service the (userspace) hotplug > infrastructure when it makes the calls (Ie can't create pipes yet). > > The kernel wouldn't call /init (or /sbin/init) before it was fully ready > to handle userspace processes, so why should it feel able to call the > hotplug userspace? > I could speculate in case it needs to hotplug something to complete boot, but it could just be a thinko. -- bill davidsen <davidsen@tmr.com> CTO TMR Associates, Inc Doing interesting things with small computers since 1979 ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-01-16 3:50 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-01-15 14:16 Initramfs and /sbin/hotplug fun Andrew Walrond 2007-01-15 16:44 ` Jan Engelhardt 2007-01-15 17:04 ` Olaf Hering 2007-01-15 17:36 ` Andrew Walrond 2007-01-15 17:54 ` Olaf Hering 2007-01-15 19:54 ` Andrew Walrond 2007-01-16 3:50 ` Mark Rustad 2007-01-15 19:43 ` Bill Davidsen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox