One of the big problems with Genesis was that you'd get its coldplugging events
in that the events wasn't necessarily delivered in a sane order. I briefly
considered different ways of controlling the order of the events but quickly
came to the conclusion that was madness.

The solution I decided upon instead is generating an internal event after
coldplugging is finished and send that event to all event modules. This way we
can simply trigger on the 'genesis-started' event and start mounting
filesystems and whatever else is needed for bootup.

So how can you help? What I need right now from you is just playing around with
some homegrown scripts, trying to catch some events and telling me about all
the things that are absolutely impossible to do without. Testing Genesis is
quite simple and can easily be done without interfering with the rest of your
system.

How to test Genesis:
1. Clone the git://git.exherbo.org/genesis.git repository
2. Run ./autogen.sh in the genesis repository
3. Run ./configure
4. Run make
5. Run sudo make install (by default it installs to /usr/local and
won't conflict with anything)
6. Write a /usr/local/etc/genesis/config file
My current config file looks like:

[genesis]
# Currently supported log destinations are file and console
logging = console
logfile = /var/log/genesis.log

[modules]
command = yes
netlink-uevent = yes
netlink-route = yes

[netlink-uevent]
coldplug = yes
coldplug_mounts_sysfs = no
log_matched_events = yes
log_unmatched_events = yes

Ignore all the options except the coldplug_* options. The other options might
be necessary due to the rather haphazard way configuration is implemented
currently but don't expect them to work right now. The coldplug option
enables/disables coldplug events and the coldplyg_mounts_sysfs option controls
whether the coldplugging part tries to mount and umount /sys. You want to keep
this option disabled unless you're doing actual boot testing.

Stick one or more bash scripts in /usr/local/etc/genesis/netlink-uevent/ or
/usr/local/etc/genesis/netlink-route/ and try running: sudo
/usr/local/sbin/genesis

The test scripts I'm using currently looks like (from
/usr/local/etc/genesis/netlink-uevent/foo.sh):

SUBSCRIPTIONS_add=vcs10

add()
{
    echo "netlink-uevent::add" >> /var/tmp/genesis.log
}

You can add any number of event subscriptions you like in a single script or
spread subscriptions over several scripts. Each subscription is defined as
SUBSCRIPTION_function=trigger

Trigger is simply a regex that matches the metadata from events in an
internally serialized string format. Function denotes the function in the
script called when matching that event. So all the above script does is
triggering the add() function on all events matching the string 'vcs10'. Since
I have coldplugging enabled I'm guaranteed to see that event.

And that's all there is to it.. One of the things high on my TODO list is to
replace the regex matching with a udev like language where I can match on
subsystem, MAC address or whatever other metadata events generate. I'd very
much appreciate comments on what you think is needed in a simple language like
that.

Regards,
Bryan Østergaard

_______________________________________________
Exherbo-dev mailing list
[email protected]
http://lists.exherbo.org/mailman/listinfo/exherbo-dev

Reply via email to