This bug will contain various changes to initscripts for netboot.
Created attachment 356386 [details] Patch to allow merging of files within a state mounted directory. This is slightly modified from your earlier patch. The * must be outside of "" quotes to allow it to expand.
* /etc/statetab.d/netboot contains: /etc/sysconfig/network-scripts/ * /etc/sysconfig/readonly-root READONLY=yes STATE_OPTIONS="--bind /dev/.initramfs/" * dracut passed: /dev/.initramfs/etc/sysconfig/network-scripts/ifcfg-eth0 /dev/.initramfs/etc/sysconfig/network-scripts/ifcfg-br0 Not entirely pleased by this. We shouldn't have long and ugly Red Hat specific paths in dracut code. Prior to this, dracut would pass: /dev/.initramfs/ifcfg/ifcfg-eth0 /dev/.initramfs/ifcfg/ifcfg-br0 Problems ======== 1) I dislike dracut writing out a /etc/sysconfig/network-scripts/ hierarchy. Would you accept a patch to rc.sysinit that sets up the $STATE_MOUNT/etc/sysconfig/network-scripts/ if it sees /dev/.initramfs/ifcfg/ files? 2) This means you can't use a real persistent state mount with dracut netboot, as you will not be able to overwrite the ifcfg-* files the second time. To workaround this issue rc.sysinit could special case /etc/sysconfig/network-scripts/ and do the copying then --bind mount independent of state mounts. Would you accept a patch for this? (#1 is a subset of #2.)
Created attachment 356395 [details] ifup patch for dracut's new dhclient leases location
Please add these entries to the standard /etc/rwtab empty /var/log/ConsoleKit/ empty /var/lib/dbus/ empty /var/cache/hald/ empty /var/lib/pulse/ files /.viminfo files /etc/alsa/asound.state
dirs /etc/udev/rules.d/ Problem: We need this directory to be writable, but doing this in rwtab makes the files disappear. Would you accept a patch that adds a fourth type of rwtab entry that copies all files before bind mounting?
> dirs /etc/udev/rules.d/ > Problem: We need this directory to be writable, but doing this in rwtab makes > the files disappear. Would you accept a patch that adds a fourth type of rwtab > entry that copies all files before bind mounting? Alternatively, there currently isn't much functional difference between "dirs" and "empty". Why not modify dirs to copy files before the bind mount?
I am thinking a combination of Comment #6 and Comment #2 part 2. * dirs (or a new rwtab type) copies files before it bind mounts. * /etc/rwtab contains "dirs /etc/sysconfig/network-scripts" * rc.sysinit sees /dev/.initramfs/ifcfg/ and simply copies them into /etc/sysconfig/network-scripts Benefit: This doesn't clash with state mounts, possible to use persistent state mounts with dracut netboot. This is also simple.
Created attachment 356715 [details] Implementing dirs --files option, copy ifcfg files if they exist Add this line to the standard /etc/rwtab: dirs /etc/sysconfig/network-scripts/ --files * With this patch, rwtab entry like the above will copy the directory contents into the read-write directory before bind mounting. * Copy ifcfg files from initramfs netboot if they exists
(In reply to comment #2) > Problems > ======== > 1) I dislike dracut writing out a /etc/sysconfig/network-scripts/ hierarchy. > Would you accept a patch to rc.sysinit that sets up the > $STATE_MOUNT/etc/sysconfig/network-scripts/ if it sees /dev/.initramfs/ifcfg/ > files? No. We have a mechanism for storing local system state in the initscripts; the initscripts should not be growing special-case code for each type of state (whether it's ifcfg files, or iscsi files, or whatever). If there needs to be a bridge between dracut types and RH/Fedora-specific files, that's fine, but it should be part of the RH/Fedora dracut package, as that's what has the domain knowledge of what dracut is doing, in what versions.
(In reply to comment #4) > Please add these entries to the standard /etc/rwtab > > empty /var/log/ConsoleKit/ Already covered by dirs /var/log. > empty /var/lib/dbus/ I understand the idea here, but I don't see what will actually generate a new UUID. > empty /var/cache/hald/ > empty /var/lib/pulse/ OK. > files /.viminfo Not without some other justifcation, because - wtf? > files /etc/alsa/asound.state We don't use this any more, that I can see.
> No. > We have a mechanism for storing local system state in the initscripts; the > initscripts should not be growing special-case code for each type of state > (whether it's ifcfg files, or iscsi files, or whatever). > If there needs to be a bridge between dracut types and RH/Fedora-specific > files, that's fine, but it should be part of the RH/Fedora dracut package, as > that's what has the domain knowledge of what dracut is doing, in what This does not create a solution for the problem in Comment #2 part 2. ifcfg files passed by dracut is incompatible with persistent state mounts. The patch in Comment #8 is a better solution for this, while being useful for other purposes.
(In reply to comment #11) > This does not create a solution for the problem in Comment #2 part 2. ifcfg > files passed by dracut is incompatible with persistent state mounts. The patch > in Comment #8 is a better solution for this, while being useful for other > purposes. How so - what do you mean by 'second' time?
OK, I was thinking in the wrong direction. Here is the issue. If we use state mounts as you suggest to have /dev/.initramfs/ as $STATE_MOUNT, it works for this situation, however there are two problems. * This requires a RH-specific ugly hack in dracut. * This makes it impossible to use a real persistent state mount with dracut netboot. Netboot is exactly where persistent state mount is useful. So in effect you are suggesting we use existing mechanism at the expense of the original purpose of that mechanism. Comment #8 is a clean and simple solution.
NOTE: The patch in Comment #8 is also an elegant solution to the problem in Comment #5.
>> empty /var/lib/dbus/ > I understand the idea here, but I don't see what will actually generate a new UUID. Starting system message bus: Could not create file /var/lib/dbus/machine-id: Read-only file system
>> files /etc/alsa/asound.state > We don't use this any more, that I can see. Sending all processes the KILL signal... [OK] Saving mixer settings /sbin/alsactl: save_state:1530: Cannon open /etc/asound.state for writing: Read-only file system
(In reply to comment #16) > >> files /etc/alsa/asound.state > > We don't use this any more, that I can see. > > Sending all processes the KILL signal... [OK] > Saving mixer settings /sbin/alsactl: save_state:1530: Cannon open > /etc/asound.state for writing: Read-only file system That makes more sense - you had the wrong path initially. However, I do wonder how necessary having it writable on shutdown that is, for a stateless install. I suspect that redirecting stderr is a better solution.
Created attachment 358491 [details] alternative pach The point about breaking 'normal' state mounts is true. As for dirs --files, that isn't/shouldn't be necessary - just use 'files <foo>'. Here's an alternative solution, which should be easily implementable, not too hackish, and ensures that the initramfs can do whatever it needs for future situations without requiring synchronized updates with initscripts. The idea is that dracut (or the hooks for RH/Fedora) contain its own rwtab file, which can be extended with whatever it needs. For this initial case, it would likely be: files /etc/sysconfig/network-scripts Later, it could add: files /etc/iscsi.conf or whatever. Then, once that is processed, there's a single copy of whatever state the initramfs wants to provide is needed into the writable temporary state dir.
The /dev/.initramfs/state is a made-up directory name; we can use whatever.
Created attachment 359334 [details] Support rwtab and state passed from dracut initrd. That almost worked. Missing a trailing *. Attached patch works for me with accompanying code in dracut-0.10+.
Applied. http://git.fedorahosted.org/git/?p=initscripts.git;a=commitdiff;h=f1e3b00216c354c9bce703d67334bfcef4bb153a
initscripts-8.95.1-1 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/initscripts-8.95.1-1
initscripts-8.95.1-1 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.