pmb.build.kconfig: split extract_and_patch_sources

Move it into an extra function, so it can be used by
"pmbootstrap kconfig merge" code too in a future patch.

Reviewed-by: Clayton Craft <clayton@craftyguy.net>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230312151325.1968-16-ollieparanoid@postmarketos.org%3E
This commit is contained in:
Oliver Smith 2023-03-12 16:13:22 +01:00
parent 97e21fa876
commit 65ee265e84
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 11 additions and 8 deletions

View File

@ -78,6 +78,16 @@ def get_outputdir(args, pkgname, apkbuild):
" template with: pmbootstrap aportgen " + pkgname)
def extract_and_patch_sources(args, pkgname, arch):
pmb.build.copy_to_buildpath(args, pkgname)
logging.info("(native) extract kernel source")
pmb.chroot.user(args, ["abuild", "unpack"], "native", "/home/pmos/build")
logging.info("(native) apply patches")
pmb.chroot.user(args, ["abuild", "prepare"], "native",
"/home/pmos/build", output="interactive",
env={"CARCH": arch})
def menuconfig(args, pkgname, use_oldconfig):
# Pkgname: allow omitting "linux-" prefix
if not pkgname.startswith("linux-"):
@ -119,14 +129,7 @@ def menuconfig(args, pkgname, use_oldconfig):
if copy_xauth:
pmb.chroot.other.copy_xauthority(args)
# Patch and extract sources
pmb.build.copy_to_buildpath(args, pkgname)
logging.info("(native) extract kernel source")
pmb.chroot.user(args, ["abuild", "unpack"], "native", "/home/pmos/build")
logging.info("(native) apply patches")
pmb.chroot.user(args, ["abuild", "prepare"], "native",
"/home/pmos/build", output="interactive",
env={"CARCH": arch})
extract_and_patch_sources(args, pkgname, arch)
# Run make menuconfig
outputdir = get_outputdir(args, pkgname, apkbuild)