Commit Graph

90 Commits (052)

Author SHA1 Message Date
Harald Hoyer d4b1d669d7 fix: shellcheck for modules.d/95fcoe/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 9c0deb9f68 fix: shellcheck for modules.d/95fcoe/cleanup-fcoe.sh 2021-02-15 11:00:37 +01:00
Zoltán Böszörményi 03d132a76c fix: quote globbing in module-setup.sh for inst_multiple
Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Kairui Song 8c8af8a2cd 95fcoe: don't install if there is no FCoE hostonly devices
When in hostonly mode, 95fcoe module will still be installed even there
is no FCoE hostonly device. So use the new block_is_fcoe helper to check
for hostonly device in hostonly mode, avoid installing unneccessary module.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-11-23 17:23:38 +01:00
Kairui Song 4339d47cf8 95fcoe: ensure needed modules are installed
If fcoe module is loaded, the initramfs will always try load libfcoe
and bnx2fc, so also ensure they are installed if needed.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-11-18 14:18:01 +01:00
Thomas Blume 8446c8f9de 95fcoe: default rd.nofcoe to false
rd.nofcoe should default to false, e.g. fcoe should be enabled unless
overwritten from the command line.
The same applies for lldapd.sh.
2020-03-11 12:29:03 +01:00
Radek Vykydal 7fb8f939a5 Fix pre-trigger stage by replacing exit with return in lldpad.sh
Using exit makes the pre-trigger stage finish after running 03-lldpad.sh
pre-trigger hook.
2020-03-10 12:47:55 +01:00
Frantisek Sumsal ef8915d7af fcoe/fcoe-genrules.sh: use $name instead of $env{INTERFACE}
Followup to a8ba1c4e25 and
11a5501d0f
2020-02-28 20:41:37 +01:00
Böszörményi Zoltán a01204202b Allow running on a cross-compiled rootfs
For the shell scripts, new environment variables were introduced.

dracutsysrootdir is the root directory, file existence checks use it.

DRACUT_LDCONFIG can override ldconfig with a different one that works
on the sysroot with foreign binaries.

DRACUT_LDD can override ldd with a different one that works
with foreign binaries.

DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot
may use symlinks that are valid only when running on the target
so a real file must be provided that exist in the sysroot.

DRACUT_INSTALL now supports debugging dracut-install in itself
when run by dracut but without debugging the dracut scripts.
E.g. DRACUT_INSTALL="valgrind dracut-install or
DRACUT_INSTALL="dracut-install --debug".

DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA,
DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ,
DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4,
DRACUT_COMPRESS_CAT: All of the compression utilities may be
overridden, to support the native binaries in non-standard places.

DRACUT_ARCH overrides "uname -m".

SYSTEMD_VERSION overrides "systemd --version".

The dracut-install utility was overhauled to support sysroot via
a new option -r and fixes for clang-analyze. It supports
cross-compiler-ldd from
https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f

DRACUT_INSTALL_PATH was introduced so dracut-install can work with
a different PATH. In a cross-compiled environment (e.g. Yocto), PATH
points to natively built binaries that are not in the host's /bin,
/usr/bin, etc. dracut-install still needs plain /bin and /usr/bin
that are relative to the cross-compiled sysroot.

The hashmap pool allocate_tile/deallocate_tile code was removed
because clang-analyze showed errors in it. hashmap_copy was removed
because it wasn't used and clang-analyze showed errors in it.

DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were
introduced so dracut-install can use different settings from
DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL.

Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
2019-10-25 11:58:58 +02:00
Kairui Song d9721f20d8 95fcoe: load 'libfcoe' module as a fallback
The kernel may only enable 'libfcoe' module. Some modules like bnx2fc
provides FCoE but only depend on 'libfcoe'. Loading 'fcoe' module may
fail but the kernel do support FCoE.

'libfcoe' will be installed as a dependency when installing block device
drivers if it's required. So no need to install it in installkernel.

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-07-19 16:19:07 +02:00
Daniel Molkentin 4f19427641 95fcoe: Fix startup when fcoe module is included
The parse-fcoe.sh hook is sourced, and hence must not contain
exit 0 calls. Otherwise, the cmdline sequence will be interupted,
and no error will be reported to systemd. Use return instead.

Reference: boo#1136977
2019-07-19 00:25:06 +02:00
Patrick Talbert 7c6d2ad916 95fcoe: Add the rd.nofcoe option to disable the FCoE module from the command line
Images built with the fcoe module will always run the lldpad
service as part of their pre-trigger scripts if the network
is active. This prevents network installations in
environments where, for security reasons, LLDPDU frames
cause a switchport shutdown.

