From f3c7308f6f3f2f4e401440ea2f01bda8dae4a4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= Date: Tue, 27 Jun 2023 18:55:53 +0200 Subject: [PATCH] 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 --- main/devicepkg-dev/APKBUILD | 6 +++--- main/devicepkg-dev/devicepkg_package.sh | 5 +++++ main/devicepkg-dev/devicepkg_subpackage_kernel.sh | 8 ++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/main/devicepkg-dev/APKBUILD b/main/devicepkg-dev/APKBUILD index bd892e7fd..b98066ab3 100644 --- a/main/devicepkg-dev/APKBUILD +++ b/main/devicepkg-dev/APKBUILD @@ -1,5 +1,5 @@ pkgname=devicepkg-dev -pkgver=0.15.0 +pkgver=0.15.1 pkgrel=0 pkgdesc="Provides default device package functions" url="https://postmarketos.org" @@ -62,10 +62,10 @@ package() { sha512sums=" d69930dd790b00fb39760a37d95a10899f0d167e10e2804feb05d9ce04f94185dc32d36edc90214aba2ea2aa09bf18f7dab93f1d2eff23f67beb2cc83be30e7c compiler-gcc.h 54b369ff87e017114edae03986dec79742280c55a156a98ea8c6a1c740632e904e51c01810e7dac99add0d9d06c0fcebb040fed595348f180233b3ec810443ba devicepkg_build.sh -4941330d9b7f494c37d89f4733622085dfec15c538d4b6d2dfd57466c74f05a639157560ccb7686781e4f9f64e86e60b19481389764e5ba66a33a754eafb459a devicepkg_package.sh +f7703397c5076e632d2f88467be2e7a242f8fa481d6b7dfc1d44dd61a2f30377514138769f6eb014507276cd8d14542073060d89ae65195f47ee3c0925e95d3d devicepkg_package.sh f81e74e45ae8e55686ae459f550e229e7398daeafa72bd023c2d8c3a0d50e60bf53d5bbdfec931e9fbabe1cd71de57b2192805aaef091ab90bc7203cbaf66ba6 downstreamkernel_prepare.sh 107242a3da38a574c46cb779e0c75afbeef4cfe659e1b85971973ac55843df06f70f53a5985ca623d4123f05f2984f5dace4a53a3509ecefd7dfdc3c8b705cfe downstreamkernel_package.sh -c79f1099d0b10c4b4c2bf00a65ffde8233fbaf1cd57b13dd920707df6b1aa1c2170508739451fbeb6b1b739004c52f6d9986b00caea7fb4ac2dcaa7363f24af0 devicepkg_subpackage_kernel.sh +30382c01e7f75165e98f1693143bdda08aacd733658a06640ad7c7ad0a8c2aff1b3aaa82d2b6a45749feaf131ff58c74b3c1f57755f72be5b2b26a55da2ad313 devicepkg_subpackage_kernel.sh 9bb7f2a0930f397a713e9f4b6d5b83a426d9a2a3f692dcc42ac30717bf26ead869d8823a38f3ad388af12b2b9a02e8ec4d4418e9c2062389ed06d2b891a49ff3 deviceinfo 136247a16ec91dc0c7241eeddb28c2196ae3b29946a9bc7e9566f848491ef1c53b12d05bf2dbc1cc352986712fd76f25c1510bcc8f301af540a2f01c33b299e1 expected-deviceinfo-downstream 8cdbf149e1bdfaf4d4a246a208732836956fd81a3aa01ef968e4c2e2cca4027f71cfc38e22debade83ddfca4e05267983c1c8a9c1aa9461a8cf493ef7e893097 expected-deviceinfo-mainline diff --git a/main/devicepkg-dev/devicepkg_package.sh b/main/devicepkg-dev/devicepkg_package.sh index 8f3db758d..235ebe969 100644 --- a/main/devicepkg-dev/devicepkg_package.sh +++ b/main/devicepkg-dev/devicepkg_package.sh @@ -33,9 +33,14 @@ if [ -f "$srcdir/initfs-hook.sh" ]; then "$pkgdir/usr/share/mkinitfs/hooks/00-$pkgname.sh" fi +# All the installation paths for the modules conflict with those from +# devicepkg_subpackage_kernel. See comment there for details if [ -f "$srcdir/modules" ]; then install -Dm644 "$srcdir/modules" \ "$pkgdir/usr/share/mkinitfs/modules/00-$pkgname.modules" + mkdir -p "$pkgdir/usr/share/mkinitfs/files" + echo "/usr/share/mkinitfs/modules/00-$pkgname.modules:/lib/modules/initramfs.load" \ + > "$pkgdir/usr/share/mkinitfs/files/00-$pkgname-modules.files" fi if [ -f "$srcdir/modules-load.conf" ]; then diff --git a/main/devicepkg-dev/devicepkg_subpackage_kernel.sh b/main/devicepkg-dev/devicepkg_subpackage_kernel.sh index cbfa1b5e2..c9bd3d9aa 100644 --- a/main/devicepkg-dev/devicepkg_subpackage_kernel.sh +++ b/main/devicepkg-dev/devicepkg_subpackage_kernel.sh @@ -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