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:
parent
13c4ac425b
commit
ad85c7bc17
|
@ -179,7 +179,6 @@ def generate_deviceinfo(args, pkgname, name, manufacturer, year, arch,
|
||||||
deviceinfo_codename="{codename}"
|
deviceinfo_codename="{codename}"
|
||||||
deviceinfo_year="{year}"
|
deviceinfo_year="{year}"
|
||||||
deviceinfo_dtb=""
|
deviceinfo_dtb=""
|
||||||
deviceinfo_modules_initfs=""
|
|
||||||
deviceinfo_arch="{arch}"
|
deviceinfo_arch="{arch}"
|
||||||
|
|
||||||
# Device related
|
# Device related
|
||||||
|
@ -232,6 +231,24 @@ def generate_deviceinfo(args, pkgname, name, manufacturer, year, arch,
|
||||||
handle.write(line.lstrip() + "\n")
|
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):
|
def generate_apkbuild(args, pkgname, name, arch, flash_method):
|
||||||
# Dependencies
|
# Dependencies
|
||||||
depends = ["postmarketos-base",
|
depends = ["postmarketos-base",
|
||||||
|
@ -258,7 +275,10 @@ def generate_apkbuild(args, pkgname, name, arch, flash_method):
|
||||||
{depends}
|
{depends}
|
||||||
"
|
"
|
||||||
makedepends="devicepkg-dev"
|
makedepends="devicepkg-dev"
|
||||||
source="deviceinfo"
|
source="
|
||||||
|
deviceinfo
|
||||||
|
modules
|
||||||
|
"
|
||||||
|
|
||||||
build() {{
|
build() {{
|
||||||
devicepkg_build $startdir $pkgname
|
devicepkg_build $startdir $pkgname
|
||||||
|
@ -295,4 +315,5 @@ def generate(args, pkgname):
|
||||||
generate_deviceinfo(args, pkgname, name, manufacturer, year, arch,
|
generate_deviceinfo(args, pkgname, name, manufacturer, year, arch,
|
||||||
chassis, has_keyboard, has_external_storage,
|
chassis, has_keyboard, has_external_storage,
|
||||||
flash_method, bootimg)
|
flash_method, bootimg)
|
||||||
|
generate_modules(args)
|
||||||
generate_apkbuild(args, pkgname, name, arch, flash_method)
|
generate_apkbuild(args, pkgname, name, arch, flash_method)
|
||||||
|
|
|
@ -770,7 +770,6 @@ deviceinfo_attributes = [
|
||||||
"codename",
|
"codename",
|
||||||
"year",
|
"year",
|
||||||
"dtb",
|
"dtb",
|
||||||
"modules_initfs",
|
|
||||||
"arch",
|
"arch",
|
||||||
|
|
||||||
# device
|
# device
|
||||||
|
|
|
@ -7,7 +7,6 @@ deviceinfo_manufacturer="LG"
|
||||||
deviceinfo_codename="lg-mako"
|
deviceinfo_codename="lg-mako"
|
||||||
deviceinfo_year="2012"
|
deviceinfo_year="2012"
|
||||||
deviceinfo_dtb=""
|
deviceinfo_dtb=""
|
||||||
deviceinfo_modules_initfs=""
|
|
||||||
deviceinfo_external_storage="false"
|
deviceinfo_external_storage="false"
|
||||||
deviceinfo_flash_method="fastboot"
|
deviceinfo_flash_method="fastboot"
|
||||||
deviceinfo_arch="armhf"
|
deviceinfo_arch="armhf"
|
||||||
|
|
Loading…
Reference in New Issue