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",