Commit Graph

69 Commits (b80ee080937ce364f7324c297f23e40af6d88892)

Author SHA1 Message Date
Harald Hoyer e25c536c70 fix(network): shellcheck for modules.d/40network 2021-03-29 09:57:50 +02:00
Harald Hoyer 9a52c3fdb0 style: shfmt reformat
reproducible with:

```
$ shfmt_version=3.0.1
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w .
```
2021-03-13 20:10:43 +01:00
Harald Hoyer e7b4442cfc fix: shellcheck for modules.d/40network/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 16efdfa25c fix: revise all module checks
1. no module checks for modules which are in depends()
2. no `derror` for optional (255) modules checking for dependencies
3. fix dbus meta module
2021-02-10 13:29:17 +01:00
Daniel Molkentin 5fc7c05321 40network: introduce wicked option 2020-11-25 18:21:39 +01:00
Kairui Song 5698258d30 90qemu-net: in hostonly mode, only install if network is needed
Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13: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
Lubomir Rintel 35efada5ec network: parse root=dhcp also with network-manager module
Move the logic from network-legacy to common network code.
2019-07-19 16:21:13 +02:00
Kairui Song 83cbc06ab9 40network: Don't include 40network by default
commit 7347391 ('network-legacy: split off from network module')
splitted network function to network-legacy and removed check() function
of 40network. This caused 40network to be included even if network is
not needed.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-10-12 13:17:58 +02:00
Lubomir Rintel 08bdadbf31 network-manager: add module 2018-09-21 11:32:01 +02:00
Lubomir Rintel 734739187b network-legacy: split off from network module 2018-09-21 11:32:01 +02:00
johannes 69acd20d4e 40network: install grep
since version 046 40network/net-lib.sh uses grep but the module does not install grep
2017-12-11 17:52:03 +01:00
Harald Hoyer 017978f868 network: redirect stderr for arping test 2017-07-28 11:54:27 +02:00
Harald Hoyer 400a85ffaf install arping V2 as arping2 2017-07-24 10:03:42 +02:00
Harald Hoyer 041e49ee2a network: enhance team support
Install ifcfg-* files with team configuration in the initramfs.

Improve the slave configuration of the team interface, by looking up
ifcfg files in the initramfs.

Create a default loadbalance team config, if none present in the
initramfs.

forward port of
4c88c2859e
2017-03-30 11:50:35 +02:00
Daniel Molkentin 285495814b Drop dependency on bridge-utils 2017-02-14 14:10:24 +01:00
Xunlei Pang 242c03d6fb network: use require_any_binary instead of require_any_binaries 2016-08-19 13:39:37 +02:00
Harald Hoyer 9853791d37 network: use arping2, if available
fixes https://github.com/dracutdevs/dracut/issues/135
2016-07-14 14:36:04 +02:00
Harald Hoyer 9e19c0512d Revert "network: remove awk call and replace it with a shell function"
This reverts commit 71867b665c.

network needs posix shell
2016-06-07 14:27:35 +02:00
Harald Hoyer 71867b665c network: remove awk call and replace it with a shell function
changes commit 4fa5c235a7
2016-06-07 11:15:07 +02:00
Xunlei Pang 4fa5c235a7 network/net-lib.sh: delete duplicated DNS items from "/etc/resolv.conf"
Users can pass the DNS information throught "nameserver=" cmdline,
there maybe duplicated inputs.

"/etc/resolv.conf" have some restrictions on the number of DNS items
effective, so make sure that this file contains no duplicated items.

