Commit Graph

126 Commits (d1a36d3d80b0ed71ee814659e18a020c53cee05e)

Author SHA1 Message Date
Harald Hoyer 50a01dd4b2 fix: install all depmod relevant configuration files
This is important for running `depmod` in the initrd.
2021-05-04 13:15:49 +02:00
Peter Robinson 3a60c036db fix(90kernel-modules): add watchdog drivers for generic initrd
The watchdog module pulls in the device specific watchdog if that
module is enabled, but in the case where we need a generic initrd
we don't get all watchdog drivers which means if we have a watchdog
enabled for that usecase it may get kicked too late in the boot
process so we need the drivers in the initrd for the generic case too.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2021-04-21 14:31:30 +02:00
Harald Hoyer 1dc61299f7 fix(kernel-modules): shellcheck regression
`$_hostonly_drvs` contained multiple arguments and was quoted.

This patch converts `_hostonly_drvs` into an associative array, which
enables easy deduplication and proper quoting in bash.

Fixes: https://github.com/dracutdevs/dracut/issues/1276
2021-03-31 11:30:49 +02:00
Harald Hoyer a26e12cefc fix(kernel-modules): shellcheck for modules.d/90kernel-modules 2021-03-29 10:46:46 +02:00
Harald Hoyer 75d758e8f1 style: shfmt -s 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 -s .
```
2021-03-13 20:10:43 +01: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
Daniel Molkentin 92e6a8f879 fix(kernel-modules): optionally add /usr/lib/modules.d to initramfs
On SUSE, there is no /lib/modules.d, only /usr/lib/modules.d.

Upstream-Bug: http://bugzilla.opensuse.org/show_bug.cgi?id=1180822

Reference: bsc#1180822
2021-03-03 11:42:09 +01:00
Nicolas Saenz Julienne b28e4b20f0 fix(kernel-modules): add reset controllers for arm
Reset controllers might be needed by some of the devices used in the
initrd. Particularly on the Raspberry Pi 4, 'xhci-pci' depends on a
platform specific reset controller.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
2021-02-09 20:35:11 +00: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
Nicolas Chauvet 07c671cc51 feat(kernel-modules): add driver memory
External Memory Controller (EMC) drivers can be built as a module.

On Tegra, this allows tegra_drm to load faster and without deferred
probes, instead of waiting for the rootfs for the tegra*_emc dependencies.

Tested on jetson-tk1 and ac100.

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2021-02-08 21:15:48 +00:00
Ondrej Mosnacek 951c6655f1 fix(90kernel-modules): install generic crypto modules with hostonly unset
Otherwise e.g. the xts(aes) implementation provided by the vmx_crypto
module (which does usually get included on ppc64le) fails to initialize
when xts is built as a module (CONFIG_CRYPTO_XTS=m), because it can't
instantiate the fallback generic xts(aes) implementation (needs the
generic xts module).

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2021-01-21 12:20:22 +01:00
Kairui Song 5817934936 90kernel-modules: Install less modules for hostonly mode
Rearrange some module installation mode, install less modules for
hostonly mode.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song 6375d5d504 90kernel-modules: install block drivers more strictly
For strict hostonly mode, only install block drivers needed for hostonly
devices.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Nicolas Chauvet a298f5f285 90kernel-modules: arm: add drivers/hwmon for arm/arm64
In the case of the s805x the drivers/hwmon directory contains the
scpi_hwmon kernel module.
On a running system, lsmod would output the following dependencies:
 arm_scpi               24576  2 clk_scpi,scpi_hwmon

It means that if the clock driver is bundled in the initramfs it will
bring arm_scpi. But if scpi_hwmon is missing the scpi will be incomplete
and it can lead to crashes.

When the hwmon is bundled, no crash occurs

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2020-10-07 16:04:08 +02:00
Peter Robinson 38ea7e821b Include devfreq drivers in initrd
Some SoCs now have drivers that user devfreq in early init and fail
if the drivers are missing so make sure we have them in the initrd.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2020-09-23 13:44:21 +02:00
Kairui Song f7ad1479f2 90kernel-modules: add pci_hyperv
Install pci_hyperv for SR-IOV devices on hyperv machines.
2020-08-03 15:57:04 +02:00
Harald Hoyer c6a2ebffe5 90kernel-modules/module-setup.sh: add sg kernel module
Fixes udevd messages about failure of `modprobe -bv sg`.
2020-04-30 21:51:58 +02:00
Harald Hoyer 586a56c287 Install crypto modules in 90kernel-modules
We don't want to play catch up with hash and encryption algorithms.
To be safe, just use the hammer and include all crypto.

Fixes https://github.com/dracutdevs/dracut/issues/802
2020-04-24 11:40:15 +02:00
Martin Wilck 18420d9ce5 90kernel-modules: remove nfit from static module list
The 90nvdimm module now resolves the nfit dependency when it's
necessary, so it's not necessary any more to pack it always.
2020-03-06 10:52:06 +01:00
Daniel Molkentin f2d33a7f61 90kernel-modules: Add PCI host controller modules
Currently there is no usb support on RPi4 in the
initrd phase as the pcie-brcmstb module is missing.
If part of the boot is handled from a USB stick
(e.g. with Ignition), the stick cannot be accessed.

Reference: boo#1162669
2020-03-04 09:23:09 +01:00
Kairui Song f4ad2e5c89 90kernel-modules: don't install any block driver if not needed
If hostonly mode is in use, and there isn't any block device included
as hostonly device, then the initramfs won't need any block driver.

Eg. for kdump built image, there could be only one nfs mount point,
or the initramfs may only execute some network operation then reboot.

In such case, skip block driver installation to save space and time.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-01-17 07:26:24 +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 09ba1b289f kernel-modules: add nfit
To support pmem devices, nfit module is required
2018-08-21 13:03:36 +02:00
Nicolas Chauvet a0c915b1e4 Add gpio and pinctrl drivers for arm*/aarch64
This is needed since few gpio/pinctrl can be built as modules and are
useful on early boot.

One example is jetson-tx1 where sata and external mmc can work only
after loading pinctrl-max77620 and gpio-max77620 modules.

Having theses kind of drivers bundled into the initramfs will also
avoid some deferred probes.

V2: add pinctrl for all arches

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2018-08-06 09:46:08 +02:00
Kairui Song 432647c278 90kernel-modules: Don't install extra modules when hostonly mode is set to strict 2018-07-05 09:14:02 +02:00
Hui Wang a73ba9a8ef dracut: scan and install external kernel modules
since kmod-25 keyword "external" was implemented in order to avoid
additional actions(like weak-modules) when kernel was updated, which
makes it more simple while kernels' kabi were compatible.

but if move some special modules such as megaraid_sas, mpt3sas and
so on, to a external path like /opt/modules, these modules will not
be install to initramfs by default, which make the initramfs can't
be used to boot for disk detection failure.

according to kmod's document, you must specify a absolute path with
"external" keyword, so scan the lines in modules.dep that begin with
"/" and install them, to make sure necessary modules in external path
can be installed to initramfs too.

Signed-off-by: Hui Wang <john.wanghui@huawei.com>
2018-07-02 11:40:42 +02:00
Daniel Molkentin d23f32dd4b 90kernel-modules: Include Intel Volume Management Device support
Reference: bsc#1079924
2018-03-16 15:37:25 +01:00
Harald Hoyer f8e0c7cc62 kernel-modules: add mmc/core for arm 2018-03-05 09:56:25 +01:00
Daniel Molkentin 48723f28aa 90kernel-modules: Ensure PCI host modules are included
The includes modules like the Intel Volume Management Device driver,
which is required to boot from disk on some systems.

Reference: boo#1079924
2018-03-01 12:51:49 +01:00
Peter Robinson 82651e9ef3 Add rpmsg, hwspinlock and usb/misc for ARM
Some of the more complex devices now need rpmsg and hwspinlock in the early boot
process to start, and these to the initrd, and pull in usb/misc because
apparently non standard usb hubs are a thing.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-10-12 12:17:41 +01:00
Harald Hoyer 3bd3ef5819 kernel-modules: don't call instmods with empty arguments
otherwise it will try to read from stdin and stall
2017-08-14 14:58:47 +02:00
Peter Robinson 39018c93c2 arm: add soc/extcon/mfd as they're often needed for USB and core memory/soc drivers
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-08-04 19:51:25 +01:00
Peter Robinson f496af50b7 add options to pickup dw_mmc submodules to blockfuncs
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-08-04 18:43:26 +01:00
Harald Hoyer c1699b59c6 kernel-modules: add serial line drivers 2017-06-29 12:18:26 +02:00
Prarit Bhargava fd24c90c36 module-setup.sh: Add ARM specific driver to initramfs image
If a hisi_sas storage device is used as / during system install, the
resulting installation will not boot because the hisi_sas driver is not
included in the initramfs.

The Hisilicon storage driver needs to be added to the initramfs image for
aarch64 kernels.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: dzickus@redhat.com
Cc: dmarlin@redhat.com
Cc: wefu@redhat.com
Cc: harald@redhat.com
2017-06-06 13:39:43 +02:00
Harald Hoyer 2931eaa800 Merge pull request #176 from danimo/pinctrl-cherryview
Always try to add pinctrl-cherryview
2017-03-30 10:59:18 +02:00
Peter Robinson 917e1b6b5b Add check for aarch64 to the arm kernel module list
This adds the same list of drivers we use for arm platforms for
aarch64 too, also add the DMA drivers there too as they can add
sigficant performance for some storage/usb and often need to be
present when the storage drivers load.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-03-23 14:59:15 +00:00
Peter Robinson 0c5e5f271b modules: kernel: add more usb controller modules
There's a number of usb controllers that are common yet aren't
contained in the host directory. Include these for generic host.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-02-07 10:06:53 +00:00
Peter Robinson e752d42de9 modules: kernel: add phy and power modules to generic initrd
The phy and power modules are needed by some of the recent ARM
devices that have appeared like CHIP and some exynos devices.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-02-03 10:24:30 +00:00
Daniel Molkentin 9ffab3f3a5 Always try to add pinctrl-cherryview
Contrary to previous intel pinctrl drivers, the cherryview driver can be
and usually is built as a module. However, it sets up the SDIO pinout
so sdhci can make use of the SD card reader, which may subsequently
hold a root file system on a card  (bsc#998440).
2016-11-15 11:59:05 +01:00
Harald Hoyer a84c391b87 kernel-modules: add nvme kernel module 2016-09-02 07:51:55 +02:00
Nicolas Chauvet 2602a74edf dracut: Add drivers/clk by default on arm
This will bundle clock drivers into the initramfs on arm

Tested on ti dm8148-t410 where adpll is needed on 4.6+ kernel
This will avoid to rely on (maybe broken) bootloader clocks.

Theses modules are also usually loaded early. Having them bundled into
the initramfs will avoid lot of deferred probes and others delay.

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2016-06-07 10:48:49 +02:00
Harald Hoyer 8d9ab2755d Fix regressions with dracut-install with kernel modules
Make sure, the same modules are installed as before.
2016-04-13 11:47:20 +02:00
Harald Hoyer 794b2d2c75 Use dracut-install to install kernel modules
dracut-install can now install kernel modules and their corresponding
firmware files.
2016-04-11 16:32:10 +02:00
Harald Hoyer 6bc2096cf5 kernel-modules: join instmods and install all usb/storage 2016-01-26 14:59:28 +01:00
Harald Hoyer b4dd861a0b kernel-modules: add usb-storage
To save the rdsosreport.txt to a USB stick, the usb-storage module is
needed
2016-01-26 14:56:05 +01:00
Harald Hoyer 8d26b5661e kernel-modules: include all HID driver in hostonly mode
If a kernel is updated in the undocked state and later on docked, some
keyboard modules can be missing.

Thus include all HID drivers.
2015-12-09 14:14:46 +01:00
Harald Hoyer 3721635b2c guard ${arrays[@]} with "" 2015-07-09 15:36:25 +02:00
Harald Hoyer 6d58fa27a4 change "while read x" to cope with EOF without newline
while read x || [ -n "$x" ]

should do the trick
2015-04-28 11:39:15 +02:00
Harald Hoyer 180e9d7851 kernel-modules: install all HID drivers
Instead of hardcoding a list of useful drivers, which has to be curated
all the time, just include all HID drivers.
2015-04-23 13:46:52 +02:00