From cb9a02b348ac9d57ed8c55b38884e6b661302743 Mon Sep 17 00:00:00 2001 From: Dolphin von Chips Date: Sat, 21 Mar 2020 13:36:01 +0500 Subject: [PATCH] build.menuconfig: add support for out-of-tree builds using _outdir (!1893) --- pmb/build/menuconfig.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pmb/build/menuconfig.py b/pmb/build/menuconfig.py index 4c3f2884..620555de 100644 --- a/pmb/build/menuconfig.py +++ b/pmb/build/menuconfig.py @@ -40,7 +40,7 @@ def get_arch(args, apkbuild): apkbuild["arch"][0] + "' architecture.") -def get_outputdir(args, pkgname): +def get_outputdir(args, pkgname, apkbuild): """ Get the folder for the kernel compilation output. For most APKBUILDs, this is $builddir. But some older ones still use @@ -69,6 +69,10 @@ def get_outputdir(args, pkgname): if os.path.exists(chroot + ret + "/kernel/.config"): return os.path.join(ret, "kernel") + # Out-of-tree builds ($_outdir) + if os.path.exists(chroot + ret + "/" + apkbuild["_outdir"] + "/.config"): + return os.path.join(ret, apkbuild["_outdir"]) + # Not found raise RuntimeError("Could not find the kernel config. Consider making a" " backup of your APKBUILD and recreating it from the" @@ -121,7 +125,7 @@ def menuconfig(args, pkgname): env={"CARCH": arch}) # Run make menuconfig - outputdir = get_outputdir(args, pkgname) + outputdir = get_outputdir(args, pkgname, apkbuild) logging.info("(native) make " + kopt) pmb.chroot.user(args, ["make", kopt], "native", outputdir, output="tui",