"ifup -m" was thought to be used by humans in the emergency shell.
Using it programatically shows some other flaw in the execution logic.
Also, "ifup -m" was configuring the interface multiple times on "add"
and "change" uevent, because the "$netif.did-setup" test was not
executed.
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>
For targets with colons in the iSCSI target name:
"iqn.2000-09.com.foo:storage-system.e2000:00000001cm1p1"
the parser was confused with the optional iscsi_iface_name and
iscsi_netdev_name.
This patch reintroduces the old IQN, EUI and NAA parsing and enhances
the fallback parser by checking the LUN for a numerical value.
The module_setup.sh script was missing an '_arch' declaration,
causing network not to be installed on s390.
Signed-off-by: Thomas Renninger <trenn@suse.de>
In the judgment sentence, it will print the following warning message,
becasuse of lacking the blank on the left of ']'.
/lib/net-lib.sh: line 110: [: missing `]'
Signed-off-by: Minfei Huang <mhuang@redhat.com>
It is not available to valid the customize dhcp config
/etc/dhclient.conf in the initram environment.
Dracut uses the default follow config to construct the initramfs.
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
root-path, interface-mtu;
Copy the customize config to make the config availably in the
initram environment.
Signed-off-by: Minfei Huang <mhuang@redhat.com>
When you define the gateway for an interface, dracut sets it up with:
ip route add default via $gw dev $netif
If a default route is already set (e.g. if you have multiple NICs), this
will fail with the message "RTNETLINK answers: File exists".
So, if your first NIC isn't usable as a default route
Using "ip route replace default" instead allows ifup/dhclient-script to
correctly change the default route to the new interface.
When installing OS to a VLAN enabled iscsi LUN (extracted from iBFT), "/tmp/net.{xyz}.has_ibft_config" is not being set properly.
Then anaconda installer requires 'BOOTPROTO="ibft"' populated in ifcfg of the vlan interface (ex: ibft0.20), for it to properly populate the kernel parameters post installation. The setting 'BOOTPROTO="ibft"' is populated by write-ifcfg.sh script only if the corresponding interface has a file /tmp/net.{xyz}.has_inft_config
To get around this issue, in ibft_to_cmdline() function in net-lib.sh file, I made the following changes to populate the has_ibft_config file for the vlan interface(ex: ibft0.20):
rd.iscsi.ibft[=1] should be used instead.
Thing is, 'ip=ibft' is not really an ip setting, but rather a marker
that iBFT should be evaluated.
Also removed the trigger of the warning:
"Warning: Please supply bootdev argument for multiple ip= lines"
When a bonded interface is brought up, any slaves included in the bond
have their hardware address set to that of the bond master. Although
this allows an interface to be brought up on start up, when the
configuration file is imported into the booted system it prevents
the bonded interface being successfully restarted.
The fix involves obtaining the hardware address of the slaves before
they are added to the bond and then using this value in the
configuration file.
By convention, strstr should be a literal string match. Previously, it
would match as a glob pattern. Some code used that, so add new
functions strglob and strglobin to do what that code expects, and
specify them tightly too. strglob tests whether the glob pattern
matches the entire string (the name strglob is also used in the yorick
language, and that's what it does there), while strglobin tests whether
the glob pattern matches anywhere in the string.
Also tightens str_starts, str_ends, and str_replace to deal with
literal strings only. In a quick grep I did not find code that depended
on these functions matching globs.
Changes the call sites where strstr was used with glob patterns to use
strglobin or strglob as the intention seemed to be (or, in one case,
strstr with the * removed as it did not affect the result anyway).
Add new functions require_binaries() and require_any_binary() to be used
in the check() section of module-setup.sh.
These functions print a warning line telling the user, which binary is
missing for the specific dracut module.
This unifies the way of checking for binaries and makes the life of an
initramfs creator easier, if he wants to find out why a specific dracut
module is not included in the initramfs.
The dracut dhclient-script.sh should set address lifetimes to the DHCP
lease time, so that other stuff (like NetworkManager!) knows that the
address is temporary and was created by DHCP.
https://bugzilla.redhat.com/show_bug.cgi?id=1058519