Dracut changes from F17 to F18 (was Re: [PATCH] Load anaconda-lib.sh if necessary)

Will Woods wwoods at redhat.com
Thu Aug 16 18:03:49 UTC 2012


On Wed, 2012-08-15 at 06:39 -0700, Brian C. Lane wrote:
> On Tue, Aug 14, 2012 at 10:39:30PM -0700, Jesse Keating wrote:
> > For some reason right now this library is not being imported at the time
> > repo-genrules.sh is being ran, so add a stub that forces the import
> > since we need the $rulesfile variable.
[...]
> Ack. Although I'd like to figure out why this has changed and what other
> fallout there will be from whatever the root cause is.

For the record, here's what's changed: F18 dracut is using systemd in
initramfs.

The overall flow of dracut remains basically the same, but instead
of /init being dracut's 99base/init.sh, it's systemd.

The dracut systemd setup uses basic.target as its default target, with a
bunch of dracut services added to basic.target.wants.

The dracut services run the dracut hooks, as follows:

  dracut-cmdline.service       (cmdline)
  dracut-pre-udev.service      (pre-udev)
  dracut-pre-trigger.service   (pre-trigger)
  dracut-initqueue.service     (initqueue/*, pre-mount, mount)
  dracut-pre-pivot.service     (pre-pivot, cleanup)

So the main difference (and the cause of the problem) is that each
service runs a *different* shell process, when previously they all ran
in the same shell.

On the plus side, exported variables *are* deliberately passed on to the
subsequent services/hooks. Everything else gets lost.

This means:

1) We need to import libraries (e.g. anaconda-lib.sh) in each hook. It
doesn't need to happen in each individual *script*, but you need to be
sure that either a) your script imports the library, or b) a previous
script definitely imports it for you.

2) Variables that need to be passed between hooks (e.g. '$kickstart')
must be exported to ensure they'll be visible in later hooks.

We should review the code to make sure it all works as expected. So far
everything seems OK, but some patches might be forthcoming if I find
anything weird.

Hope that helps,

-w



More information about the anaconda-patches mailing list