Add a new rd.nofcoe option to cause dracut to skip the
lldpad.sh script and the entire 95-fcoe module.

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
2019-01-18 14:10:19 +01:00
Harald Hoyer 1caaeaae1e modules.d/95fcoe/cleanup-fcoe.sh: chmod +x 2018-07-12 15:19:17 +02:00
Hannes Reinecke 164760f4b0 95fcoe: use interface names instead of MAC addresses
Now that we are using persistent network names we can switch
to using the interface names when specifying the fcoe configuration.
With that we can print the fcoe configuration only once.

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke fd13d5d4d5 95fcoe: add timeout initqueue entries
Occasionally the FCoE connection might be reset after fipvlan was
called, causing the FCoE connection to be dropped and boot to fail.
For these cases we should be adding a timeout entry for the
initqueue to have a failsave mechanism to re-run fipvlan in
these cases.

References: bsc#1052840

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke 36a8b2e305 95fcoe: Switch back to using fipvlan for bnx2fc
bnx2fc doesn't _actually_ need fcoemon, so fipvlan is sufficient
to start the FCoE connection.
And, in fact, fcoemon is started for every interface, causing
subsequent invocations to fail with

fcoemon[1157]: error 98 address already in use

and fcoemon tearing down the connection.

References: bsc#1052840

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke 4e3eb1e9d1 95fcoe: fixup fcoe-genrules.sh for VN2VN mode
The 'mode' argument was never referenced in the printf format, causing
invalid rules to be written.

References: bsc#1036323

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke a3f91db476 95fcoe: Add shutdown script
We should be disabling the FCoE connection (which triggers sending
a LOGO internally) to logout from the target; this resets the target
and will avoid hitting a busy condition during reboots.

References: bsc#994860

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke 2aac319410 95fcoe: always set AUTO_VLAN for fcoemon
fcoemon is well capable of figuring out whether a vlan should
be used, so there's no need to disable the AUTO_VLAN feature.

References: bsc#995019

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:05 +01:00
Hannes Reinecke c75196e11e 95fcoe: Allow to specify the FCoE mode via the fcoe= parameter
FCoE can run in Fabric (ie FCF) or VN2VN mode, so we should allowing
to set this parameter from the commandline, too.

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 18:51:49 +01:00
Daniel Molkentin d71c9ee286 95fcoe: silence lldpad warnings
When lldpad is not running, any calls to 'dcbtool' will be printing
out a warning. As it perfectly legit to have FCoE running without
DCB we should not be printing out the error.

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 18:51:49 +01:00
Hannes Reinecke d066fcc3fb 95fcoe: Do not overwrite FCoE configuration
If the installation already has a FCoE configuration we should
not attempt to overwrite it but rather use the pre-defined
configuration.

References: bsc#993861

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 18:51:49 +01:00
Johannes Thumshirn 6b96b50d2c 95fcoe: Reorder initialisation for bnx2x
Check first if we're running off an bnx2x device and start FCoE on it
via fipvlan, then go the normal/Intel way of starting DCB.

Also the SUSE version of fcoemon needs the yes parameter for the
--syslog option

References: bsc#982588

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.com>
2017-12-15 18:51:42 +01:00
Xunlei Pang 795256bbb1 fcoe: handle CNAs with DCB firmware support
Some Combined Network Adapters(CNAs) implement DCB protocol
in firmware, it is recommended that do not run software-based
DCB or LLDP on CNAs that implement DCB, but we have to start
the lldpad service anyway(there might be other software DCB).

If the network interface provides hardware DCB/DCBX capabilities,
the field DCB_REQUIRED in "/etc/fcoe/cfg-xxx" is expected to
be set to "no".

We met an issue on "QLogic BCM57810" with DCB firmware support,
and found dracut still generated "fcoe=<mac>:dcb" which caused
kdump boot failure when using that fcoe dump target.

This patch parses /etc/fcoe/cfg-xxx to detect DCB_REQUIRED="no",
and force "nodcb" if it is the case.

Also improved some coding style in passing.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2017-09-27 10:36:44 +08:00
Harald Hoyer 1279a9e1a0 fcoe: install hba.conf and libhbalinux only if hba.conf exists 2017-08-07 14:45:55 +02:00
Chad Dupuis 3966a1e1ee fcoe: Allow more time for the bnx2x link negotiation before brining up fcoe interfaces.
bnx2x can take no longer than 3 seconds to initialize the link in some setups
which can cause fipvlan to fail and thus the fcoe interface(s) won't be
created.

