main/devicepkg-dev: install modules file into initramfs (MR 4193)

So that the initramfs can get the list of modules that need to be loaded
once the deviceinfo_modules_initfs variable is gone
This commit is contained in:
Pablo Correa Gómez 2023-06-27 18:55:53 +02:00 committed by Clayton Craft
parent 65be0d7e81
commit f3c7308f6f
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
3 changed files with 16 additions and 3 deletions

View file

@ -23,9 +23,17 @@ install -Dm644 "$srcdir/deviceinfo" \
# Get the kernel type ("downstream", "mainline")
kernel=$(echo "$subpkgname" | sed -n "s/.*-kernel-\(.*\)/\1/p" | tr - _)
# All the installation paths for the modules conflict with those from
# devicepkg_package. It is not supported to have both a modules and
# a modules.$kernel file, it should instead be more than one modules.$kernel
# files, with different $kernel values. The conflict between the package and
# the subpackage aims to prevent the unsupported situation to slip through.
if [ -f "$srcdir/modules.$kernel" ]; then
install -Dm644 "$srcdir/modules.$kernel" \
"$subpkgdir/usr/share/mkinitfs/modules/00-$pkgname.modules"
mkdir -p "$subpkgdir/usr/share/mkinitfs/files"
echo "/usr/share/mkinitfs/modules/00-$pkgname.modules:/lib/modules/initramfs.load" \
> "$subpkgdir/usr/share/mkinitfs/files/00-$pkgname-modules.files"
fi
# Iterate over deviceinfo variables that have the kernel type as suffix