From: "Alexander E. Patrakov" <patrakov@ums.usu.ru>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] Enable all events for initramfs
Date: Thu, 15 Jul 2004 16:45:17 +0000 [thread overview]
Message-ID: <40F6B49D.7090103@ums.usu.ru> (raw)
In-Reply-To: <40F3C48F.30905@suse.de>
Alexander E. Patrakov wrote:
> Hannes Reinecke wrote:
>
>> Hi all,
>>
>> currently most driver events are not sent out when using initramfs as
>> driver_init() (which triggers the events) is called before
>> init_workqueues.
>>
>> This patch rearranges the init calls so that the hotplug event queue
>> is enabled prior to calling driver_init(), hence we're getting all
>> hotplug events again.
>>
>> Patch is relative to 2.6.7-mm6, but should apply to 2.6.8-rc1 also.
>>
>> Please apply.
>
LFS-ers: get it from http://lkml.org/lkml/diff/2004/7/13/74/1
>
> This is probably a very good news.
>
> I see the following application of it. Since no hotplug events are
> dropped any more, the initramfs could save their type and environment in
> files on a ramfs, and then remount that ramfs to some location
> accessible by the main system. The information accumulated in these
> files can be used for re-synthesis of events not handled because e.g.
> /usr was not mounted.
It appeared to be easier to just make /sbin/hotplug processes in
initramfs sleep until they can call /sbin/hotplug on the real root.
> This means that we can drop the udevstart program and *.rc files that
> come with the hotplug package and replace them by playback of such
> recorded events. This looks much cleaner, since right now the
> reconstruction is imperfect.
>
> I will try to implement this approach (i.e, create initramfs and modify
> the hotplug and udev packages) during this week on a copy of Linux From
> Scratch 20040702, and report the results here.
>
Done.
The initramfs image (busybox-based) is available at:
http://ums.physics.usu.ru/~patrakov/initramfs_data.cpio.gz
md5sum: 69f5b834526b4ce918887c2f7a4067a6
This has been tested on my computer with LFS SVN-20040702 and
LFS-bootscripts 20040704 with the following changes:
1) The mountkernfs, udev, checkfs and hotplug initscripts should be
disabled or removed. Removal of checkfs is because of (3) below, other
initscripts are not needed because my initramfs does their jobs. For
those not familiar with LFS, the "mountkernfs" initscript mounts /proc
and /sys, the "udev" initscript mounts ramfs on /dev and then runs
udevstart and creates some extra nodes, "checkfs" runs fsck, "hotplug"
is a pretty much original initscript that comes with the hotplug package
that should be well-known here :)
2) The LFS-specific change of the kmod.c file should be dropped
3) The use of a journaled filesystem (e.g. ext3) mounted rw at boot is a
must. /sbin/hotplug may mishandle hotplug events on read-only root.
4) The /proc, /sys and /proc/bus/usb entries in /etc/fstab should be
marked as "noauto"
5) The following line should be added to /etc/modprobe.conf:
install usbcore /sbin/modprobe -i usbcore ; mount /proc/bus/usb
(usbcore must be a module, or a modification of /init is needed)
Results: all my devices are in /dev, all modules for my hardware are
loaded due to early hotplug events delivered to /sbin/hotplug without
any loss.
Caveats:
1) a kernel bogusly complains about runaway modprobe loop net-pf-1. This
is really not a loop, just imagine that 200 "udevd" behemots
simultaneously try to create a socket :( Don't compile af-unix as a module.
2) The loop that waits for all hotplug processes to go away doesn't seem
to work. As a result, a bug involving a race between hotplug and e.g.
swapon is likely to exist.
--
Alexander E. Patrakov
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idG21&alloc_id\x10040&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
prev parent reply other threads:[~2004-07-15 16:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-13 11:16 [PATCH] Enable all events for initramfs Hannes Reinecke
2004-07-14 4:01 ` Alexander E. Patrakov
2004-07-14 6:24 ` Olaf Hering
2004-07-15 16:45 ` Alexander E. Patrakov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40F6B49D.7090103@ums.usu.ru \
--to=patrakov@ums.usu.ru \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).