summaryrefslogtreecommitdiff
path: root/hook-functions
AgeCommit message (Collapse)Author
2020-05-23hook-functions: Add modules needed for Pinebook LCD display.Vagrant Cascadian
The Pinebook LCD disply does not show output until after the initramfs is loaded, which is too late to enter an encryption passphrase or debug issues with mounting the rootfs. Fix this by adding modules to "fb": analogix-anx6345, pwm-sun4i, sun4i-drm and sun8i-mixer.
2020-04-28hook-functions: Search for firmware under /lib/firmware/updatesAP
I like to keep up with the official kernel releases. As a result the firmware they wind up requiring is newer than what is available in firmware packages. I placed the firmware from the git repo in /lib/firmware/updates/ which the kernel searches before /lib/firmware. Kernel can find them but update-initramfs cannot. I have attached an initial patch that solves this. I am currently using the resultng code and it is working fine for me. The one thing the patch does not do is allow for a custom location that can be provided to the kernel to search first. This is because that's a little more complicated and requires a decision wrt where to specify this location (ie the config file?). [bwh: Text above is from AP's bug report with minor edits; I added the subject line.] Closes: #956663 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-03-30hook-functions: Don't add backlight modules if we have generic fb deviceBen Hutchings
If we have a generic framebuffer device then there should be no need to set up any backlight in early boot. Also, backlight devices are sometimes handled by large drm drivers like i915 which we don't want to include by default. Fixes: da8519036860 ("hook-functions: Include modules for Chromebook ...") Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-03-30hook-functions: Factor out device class walking into a functionBen Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-30hook-functions: copy_exec: Correct verbose log message for symlinksBen Hutchings
It was logging the link target, not the name of the symlink. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-30hook-functions: copy_exec: Copy libgcc_s.so.0 along with libpthread.soBen Hutchings
pthread_cancel() in libpthread.so.1 depends on functions in libgcc_s.so.0, but uses dlopen() to link to it rather than having a static dependency. Handle this dynamic dependency in copy_exec so that it doesn't have to be handled in every affected hook script. Closes: #950254 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-30Document copy_exec as usable for shared librariesBen Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18hook-functions: Drop ext4dev from filesystem module listBen Hutchings
This is obsolete since Linux 2.6.28. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-11hook-functions: Add f2fs as base in auto_add_modulesRomain Perier
For people wanting to change their filesystem to F2FS or for embedded devices with eMMC or sdcard, add the f2fs module and its dependency as base module. Moreover, this adds "crc32" as hidden dependency module for f2fs.
2019-11-19hook-functions: preloaded libraries should not end up in the initramfsJohannes 'josch' Schauer
Closes: #944929
2019-10-27Merge branch 'rockchip-io-domain-for-dwmmc' into 'master'Ben Hutchings
hook-functions: Handle dw_mmc-rockchip hidden dependency on rockchip-io-domain See merge request kernel-team/initramfs-tools!18
2019-10-08hook-functions: Include modules for Chromebook Plus displayAlper Nebi Yasak
On Samsung Chromebook Plus (v1), messages and prompts printed during an initramfs run aren't visible to the user unless the pwm_bl, rockchipdrm, pwm-cros-ec and panel-simple modules are included. This commit includes these when MODULES=dep and when MODULES=most. For MODULES=dep: adds backlight and pwm to the dep_modules_add sys-walk. Walking backlight includes pwm_bl and pwm includes pwm-cros-ec. Since panel-simple isn't reachable from /sys/class/**, but it can be reached from /sys/devices/platform/edp-panel, that path is sys-walked if it exists. When {efi,platform,simple,vesa}-framebuffer cannot provide a working framebuffer device, graphics is sys-walked as well. Walking drm works for rockchipdrm too, but also includes panfrost, so graphics was chosen instead. For MODULES=most: the modules are included in a new case 'fb' in the auto_add_modules intended for modules providing framebuffer support for machines where generic drivers don't provide one. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2019-10-08hook-functions: Handle dw_mmc-rockchip hidden dependency on rockchip-io-domainAlper Nebi Yasak
Without rockchip-io-domain, I'm getting the following errors when plugging micro SD cards to a rk3399-gru-kevin: dwmmc_rockchip fe320000.dwmmc: All phases bad! mmc1: tuning execution failed: -5 mmc1: error -5 whilst initialising SD card In that case the relevant /dev/mmcblk* device isn't available either, so we can't boot from the external SD card. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2019-08-11hook-functions: Handle spi-rockchip hidden dependency on pl330Alper Nebi Yasak
Recent kernel versions (v5.0) enabled SPI DMA channels in the RK3399 DTS file. Not including pl330 in the initramfs now makes some systems unbootable (at least rk3399-gru-kevin) presumably because of this. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2019-07-28hook-functions: Fix copy_file with target of "/bin"Ben Hutchings
The copy_file function applies two transformations to the target filename: 1. If it matches /bin/*, /lib*, or /sbin/*, add /usr to the beginning since the initramfs is usrmerged. 2. If it refers a directory, add the basename of the source filename. These need to be done in the opposite order, to handle a target filename of "/bin" correctly. Closes: #928689 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-05-04hook-functions: Include cros_ec_spi and SPI drivers when MODULES=mostBen Hutchings
On some ChromeOS devices the keyboard is attached to an EC which the host must communicate with over SPI. Thanks: Alper Nebi Yasak <alpernebiyasak@gmail.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-05-04hook-functions: Include all keyboard driver modules when MODULES=mostBen Hutchings
Until recently most keyboard drivers were either built-in or HID (which we already include). However there are other important modular keyboard drivers such as cros_ec_keyb which were only included when MODULES=dep. Thanks: Alper Nebi Yasak <alpernebiyasak@gmail.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-04-30hook-functions: Include extcon drivers when MODULES=depAlper Nebi Yasak
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2019-04-30hook-functions: Include extcon-usbc-cros-ec when MODULES=mostAlper Nebi Yasak
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2019-02-06Move usage function for mkinitramfs out of hook-functionsBen Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-02-05Print warnings and errors in initramfs generation consistentlyBen Hutchings
All warning (non-fatal condition) and error (fatal condition) messages should be printed to stderr, and should start with a prefix of "W:" or "E:" respectively. Also remove the word "ignoring" from some warning messages. It follows from the fact that they are warnings that the problem is being ignored. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-02-04hook-functions: Avoid symlinks that conflict with usr-merge in copy_fileBen Hutchings
The host filesystem may not be usr-merged and may contain symlinks between corresponding names under e.g. /bin and /usr/bin. However the initramfs is always usr-merged. Before checking whether the target of the copy matches the symlink target, apply the usr-merge transformation to both filenames. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-02-04hook-functions: Remove an obsolete FIXMEBen Hutchings
This was introduced in commit 5de4f2d88e47, for which the commit message says "add FIXME's to point missing /lib64 symlink parts". I think this is obsolete as copy_file does now replicate symlinks where needed. Gbp-Dch: Ignore Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-12-18Disable shellcheck for desired behaviourBenjamin Drung
Sometimes globbing and word splitting is wanted. Therefore explicitly disable the check for these line. Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-18Fix (nearly) all issues found by shellcheckBenjamin Drung
shellcheck found more issues than SC1074. Address most of these issues. You can check the shell code by running: ``` shellcheck -e SC1090,SC1091 -s dash hook-functions $(find * -type f \( -executable ! -name rules -o -regex '.*\.\(post\|pre\).*' -o -regex "^\(docs\|scripts\)/.*" ! -name '*.md' \)) ``` Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-07-26hook-functions: Add support for compressed module filesBen Hutchings
Change filename matching in manual_add_modules, copy_modules_dir, hidden_dep_add_modules to allow a compression suffix after '.ko' in filenames. kmod is responsible for decompressing modules, and Debian's kmod currently only supports xz compression. We allow any compression suffix here, so if kmod is rebuilt with gzip/zlib support enabled then initramfs-tools should automatically support it too. Closes: #891560 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-07-26hook-functions: Quote exclusions in copy_modules_dirBen Hutchings
Exclusions may include wildcards, which should be matched by find and not the shell. Change the argument processing to manipulate the argument array, instead of building a single variable which cannot maintain quoting. (This would be easier in bash - we could use a named array variable.) Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-07-18mkinitramfs(8), hook-functions: Correct references to "ramdisk"Ben Hutchings
An initramfs image is not a ramdisk, even though it is passed to the kernel in the same way as an initrd. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-07-18hook-functions: Handle nvme hidden dependency on vmdBen Hutchings
Include vmd in the block drivers group, and add the dependency to hidden_dep_add_modules. Thanks: Mario Limonciello <Mario.Limonciello@dell.com> Closes: #886349 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-07-18hook-functions: Handle i8042 hidden dependency on psmouseBen Hutchings
On some systems the keyboard controller doesn't behave properly until psmouse has also done its initialisation. We already include psmouse in MODULES=most builds for this reason. Close: #878829 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-07-18hook-functions: Check modules.builtin in hidden_dep_add_modulesBen Hutchings
Built-in "modules" can have weak dependencies on modules, and we will need to handle that here. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-07-18hook-functions: Remove directory information from hidden_dep_add_modulesBen Hutchings
Module installation directories reflect their source directory, and since the kernel source is sometimes reorganised it isn't very future-proof to hard-code directories here. Rewrite the file tests as an iteration over all modules already installed. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-07-18hook-functions: Correct the comment above hidden_dep_add_modulesBen Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-07-18Include the axp20x_usb_power module in the base modules list for MODULES=mostKarsten Merker
With newer kernels (including kernel 4.9 as used in stretch), initializing the USB host controllers on a number of armhf systems is not possible without having the "axp20x_usb_power" power supply driver module available. To be able to have the rootfs on a USB mass storage device on such systems it is therefore necessary to include this module in the initramfs. Closes: #866521 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-05-29Fix config directory in error messageBenjamin Drung
/etc/kernel/postinst.d/kdump-tools calls mkinitramfs with -d /var/lib/kdump/initramfs-tools. This call might fail, but the recommended grep command points to the wrong directory: $ sudo /etc/kernel/postinst.d/kdump-tools $(uname -r) kdump-tools: Generating /var/lib/kdump/initrd.img-4.4.36-2 mkinitramfs: failed to determine device for / mkinitramfs: workaround is MODULES=most, check: grep -r MODULES /etc/initramfs-tools/ Error please report bug on initramfs-tools Include the output of 'mount' and 'cat /proc/mounts' update-initramfs: failed for with 1. Closes: #856589 Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-05-29Add mlx4 and mlx5 InfiniBand modules to hidden_dep_add_modulesBenjamin Drung
Mellanox ConnectX architecture is: mlx4_core is the lower level PCI driver which register on the PCI id, and protocol specific drivers are depended on it: mlx4_en - for Ethernet and mlx4_ib for Infiniband. NIC could have multiple ports which can change their type dynamically. We use the request_module() call to load the relevant protocol driver when needed: on loading time or at port type change event. The mlx4_core and mlx5_core modules are included in the initrd, but not mlx4_ib and mlx5_ib. Thus the request_module() call will not find these modules and fail load them. The mlx*_ib module loading will not be retried. Therefore add the mlx4_ib and mlx5_ib dependency to the hidden_dep_add_modules function. Closes: #871595 Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2017-12-18auto_add_modules: add mfd for MODULES==mostRiku Voipio
Multi Function Devices may carry essential functions on arm/arm64 platforms. For example in 96boards HiKey some regulators. In this case it's picked up with MODULES=dep /sys/class/regulator enumaeration, but not when generating generic initrd on offline with MODULES=most. Since mfd is quite small (284K on arm64), just add it to most. This may also open the road to make some currently built-in CONFIG_MFD drivers modules. Closes: #880584 Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2016-12-15auto_add_modules: Add all I2C bus and mux drivers when MODULES=mostBen Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Closes: #825687
2016-12-08hook-functions: Make copy_file return 0 on creating a link to an existing fileBen Hutchings
If copy_file copies a symlink, it then moves on to copying the link-target. It returns 1 if that already exists in the initramfs. This is not obvious from the documentation and it's causing breakage now. It seems to make more sense to return 0 in this case and reserve 1 for the case that nothing at all was copied. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Closes: #847325
2016-05-29Revert "hook-functions: Add detached module signatures if present"Ben Hutchings
This reverts commit e05fc3e0277561aa57a76d19ce33c73ad8eb0b3e. I'm abandoning my attempt to support detached module signatures. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2016-04-17auto_add_modules: Include all bus driver modulesBen Hutchings
In general, we can expect any bus driver module to be quite important. Specifically, omap-ocp2scp is needed for USB and SATA PHYs to work on some OMAP systems and was recently added to usb-modules.udeb on armhf. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2016-04-17auto_add_modules: Include most USB host driversBen Hutchings
Instead of trying to list all common USB host drivers, include them all by default; exclude the same few that are currently excluded from usb-modules-*.udeb. Also include extcon-usb-gpio which was recently added to usb-modules.udeb on armhf. Closes: #762634 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2016-04-16hook-functions: Create ORDER files even if there are no valid scriptsBen Hutchings
init will panic if a scripts directory exists but has no ORDER file. We could optimise this by removing the unused scripts and directory, but this is a simple back-portable fix. Closes: #814965 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2016-04-05hook-functions: Add detached module signatures if presentBen Hutchings
Closes: #820037 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2016-02-11hook-functions: Dereference links when looking up block device numberBen Hutchings
block_dev_mod_add usually gets a device name that has already been canonicalised using 'readlink -f', but this is not true in the case of the resume device. By default stat(1) uses lstat(2) which will give us a device number of 0:0 for a symlink! Rather than adding another use of 'readlink -f', add the -L option so it dereferences symlinks to block devices. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2016-01-23copy_file: Skip duplicating symlink if it points to the target fileBen Hutchings
When the source and target paths are different, it's possible that the source is a symlink to the target path. In that case we must only copy the file - there is no need for a symlink and currently we create a broken symlink. Closes: #812404 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2016-01-21hook-functions: Stop force-loading drivers found through sysfs when MODULES=depBen Hutchings
Currently we're duplicating the work of udev and generating warnings for drivers that are always built-in. Closes: #792910 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2016-01-21hook-functions: Include modules for resume partition when MODULES=depBen Hutchings
Closes: #588770 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2016-01-21hook-functions: Clean up split between dep_add_modules and dep_add_modules_mountBen Hutchings
Much of the code in dep_add_modules is unrelated to any particular mount point and should only be run once. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2016-01-21Merge branch 'benh/keyboard-fixes'Ben Hutchings