Adjust pmbootstrap to have minimal kernel configs in pmaports.git
@bshah wrote:
Btw
Our defconfigs in all of repos are saved wrong way
They're mostly copy of .config copied to the aports
But this is wrong way to save defconfigs
And you should instead use make savedefconfig
So that it saves just delta to default defconfig
And not all of defconfig as is.
I went ahead and created a patch for it (see below). However, as I've tested it, our "kconfig check" code complained right away after using it for the first time, that some kernel configs were not set. So... nice idea, but doesn't work for us
I've created this issue for future reference, in case the question comes up again.
If I'm overlooking something and there is a way to use this, without breaking "kconfig check" or requiring to download all the kernel tarballs (which is not feasible, "kconfig check" should not take forever...), please let me know.
FWIW, the feature was introduced to linux in 2010: https://lwn.net/Articles/397363/
---
pmb/build/menuconfig.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/pmb/build/menuconfig.py b/pmb/build/menuconfig.py
index 5c632419..a5fdbc82 100644
--- a/pmb/build/menuconfig.py
+++ b/pmb/build/menuconfig.py
@@ -138,13 +138,25 @@ def menuconfig(args, pkgname):
# Run make menuconfig
outputdir = get_outputdir(args, pkgname)
+ arch_kernel = pmb.parse.arch.alpine_to_kernel(arch)
logging.info("(native) make " + kopt)
pmb.chroot.user(args, ["make", kopt], "native",
outputdir, output="tui",
- env={"ARCH": pmb.parse.arch.alpine_to_kernel(arch),
+ env={"ARCH": arch_kernel,
"DISPLAY": os.environ.get("DISPLAY"),
"XAUTHORITY": "/home/pmos/.Xauthority"})
+ # Get a delta to the default config
+ try:
+ pmb.chroot.user(args, ["make", "savedefconfig"], "native", outputdir,
+ env={"ARCH": arch_kernel})
+ pmb.chroot.user(args, ["mv", "defconfig", ".config"], "native",
+ outputdir)
+ except:
+ logging.warning("WARNING: failed to run 'make savedefconfig' to"
+ " minimize your kernel config. Maybe your kernel is so"
+ " old, that it does not have this feature?")
+
# Find the updated config
source = args.work + "/chroot_native" + outputdir + "/.config"
if not os.path.exists(source):
--
2.17.2