aportgen: replace deviceinfo_modules_initfs for modules file

So deviceinfo_modules_initfs is going to be phased out in pmaports!4169 as
a preparation for pmaports#1836. The implementation for the alternative of
using a modules file has already been merged in pmaports!4193, so stop
promoting the soon-to-be-phased-out deviceinfo variable, and instead use
the new and already-supported alternative.

Related: https://gitlab.com/postmarketOS/pmaports/-/issues/1836
Related: https://gitlab.com/postmarketOS/pmaports/-/merge_requests/4169
Related: https://gitlab.com/postmarketOS/pmaports/-/merge_requests/4193
Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230720164706.18936-1-pabloyoyoista@postmarketos.org%3E
This commit is contained in:
Pablo Correa Gómez 2023-07-20 18:47:03 +02:00 committed by Oliver Smith
parent 13c4ac425b
commit ad85c7bc17
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
3 changed files with 23 additions and 4 deletions

View File

@ -179,7 +179,6 @@ def generate_deviceinfo(args, pkgname, name, manufacturer, year, arch,
deviceinfo_codename="{codename}"
deviceinfo_year="{year}"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="{arch}"
# Device related
@ -232,6 +231,24 @@ def generate_deviceinfo(args, pkgname, name, manufacturer, year, arch,
handle.write(line.lstrip() + "\n")
def generate_modules(args):
content = """\
# Remove this comment after reading, or the file if unnecessary (CHANGEME!)
# This file can contain a list of modules to be included in the initramfs,
# so that they are available in early boot stages. It should have one
# module name per line. If there are multiple kernel variants with different
# requirements for modules into the initramfs, one modules.$variant file
# should be created for each of them.
"""
# Write to file
pmb.helpers.run.user(args, ["mkdir", "-p", args.work + "/aportgen"])
path = args.work + "/aportgen/modules"
with open(path, "w", encoding="utf-8") as handle:
for line in content.rstrip().split("\n"):
handle.write(line.lstrip() + "\n")
def generate_apkbuild(args, pkgname, name, arch, flash_method):
# Dependencies
depends = ["postmarketos-base",
@ -258,7 +275,10 @@ def generate_apkbuild(args, pkgname, name, arch, flash_method):
{depends}
"
makedepends="devicepkg-dev"
source="deviceinfo"
source="
deviceinfo
modules
"
build() {{
devicepkg_build $startdir $pkgname
@ -295,4 +315,5 @@ def generate(args, pkgname):
generate_deviceinfo(args, pkgname, name, manufacturer, year, arch,
chassis, has_keyboard, has_external_storage,
flash_method, bootimg)
generate_modules(args)
generate_apkbuild(args, pkgname, name, arch, flash_method)

View File

@ -770,7 +770,6 @@ deviceinfo_attributes = [
"codename",
"year",
"dtb",
"modules_initfs",
"arch",
# device

View File

@ -7,7 +7,6 @@ deviceinfo_manufacturer="LG"
deviceinfo_codename="lg-mako"
deviceinfo_year="2012"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_external_storage="false"
deviceinfo_flash_method="fastboot"
deviceinfo_arch="armhf"