We achieve this by simply making the file have no duplicated lines.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-04-26 13:03:30 +02:00
Harald Hoyer ae43adb70d network: split out kernel-network-modules 2015-03-24 16:03:47 +01:00
Hannes Reinecke 681462eca8 40network: add missing _arch variable declaration
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>
2014-12-16 13:29:37 +01:00
Minfei Huang 56d2aed1c8 40network: Copy the customize dhcp config
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>
2014-10-29 14:13:50 +01:00
Harald Hoyer 967cc19ab1 remove all vim and emacs code format comments 2014-08-29 13:38:47 +02: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 7e916ae4e0 network: include all ethernet drivers 2014-01-15 14:40:12 +01:00
Harald Hoyer 3ad42552ca network: include usbnet drivers 2013-12-19 17:06:48 +01:00
Harald Hoyer 8bcfd683bd */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
Harald Hoyer a242ef13e0 network: move ibft parsing before all other network cmdline parser
otherwise the config produced by ibft will not get processed
2013-08-26 10:18:47 +02:00
Harald Hoyer f34e1d6b0e network: do not depend on ifcfg
rather let ifcfg return 0 if /etc/sysconfig/network-scripts exists
2013-08-20 15:09:33 +02:00
Harald Hoyer af11946054 dracut-functions.sh: inst_multiple == dracut_install 2013-08-07 10:33:15 +02:00
Harald Hoyer 41eba87b32 dracut_need_initqueue 2013-03-06 17:29:11 +01:00
Cong Wang 3baa150bd4 dracut: add team device support
V2: merge patch 2/2
    fix active-backup mode by adding slaves one by one
    sync with the latest teamd
    improve the comments
    wait for team ports to come up
    install /etc/libnl/classid too

This patch adds the initial support for team device [1].
A new cmdline team= is introduced for it.

Note, currently we don't support stacked devices
on/under team, it is tricky and can be added on request.

1. http://www.libteam.org/

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <amwang@redhat.com>
2012-12-14 09:06:51 +01:00
Harald Hoyer dc67eda6bf combine some instmods 2012-10-16 13:16:53 +02:00
Harald Hoyer 48ca487621 install virtio* modules in the generic case
https://bugzilla.redhat.com/show_bug.cgi?id=864012
2012-10-09 17:44:29 +02:00
Harald Hoyer 54c7ace145 network: add ping and ping6
better for a quick debug
2012-08-22 17:28:06 +02:00
Harald Hoyer bf7883ebca network/module-setup.sh: instmods af_packet 2012-07-25 14:56:29 +02:00
Harald Hoyer 99c7b70d1d modules.d: get rid of "tr"
replace it with sed or str_replace or bash ${var/a/b}
2012-06-29 12:41:27 +02:00
Harald Hoyer 53fe81e752 modules.d/*/module-setup.sh: combine and specify type for installs
To speedup image creation, combine dracut_install calls and specify the exact type.
E.g. inst_script instead of the generic inst.
2012-06-29 12:41:27 +02:00
Harald Hoyer 94165394ff network/module-setup.sh: fixed installkernel() return code 2012-06-29 12:41:26 +02:00
Harald Hoyer 361306c131 check for arch before installing drivers/s390 2012-06-21 01:11:43 +02:00
Harald Hoyer 9073ff54c1 fix return value of some installkernel() functions 2012-06-01 17:09:51 +02:00
Cong Wang cbf66c5f06 Do not use ifenslave
ifenslave is an old tool, and could be dropped,
we can use the /sys interface.

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-05-29 11:18:51 +02:00
Cong Wang 8eb81d482c Add vlan support in network module
This patch adds basic vlan support in network module.

The cmdline syntax for vlan is:

	vlan=<vlanname>:<phydevice>

for an example:

	vlan=eth0.2:eth0

or
	vlan=vlan2:eth0

See also patch 2/8.

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-05-29 11:18:51 +02:00
Harald Hoyer eef7649e71 merge "cleanup" and "pre-pivot-cleanup" hooks 2012-04-23 11:32:45 +02:00
Dave Young 1bd76bf981 move cleanup scripts to pre-pivot-cleanup hook
below cleanup scripts is moved:
40network: kill-dhclient.sh
90crypt: crypt-cleanup.sh
90multipath: multipathd-stop.sh
95iscsi: cleanup-iscsi.sh
95nfs: nfsroot-cleanup.sh

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-04-19 11:59:45 +02:00
Harald Hoyer 76b83902dc network/module-setup.sh: include all kernel/drivers/net/phy drivers 2012-04-19 11:59:39 +02:00
Jon Ander Hernandez c9143a63fe Debian multiarch support
Another solution could be searching in directories found at
/etc/ld.so.conf.d/*.conf or adding a new parameter. Here is a patch
which adds a new --libdirs parameter, and also a new inst_libdir_file
function which will try to expand metacharacters on each lib
directory:

    inst_libdir_file "libdevmapper-event-lvm*.so"
2012-04-16 14:46:53 +02:00
Harald Hoyer 552ecca6db Renamed all shell scripts to *.sh 2012-02-22 15:15:21 +01:00