Get required multipath wwids from sysfs

The dracut code path must use for_each_host_dev_and_slaves_all to
find multipath devices that are "hidden" beneath e.g. an LVM volume.
That will iterate over all devices in the chain down to each physical
device. Note that /lib/udev/scsi_id sends a low-level SCSI command to
the device to find out the WWID. If it sends it to an unreachable
device in an active-passive multipath setup, it may hang indefinitely.

But the WWID is already available as the name of the multipath device,
so we can get it from the kernel via sysfs.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Split kdump_default_netdev()

This function did too many things, which are now split thus:

1. determine the default network interface
   -> kept in kdump_default_netdev

2. get the underlying physical devices of a bridge
   -> kdump_bridge_phys_dev

3. determine network interface operating mode
   -> kdump_netdev_mode

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Move dracut network command line to module-setup.sh

This is mostly a cleanup to allow adding more code to module-setup.sh
without too much duplication.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Add KDUMP_NETCONFIG modes to support IPv6

KDUMP_NETCONFIG had only two modes: static and dhcp, where dhcp
actually only means DHCP4. New modes are needed to get an IPv6
address on the interface.

Note that automatic configuration (KDUMP_NETCONFIG=auto) still uses
only IPv4, because dracut does not implement multiple alternative
ip configurations, and there's no way to determine in advance
which stack should be used.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Enable FADUMP on ppc64le

The FADUMP feature is only available on IBM POWER systems, but the
new little-endian variant has a new CMAKE_SYSTEM_PROCESSOR value.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Always turn on fadump if KDUMP_FADUMP is true

The problem is that fadump-related files under /sys/kernel are
created only if the kernel is booted with fadump=on. So, this
is a chicken-and-egg problem, and a reboot is always necessary if
the current kernel is loaded without fadump=on.

However, if the command line is not modified here, the admin must
first add fadump=on to the bootloader command line, and then enable
KDUMP_FADUMP, i.e. enable it in two different places. If the command
line is modified unconditionally, there is only one "big switch" for
FADUMP.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
kdump-Bootloader: add support for GRUB2

GRUB2 is very different from the other bootloader, because the final
configuration file is generated by an external utility. This means
that the command line must be modified in the global settings instead
of the individual section.


Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Fix exporting of non-contiguous bash arrays

The old code naïvely assumed that all arrays start at index 0 and are
contiguous. Solve it by storing array indices, e.g.:

( [0]=element [1]=another\ element )

Note that this syntax can be used to assign the array to an array
variable in bash.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Reuse kdump target mount point handling for /boot directory

Target mount points use a general algorithm to map paths in the
primary system to mount points in the initrd. The /boot directory
was handled separately, because the kdump_* arrays are also used
to modify the kdump config file.

Let's add a special "protocol" which should be handled like "file",
except it does not end up in KDUMP_SAVEDIR. This allows to reuse the
same mechanism to map it to an initrd path, and the root/boot special
cases can go away.

There's one small thing: kdumptool (in the initrd) does not know the
mapping. Originally, special symbolic links were created. We can
retain this logic by (ab-)using kdump_URL[] to pass the desired
target link name.

Note that the "root" symlink is no longer needed. It was only ever
used for the "boot" symlink if /boot was on the root filesystem.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>