From 65ee265e842a85a5ceda02705538b70555660b5b Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 12 Mar 2023 16:13:22 +0100 Subject: [PATCH] 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 Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230312151325.1968-16-ollieparanoid@postmarketos.org%3E --- pmb/build/kconfig.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pmb/build/kconfig.py b/pmb/build/kconfig.py index ba7e0392..fa3e3f72 100644 --- a/pmb/build/kconfig.py +++ b/pmb/build/kconfig.py @@ -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)