main/postmarketos-mkinitfs: set pmOS-specific firmware path (!515)

Currently we rely on the fact, that the kernel asks user space to load
the firmware for it, so we can use the /lib/firmware/postmarketos
directory for firmware.

As the kernel has support for loading the firmware itself since
v3.7, and the parameter for adding an additional path to the search
paths was added with v3.10, we can use that to not rely on
CONFIG_FW_LOADER_USER_HELPER being set.
This commit is contained in:
Luca Weiss 2019-07-21 12:21:24 +02:00 committed by Oliver Smith
parent cb9313a27c
commit 7699f8d537
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 19 additions and 3 deletions

View file

@ -1,5 +1,5 @@
pkgname=postmarketos-mkinitfs
pkgver=0.7.10
pkgver=0.7.11
pkgrel=0
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org"
@ -24,6 +24,6 @@ package() {
mkdir -p "$pkgdir/etc/postmarketos-mkinitfs/hooks/"
}
sha512sums="2479b08e48450f7d46c83b1117d0d81edf26dad8f2107e2ae1b10689f1b063c38181be735957ec1a16392302815355ca879ab71fc28d084e075f490cb2ac42b5 init.sh.in
8fc3241420de637aec1715073fe6419c87a9b83587eb88fd6325dfbfdfd38bcd1809df0928ac15b67bac5343926937778a0341c3c25478a0b09f7bd5f032203c init_functions.sh
sha512sums="3b7d697381a45a6a165d195d25a26e71773794ebc4a0d8b425321e5bb68a02405028d9712848982b2573474b7b1ee2560091c41f7f51b9e2e962eeb5204a72aa init.sh.in
9632fe7960d72da7efe9b765de72600ed8c5e38441652d7687c03138b53347f09d9f9dd66b16405b8c46969d5ea672f30c00a861841e5cdc7249182e2fdf9b27 init_functions.sh
6e0e6a08d17c5b6f22d049d51692819ebb9a86d4ef7307e384077a868ace61aaa0a59b9166cb8494142ddf150cd1d204f13889b3afd5108b2a4a95a8ecda9444 mkinitfs.sh"

View file

@ -13,6 +13,7 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Mount everything, set up logging, modules, mdev
mount_proc_sys_dev
setup_log
setup_firmware_path
# shellcheck disable=SC2154,SC2086
[ -d /lib/modules ] && modprobe -a ${deviceinfo_modules_initfs} ext4

View file

@ -36,6 +36,21 @@ mount_proc_sys_dev() {
mkdir /run
}
setup_firmware_path() {
# Add the postmarketOS-specific path to the firmware search paths.
# This should be sufficient on kernel 3.10+, before that we need
# the kernel calling udev (and in our case /usr/lib/firmwareload.sh)
# to load the firmware for the kernel.
echo "Configuring kernel firmware image search path"
SYS=/sys/module/firmware_class/parameters/path
if ! [ -e "$SYS" ]; then
echo "Kernel does not support setting the firmware image search path. Skipping."
return
fi
# shellcheck disable=SC2039
echo -n /lib/firmware/postmarketos >$SYS
}
setup_mdev() {
echo /sbin/mdev >/proc/sys/kernel/hotplug
mdev -s