Add another 10 seconds to give the link enough time to initialize.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
2016-10-12 19:02:39 +02:00
Harald Hoyer 5a3773dbe6 fcoe: check if needed for hostonly
(cherry picked from commit f45726652f)
2016-07-14 13:57:21 +02:00
Harald Hoyer f8242a6a60 fcoe/cleanup-fcoe.sh: don't copy shm files to state
with systemd version 230, this is not necessary anymore
systemd commit cacf980ed44a28e276a6cc7f8fc41f991e2ab354
because /dev/shm is selinux relabled.
2016-06-27 12:03:55 +02:00
Harald Hoyer b99e72427b Revert "fcoe: no need to copy lldpad state"
This reverts commit e93ff1cf9a.

seems like the file has to be copied back in the real root.

https://bugzilla.redhat.com/show_bug.cgi?id=1246217
2016-04-14 13:38:24 +02:00
Ville Skyttä bcabe0fe25 Clean up some bashisms from /bin/sh scripts 2016-03-28 11:52:14 +03:00
Harald Hoyer e93ff1cf9a fcoe: no need to copy lldpad state
/dev/shm should be available later on by the normal switch root bind mount.
2016-01-07 10:44:31 +01:00
Harald Hoyer 4a88aaff10 fcoe: cleanup lldpad
Resolves: rhbz#1246217
(cherry picked from commit 69c437dd1c)
2015-11-11 16:14:51 +01:00
Harald Hoyer cca313fa75 fcoe/fcoe-edd.sh: cleanup the script
- check if modprobe was successful
- add a timeout for /sys/firmware/edd
- only remove the module, if it was loaded by the script

(cherry picked from commit 34203d03c0)
2015-11-11 15:45:14 +01:00
Chris Leech 9a5bd6804a fcoe: EDD parsing patch for i40e
(cherry picked from commit 4031a2fa64)
2015-11-11 15:45:10 +01:00
Chris Leech 4891d9a2ce fcoe: start with fcoemon instead of fipvlan
(cherry picked from commit d02f522089)
2015-11-11 15:33:13 +01:00
Mike Gilbert 5899f2f516 Replace echo -n with printf in code with a /bin/sh shebang
POSIX does not mandate that echo support the -n parameter.
printf has more well-defined behavior.
2015-07-14 22:22:14 -04:00
Hannes Reinecke b8efaa0017 Reset IFS variable
Setting and unsetting the IFS variable is tricky. To be on the
safe side we should always reset the IFS variable to its original
value after parsing.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-07-07 13:44:24 +02:00
Harald Hoyer 437dad70e9 Defer modprobe of HW modules, until udev is running
Also honor blacklisting
2015-04-24 11:59:37 +02:00
Harald Hoyer bbbdba2ec3 fcoe/lldpad.sh: add executable flags 2015-03-24 16:03:47 +01:00
Hannes Reinecke 22e837b645 95fcoe: start lldpad separately
lldpad is a system-wide process, which must be started only once.
So we should be separate it from fcoe-up, as it might be called
several times.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke 0a68a26cff 95fcoe: skip VLAN devices in fcoe-up
DCB & fipvlan can only be called on real devices, not VLAN
ones. So skip any VLAN devices which might been added to the
list of network interfaces.

References: bnc#878583

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke 8b257fcc86 95fcoe: Store current configuration in dracut cmdline
When running with --hostonly-cmdline we should be storing
the current configuration in /etc/cmdline.d so that dracut
will be configure the system automatically.

References: bnc#877288

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke c64a94caa9 95fcoe: update fcoe interface check
The 'create' sysfs entry has been removed for newer fcoe modules,
so just check if the module directory exists.

References: bnc#877288

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Harald Hoyer 967cc19ab1 remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
Harald Hoyer 3c530fc528 fcoe: workaround fcoe timing issues 2014-04-02 09:58:12 +02:00
Harald Hoyer 3aaf6ccc83 fcoe: wait for lldpad to be ready 2014-03-25 15:31:00 +01:00
Harald Hoyer f60b7d8655 fcoe-up: remove initlog logic 2014-03-05 13:21:25 +01:00
Harald Hoyer 30e6e809ed Factor out all the "type -V" commands
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.
2014-02-06 16:45:20 +01:00
Harald Hoyer 89031be373 move uefi-lib to a seperate module 2013-12-12 09:49:06 +01:00
Harald Hoyer ab173bb4c1 fcoe: move uefi parsing to fcoe-uefi module 2013-12-12 09:21:44 +01:00