When 'systemctl daemon-reload' is run, systemd will clean out
/run/systemd/generator and re-run all the generators.
So it is important that the generators always create the required
files.
rootfs-generator.sh currently does *not* create the desired files
if $hookdir/initqueue/finished/devexists-${_name}.sh
exists.
This is not removed by "systectl daemon-reload" so the first time this
generator is run it will do the right thing. Subsequent times it
won't.
This results in incorrect timeouts after "daemon-reload" is run.
So let the existence of each file only guard the creation that file.
Signed-off-by: NeilBrown <neilb@suse.de>
A number of timeout scripts can be registered. If any one of them
makes progress - e.g. assembles a degraded md array - then
the main loop should wait a bit longer rather than pressing forward.
This is particularly important is resume-from-hibernate requires a
degraded md array. Both the script to forcibly assemble the md array
and the script to abort hibernation if the device doesn't appear
are 'timeout' scripts. There needs to be a reasonable delay between
these running.
So: if any script has indicated that progress was made, break of out
the loop and go back to normal waiting.
Signed-off-by: NeilBrown <neilb@suse.de>
mdraid_start is a number of scripts which run after a timeout.
If it makes progress, it should tell the main loop so that it
knows that it is worth waiting a bit longer.
So in that case, create the initqueue/work file which the main loop
checks for.
Signed-off-by: NeilBrown <neilb@suse.de>
When current dracut receives an ip with netmask of 255.255.255.255 via DHCP,
setting the also supplied default gateway fails (because it is obviously not
within the netmask).
The setup with a netmask of /32 is quite common in colocation datacenters
where you don't want the machines of two different customers to directly talk
to each other. At least two of the biggest colocation providers in Germany
(1&1 and Strato) do it that way. NetworkManager supports this kind of setup
and the dhclient-scripts of several distributions too.
In this patch I have implemented a simple approach very similar to what is
found in Debian. The dhclient-script from Fedora uses a more sophisticated
approach, but that relies on the ipcalc utility which would introduce a
dependency on Fedora-initscripts for dracut.
Signed-off-by: Gerd von Egidy <gerd.von.egidy@intra2net.com>
When the 'loop' kernel module isn't loaded in a running system, it gets
excluded from the hostonly initrd. Given that the crypt-loop dracut
module has to be loaded explicitly anyway, it makes sense to always
include the requisite loop kernel module.
When booting with 'rd.info', the 'info' statements in the crypt-loop
module's 'loop_decrypt' function are output to stdout along with the key
that gets piped into the 'cryptsetup' command, which causes the crypt
device unlocking to fail.
There are two possible simple solutions to this problem:
1. Redirect the info messages to stderr (just add '>&2' at the end of
the info statements).
or
2. Remove the info statements altogether.
I have tested both and they both work, but this commit implements #2.
The existing info messages are long (they overflow 80 characters
easily) and redundant (the password prompt clearly indicates what is
happening), and just generally not useful. Given that no one has
reported or fixed this bug in the three years that this module has
existed, no one will miss these info messages.
The commit also changes an error message in the same function to be more
descriptive.
With an EFI stub, the kernel, the initramfs and a kernel cmdline can be
glued together to a single UEFI executable, which can be booted by a
UEFI BIOS.
Basic systemd functionality is in 00systemd now.
Switching root and the initrd.target is in 00systemd-initrd.
Dracut additions to the systemd initrd are in 98dracut-systemd.
Previously rd.live.fsimg only supported filesystems residing in
(compressed) archives.
Now rd.live.fsimg can also be used when a squashfs image is used.
This is achieved by extracting the rootfs image from the squashfs and
then continue with the default routines for rd.live.fsimg.
In addition some code duplication got removed and some documentation
got added.
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
This option changes the underlying mechanism for the overlay in the
dmsquash module.
Instead of a plain dm snapshot a dm thin snapshot is used. The advantage
of the thin snapshot is, that the TRIM command is recognized, which
means that at runtime, only the occupied blocks will be claimed from
memory, and freed blocks will really be freed in ram.
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Dracut will generate systemd units for additional devices that should be
brought up during boot, e.g. swap devices. These unit files are broken
symlinks with \ in the filename, e.g.
/etc/systemd/system/initrd.target.wants/dev-disk-by\x2duuid-e6a54f99\x2da4fd\x2d4931\x2da956\x2d1c642bcfee5e.device.
Both the backslash and the broken symlink causes problems for shell
scripts, [ -e "$file" ] isn't enough and read requires the additional -r
argument to not react on the \.
The function 99shutdown/shutdown.sh:_check_shutdown() assumes that
shutdown scripts report success or failure via their return value.
However, "dmsetup remove_all" always reports success, even if some
of the device mappings could not be removed.
I submitted a patch for dmsetup but the lvm2 folks rejected it,
asserting that its behaviour is correct, that "remove_all" should
only be used by developers and that the proper solution would be
to invoke "dmsetup remove" on each device. This does report success
or failure via the return value.
Apart from fixing that issue, this commit also adds the dmsetup
option "--noudevsync". Without it, dmsetup would hang after removal
of a device while trying to communicate with systemd-udevd, which
is no longer running at this shutdown stage.
[harald: replaces backticks with $() ]