Skip to contentSkip to conversation

Resurrect backports Integration Mode

PATCH Superseded Thomas Pedersen 3 participants 15 messages Nov 24, 2021 – Feb 4, 2022 Library code

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Resurrect backports Integration Mode

The backports integration mode[0] seems to have suffered some bitrot and doesn't currently work. Integration mode can be convenient in certain use cases and build flows though, so this patch set tries to fixup the integration mode.

These changes were developed and tested for backporting a v5.10 backports + linux branch to a v4.19 kernel. v5.15-rc6 backports + linux was successfully built against v4.19.

0: https://backports.wiki.kernel.org/index.php/Documentation/integration

Thomas Pedersen (7):
backport: refresh integration patch
backport: resurrect integrations
gentree: try to make patch operation idempotent in case of --clean
gentree: do not prefix Kernel.local symbols
lib/bpversion: calculate Kconfig.versions for next major version
backport: expose BP_MODULES in package mode only
kconfig: fix select conversion for BPAUTO_ symbols in integration mode

 backport/Kconfig.integrate                    | 11 ++--
 backport/Kconfig.package                      | 10 +--
 backport/Kconfig.package.hacks                |  9 +++
 backport/Kconfig.sources                      | 18 +++---
 backport/compat/Kconfig                       |  9 ---
 gentree.py                                    | 62 +++++++++++++------
 .../0001-enable-backports-built-in.patch      | 34 +++++-----
 lib/bpversion.py                              | 11 +++-
 lib/kconfig.py                                |  5 +-
 9 files changed, 96 insertions(+), 73 deletions(-)
Signature · 4 lines
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#1 lore raw

PATCH 1/7 backport: refresh integration patch

From: Thomas Pedersen <[email protected]>

This was refreshed on Linux v5-10.42.

---
 .../0001-enable-backports-built-in.patch      | 34 ++++++++-----------
 1 file changed, 15 insertions(+), 19 deletions(-)
integration-patches/0001-enable-backports/0001-enable-backports-built-in.patch +15 -19
index d66b203d0d07..35765ed113eb 100644
@@ -1,40 +1,36 @@
-Allow backports to be integrated into vmlinux.
-
 diff --git a/Makefile b/Makefile
-index 6d1e304..de26b18 100644
+index e5d41b6792d7..cdd600bda9d1 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -542,6 +542,7 @@ scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
- 	$(Q)$(MAKE) $(build)=$(@)
+@@ -594,6 +594,7 @@ export KBUILD_MODULES KBUILD_BUILTIN
  
+ ifeq ($(KBUILD_EXTMOD),)
  # Objects we will link into vmlinux / subdirs we need to visit
 +backports-y 	:= backports/
  init-y		:= init/
  drivers-y	:= drivers/ sound/ firmware/
  net-y		:= net/
-@@ -820,13 +821,16 @@ core-y		+= kernel/ mm/ fs/ ipc/ security/ crypto/ block/
+@@ -989,11 +990,13 @@ core-y		+= kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
  
  vmlinux-dirs	:= $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
  		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
 +		     $(backports-y) $(backports-m) \
- 		     $(net-y) $(net-m) $(libs-y) $(libs-m)))
+ 		     $(net-y) $(net-m) $(libs-y) $(libs-m) $(virt-y)))
  
  vmlinux-alldirs	:= $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \
- 		     $(init-n) $(init-) \
- 		     $(core-n) $(core-) $(drivers-n) $(drivers-) \
-+		     $(backports-n) $(backports-) \
- 		     $(net-n)  $(net-)  $(libs-n)    $(libs-))))
+-		     $(init-) $(core-) $(drivers-) $(net-) $(libs-) $(virt-))))
++		     $(init-) $(core-) $(drivers-) $(net-) $(libs-) $(virt-) $(backports))))
  
-+backports-y	:= $(patsubst %/, %/built-in.o, $(backports-y))
- init-y		:= $(patsubst %/, %/built-in.o, $(init-y))
- core-y		:= $(patsubst %/, %/built-in.o, $(core-y))
- drivers-y	:= $(patsubst %/, %/built-in.o, $(drivers-y))
-@@ -837,7 +841,7 @@ libs-y		:= $(libs-y1) $(libs-y2)
++backports-y	:= $(patsubst %/, %/built-in.a, $(backports-y))
+ init-y		:= $(patsubst %/, %/built-in.a, $(init-y))
+ core-y		:= $(patsubst %/, %/built-in.a, $(core-y))
+ drivers-y	:= $(patsubst %/, %/built-in.a, $(drivers-y))
+@@ -1004,7 +1007,7 @@ virt-y		:= $(patsubst %/, %/built-in.a, $(virt-y))
  
  # Externally visible symbols (used by link-vmlinux.sh)
  export KBUILD_VMLINUX_INIT := $(head-y) $(init-y)
--export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y)
-+export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y) $(backports-y)
+-export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y2) $(drivers-y) $(net-y) $(virt-y)
++export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y2) $(drivers-y) $(net-y) $(virt-y) $(backports-y)
+ export KBUILD_VMLINUX_LIBS := $(libs-y1)
  export KBUILD_LDS          := arch/$(SRCARCH)/kernel/vmlinux.lds
  export LDFLAGS_vmlinux
- # used by scripts/pacmage/Makefile
Signature · 4 lines
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#2 lore raw

Re: [PATCH 1/7] backport: refresh integration patch

Quoted 3 lines · Thomas Pedersen

From: Thomas Pedersen <[email protected]>

This was refreshed on Linux v5-10.42.

Does this patch still apply with kernel 5.15?

Quoted 57 lines
---
  .../0001-enable-backports-built-in.patch      | 34 ++++++++-----------
  1 file changed, 15 insertions(+), 19 deletions(-)
integration-patches/0001-enable-backports/0001-enable-backports-built-in.patch +12 -16
index d66b203d0d07..35765ed113eb 100644
@@ -1,40 +1,36 @@
-Allow backports to be integrated into vmlinux.
-
  diff --git a/Makefile b/Makefile
-index 6d1e304..de26b18 100644
+index e5d41b6792d7..cdd600bda9d1 100644
  --- a/Makefile
  +++ b/Makefile
-@@ -542,6 +542,7 @@ scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
- 	$(Q)$(MAKE) $(build)=$(@)
+@@ -594,6 +594,7 @@ export KBUILD_MODULES KBUILD_BUILTIN
 
+ ifeq ($(KBUILD_EXTMOD),)
   # Objects we will link into vmlinux / subdirs we need to visit
  +backports-y 	:= backports/
   init-y		:= init/
   drivers-y	:= drivers/ sound/ firmware/
   net-y		:= net/
-@@ -820,13 +821,16 @@ core-y		+= kernel/ mm/ fs/ ipc/ security/ crypto/ block/
+@@ -989,11 +990,13 @@ core-y		+= kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
 
   vmlinux-dirs	:= $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
   		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
  +		     $(backports-y) $(backports-m) \
- 		     $(net-y) $(net-m) $(libs-y) $(libs-m)))
+ 		     $(net-y) $(net-m) $(libs-y) $(libs-m) $(virt-y)))
 
   vmlinux-alldirs	:= $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \
- 		     $(init-n) $(init-) \
- 		     $(core-n) $(core-) $(drivers-n) $(drivers-) \
-+		     $(backports-n) $(backports-) \
- 		     $(net-n)  $(net-)  $(libs-n)    $(libs-))))
+-		     $(init-) $(core-) $(drivers-) $(net-) $(libs-) $(virt-))))
++		     $(init-) $(core-) $(drivers-) $(net-) $(libs-) $(virt-) $(backports))))
 
-+backports-y	:= $(patsubst %/, %/built-in.o, $(backports-y))
- init-y		:= $(patsubst %/, %/built-in.o, $(init-y))
- core-y		:= $(patsubst %/, %/built-in.o, $(core-y))
- drivers-y	:= $(patsubst %/, %/built-in.o, $(drivers-y))
-@@ -837,7 +841,7 @@ libs-y		:= $(libs-y1) $(libs-y2)
++backports-y	:= $(patsubst %/, %/built-in.a, $(backports-y))
+ init-y		:= $(patsubst %/, %/built-in.a, $(init-y))
+ core-y		:= $(patsubst %/, %/built-in.a, $(core-y))
+ drivers-y	:= $(patsubst %/, %/built-in.a, $(drivers-y))
+@@ -1004,7 +1007,7 @@ virt-y		:= $(patsubst %/, %/built-in.a, $(virt-y))
 

integration-patches/0001-enable-backports/0001-enable-backports-built-in.patch line 40

Quoted 10 lines
integration-patches/0001-enable-backports/0001-enable-backports-built-in.patch +3 -3
   # Externally visible symbols (used by link-vmlinux.sh)
   export KBUILD_VMLINUX_INIT := $(head-y) $(init-y)
--export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y)
-+export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y) $(backports-y)
+-export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y2) $(drivers-y) $(net-y) $(virt-y)
++export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y2) $(drivers-y) $(net-y) $(virt-y) $(backports-y)
+ export KBUILD_VMLINUX_LIBS := $(libs-y1)
   export KBUILD_LDS          := arch/$(SRCARCH)/kernel/vmlinux.lds
   export LDFLAGS_vmlinux
- # used by scripts/pacmage/Makefile

--
To unsubscribe from this list: send the line "unsubscribe backports" in

#3 lore raw

Re: [PATCH 1/7] backport: refresh integration patch

Hi Hauke,

Sorry for the late response.

Quoted 6 lines · Hauke Mehrtens
Quoted 3 lines · Thomas Pedersen

From: Thomas Pedersen <[email protected]>

This was refreshed on Linux v5-10.42.

Does this patch still apply with kernel 5.15?

It does not, and in fact the original commit message was a lie.

This patch is applied to the _target_ kernel Makefile (in this case I used v4.19.x), so it needs to be versioned against the target kernel somehow. Is the target kernel version currently available during the gentree stage?

Signature · 3 lines
thomas
--
To unsubscribe from this list: send the line "unsubscribe backports" in
#4 lore raw

PATCH 2/7 backport: resurrect integrations

In reply to Thomas Pedersen

Couple fixes to fix the kernel build when using a built in backports ("integration mode"):

- newer kernel kconfig doesn't seem to like evaluating variables with just '$'. Use '$()'.
- define BACKPORT_DIR in the integration Kconfig so we don't have to supply it in an environment variable (where it can probably only ever be "backports/" anyway).

---
 backport/Kconfig.integrate | 11 +++++------
 backport/Kconfig.package   | 10 +++++-----
 backport/Kconfig.sources   | 18 +++++++++---------
 gentree.py                 |  4 ++--
 4 files changed, 21 insertions(+), 22 deletions(-)
backport/Kconfig.integrate +5 -6
index 45ab3ecd4d57..10e9f2cb8ac5 100644
@@ -1,3 +1,4 @@
+BACKPORT_DIR:=%%BACKPORT_DIR%%
 config BACKPORT_INTEGRATE
 	bool
 	def_bool y
@@ -29,9 +30,7 @@ menuconfig BACKPORT_LINUX
 	  this should we run into any issues.
 
 if BACKPORT_LINUX
-
-source "$BACKPORT_DIR/Kconfig.versions"
-source "$BACKPORT_DIR/Kconfig.sources"
-source "$BACKPORT_DIR/Kconfig.local"
-
-endif # BACKPORT_LINUX
+source "$(BACKPORT_DIR)/Kconfig.versions"
+source "$(BACKPORT_DIR)/Kconfig.sources"
+source "$(BACKPORT_DIR)/Kconfig.local"
+endif	# BACKPORT_LINUX
backport/Kconfig.package +5 -5
index 250cdf3e4278..ce2f1cdb5893 100644
@@ -14,12 +14,12 @@ config BACKPORTED_KERNEL_NAME
 	option env="BACKPORTED_KERNEL_NAME"
 
 # Packaging hacks
-source "$BACKPORT_DIR/Kconfig.package.hacks"
+source "$(BACKPORT_DIR)/Kconfig.package.hacks"
 
 # Code we backport
-source "$BACKPORT_DIR/Kconfig.sources"
+source "$(BACKPORT_DIR)/Kconfig.sources"
 
 # these will be generated
-source "$BACKPORT_DIR/Kconfig.kernel"
-source "$BACKPORT_DIR/Kconfig.versions"
-source "$BACKPORT_DIR/Kconfig.local"
+source "$(BACKPORT_DIR)/Kconfig.kernel"
+source "$(BACKPORT_DIR)/Kconfig.versions"
+source "$(BACKPORT_DIR)/Kconfig.local"
backport/Kconfig.sources +9 -9
index 5fb44780d842..8344a9aaa378 100644
@@ -1,15 +1,15 @@
 # this has the configuration for the backport code
-source "$BACKPORT_DIR/compat/Kconfig"
+source "$(BACKPORT_DIR)/compat/Kconfig"
 
 # these are copied from the kernel
-source "$BACKPORT_DIR/net/wireless/Kconfig"
-source "$BACKPORT_DIR/net/mac80211/Kconfig"
-source "$BACKPORT_DIR/drivers/net/wireless/Kconfig"
-source "$BACKPORT_DIR/drivers/net/usb/Kconfig"
+source "$(BACKPORT_DIR)/net/wireless/Kconfig"
+source "$(BACKPORT_DIR)/net/mac80211/Kconfig"
+source "$(BACKPORT_DIR)/drivers/net/wireless/Kconfig"
+source "$(BACKPORT_DIR)/drivers/net/usb/Kconfig"
 
-source "$BACKPORT_DIR/drivers/ssb/Kconfig"
-source "$BACKPORT_DIR/drivers/bcma/Kconfig"
+source "$(BACKPORT_DIR)/drivers/ssb/Kconfig"
+source "$(BACKPORT_DIR)/drivers/bcma/Kconfig"
 
-source "$BACKPORT_DIR/drivers/usb/class/Kconfig"
+source "$(BACKPORT_DIR)/drivers/usb/class/Kconfig"
 
-source "$BACKPORT_DIR/drivers/staging/Kconfig"
+source "$(BACKPORT_DIR)/drivers/staging/Kconfig"
gentree.py +2 -2
index 05bb91b39291..4705ffa08fc4 100755
@@ -701,7 +701,7 @@ def _main():
                            project_dir = args.outdir,
                            target_dir = os.path.join(args.outdir, 'backports/'),
                            target_dir_name = 'backports/',
-                           kconfig_source_var = '$BACKPORT_DIR',
+                           kconfig_source_var = '$(BACKPORT_DIR)',
                            )
     else:
         bpid = Bp_Identity(integrate = args.integrate,
@@ -710,7 +710,7 @@ def _main():
                            project_dir = args.outdir,
                            target_dir = args.outdir,
                            target_dir_name = '',
-                           kconfig_source_var = '$BACKPORT_DIR',
+                           kconfig_source_var = '$(BACKPORT_DIR)',
                            )
 
     def logwrite(msg):
Signature · 4 lines
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#5 lore raw

PATCH 3/7 gentree: try to make patch operation idempotent in case of --clean

In reply to Thomas Pedersen

The patch utility will not just skip a patch if it has already been applied. In the case of --integrate --clean we may need to repatch the kernel Makefile, which wasn't removed along with backports/. To support reapplying patches without error, revert a failed patch with -R, then reapply it.

---
 gentree.py | 56 +++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 39 insertions(+), 17 deletions(-)
gentree.py +39 -17
index 4705ffa08fc4..0576e14d6fe5 100755
@@ -484,6 +484,31 @@ def upload_release(args, rel_prep, logwrite=lambda x:None):
         kup_cmd = "kup put /\n\t\t%s /\n\t\t%s /\n\t\t%s" % (gzip_name, tar_name + '.asc', korg_path)
         logwrite("kup-test: skipping cmd: %s" % kup_cmd)
 
+def do_patch(args, logwrite, pfile, target_dir, reverse=False):
+    cmd = 'patch -p1'.split()
+
+    if reverse:
+        cmd.append('-R')
+    process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+                               stderr=subprocess.STDOUT, stdin=subprocess.PIPE,
+                               close_fds=True, universal_newlines=True,
+                               cwd=target_dir)
+    output = process.communicate(input=open(pfile, 'r').read())[0]
+    output = output.split('\n')
+    if output[-1] == '':
+        output = output[:-1]
+    if args.verbose:
+        for line in output:
+            logwrite('> %s' % line)
+    else:
+        logwrite("Failed to apply changes from %s" % print_name)
+        if not args.verbose:
+            for line in output:
+                logwrite('> %s' % line)
+
+    return process.returncode
+
+
 def apply_patches(args, desc, source_dir, patch_src, target_dir, logwrite=lambda x:None):
     """
     Given a path of a directories of patches and SmPL patches apply
@@ -539,23 +564,20 @@ def apply_patches(args, desc, source_dir, patch_src, target_dir, logwrite=lambda
                 fullfn = os.path.join(target_dir, patched_file)
                 shutil.copyfile(fullfn, fullfn + '.orig_file')
 
-        process = subprocess.Popen(['patch', '-p1'], stdout=subprocess.PIPE,
-                                   stderr=subprocess.STDOUT, stdin=subprocess.PIPE,
-                                   close_fds=True, universal_newlines=True,
-                                   cwd=target_dir)
-        output = process.communicate(input=open(pfile, 'r').read())[0]
-        output = output.split('\n')
-        if output[-1] == '':
-            output = output[:-1]
-        if args.verbose:
-            for line in output:
-                logwrite('> %s' % line)
-        if process.returncode != 0:
-            if not args.verbose:
-                logwrite("Failed to apply changes from %s" % print_name)
-                for line in output:
-                    logwrite('> %s' % line)
-            return 2
+        err = do_patch(args, logwrite, pfile, target_dir)
+        if err > 0:
+            if not args.clean or err == 2:
+                return 2
+
+            # in case of clean, try to make patch idempotent
+            # try the reverse
+            err = do_patch(args, logwrite, pfile, target_dir, reverse=True)
+            if err != 0:
+                return 2
+            # that worked, now reapply..
+            err = do_patch(args, logwrite, pfile, target_dir)
+            if err != 0:
+                return 2
 
         if args.refresh:
             pfilef = open(pfile + '.tmp', 'a')
Signature · 4 lines
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#6 lore raw

PATCH 4/7 gentree: do not prefix Kernel.local symbols

In reply to Thomas Pedersen

In package mode the prefix is empty, so the ignore list does not matter. In integration mode there is a nonzero prefix, so add Kconfig.local to the ignore list like elsewhere in gentree.py.

---
 gentree.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
gentree.py +1 -1
index 0576e14d6fe5..9699ce0128d0 100755
@@ -235,7 +235,7 @@ def add_automatic_backports(args):
     export = re.compile(r'^EXPORT_SYMBOL(_GPL)?\((?P<sym>[^\)]*)\)')
     bpi = kconfig.get_backport_info(os.path.join(args.bpid.target_dir, 'compat', 'Kconfig'))
     configtree = kconfig.ConfigTree(os.path.join(args.bpid.target_dir, 'Kconfig'), args.bpid)
-    ignore=['Kconfig.kernel', 'Kconfig.versions']
+    ignore=['Kconfig.kernel', 'Kconfig.versions', 'Kconfig.local']
     configtree.verify_sources(ignore=ignore)
     git_debug_snapshot(args, "verify sources for automatic backports")
     all_selects = configtree.all_selects()
Signature · 4 lines
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#7 lore raw

PATCH 5/7 lib/bpversion: calculate Kconfig.versions for next major version

In reply to Thomas Pedersen
---
 lib/bpversion.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
lib/bpversion.py +8 -3
index aefdcf0ce3c9..1659823baaf4 100644
@@ -42,7 +42,12 @@ def kernelversion(tree):
 
 def genkconfig_versions(rel_specs):
     data = ''
-    for i in range(int(rel_specs['PATCHLEVEL']) + 1, 99):
-        data += "config BACKPORT_KERNEL_%s_%s\n" % (rel_specs['VERSION'], i)
-        data += "    def_bool y\n"
+    print(str(rel_specs))
+    version = int(rel_specs['VERSION'])
+    start_patchlevel = int(rel_specs['PATCHLEVEL']) + 1
+    for i in range(version, version + 2):
+        for j in range(start_patchlevel, 99):
+            data += "config BACKPORT_KERNEL_%s_%s\n" % (i, j)
+            data += "    def_bool y\n"
+        start_patchlevel = 0
     return data
Signature · 4 lines
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#8 lore raw

PATCH 6/7 backport: expose BP_MODULES in package mode only

In reply to Thomas Pedersen

Otherwise 'option modules' conflicts with the kernel namespace.

---
 backport/Kconfig.package.hacks | 9 +++++++++
 backport/compat/Kconfig        | 9 ---------
 2 files changed, 9 insertions(+), 9 deletions(-)
backport/Kconfig.package.hacks +9 -0
index 6a429dd107fd..85c71d43c690 100644
@@ -6,3 +6,12 @@ config NET_CORE
 	def_bool y
 config EXPERT
 	def_bool y
+
+config BP_MODULES
+	option modules
+	bool
+	default MODULES
+
+	help
+	This symbol is necessary for the newer kconf tool, it looks
+	for the "option modules" to control the 'm' state.
backport/compat/Kconfig +0 -9
index 174322d8a340..87df1f731a34 100644
@@ -53,15 +53,6 @@
 # Variations are obviously possible.
 #
 
-config BP_MODULES
-	option modules
-	bool
-	default MODULES
-
-	help
-	This symbol is necessary for the newer kconf tool, it looks
-	for the "option modules" to control the 'm' state.
-
 config BPAUTO_BUILD_NLATTR
 	def_bool y
 	depends on KERNEL_5_2
Signature · 4 lines
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#9 lore raw

PATCH 7/7 kconfig: fix select conversion for BPAUTO_ symbols in integration mode

In reply to Thomas Pedersen

In integration mode, the bpid.project_prefix is nonzero and needs to be prepended to the expected symbol to get a match.

---
 lib/kconfig.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
lib/kconfig.py +3 -2
index a77f8a54eea7..0b5f8ebc1726 100644
@@ -228,9 +228,10 @@ class ConfigTree(object):
             out = ''
             for l in open(os.path.join(self.bpid.target_dir, nf), 'r'):
                 m = sel_line.match(l)
+                bpauto_prefix = self.bpid.project_prefix + 'BPAUTO_'
                 if m and not m.group('sym') in syms:
-                    if 'BPAUTO_' + m.group('sym') in syms:
-                        out += m.group('spc') + "select BPAUTO_" + m.group('sym') + '\n'
+                    if bpauto_prefix + m.group('sym') in syms:
+                        out += m.group('spc') + "select " + bpauto_prefix + m.group('sym') + '\n'
                     else:
                         out += m.group('spc') + "depends on " + m.group('sym') + '\n'
                 else:
Signature · 4 lines
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#10 lore raw
In reply to Thomas Pedersen
Quoted 10 lines · Thomas Pedersen

The backports integration mode[0] seems to have suffered some bitrot and doesn't currently work. Integration mode can be convenient in certain use cases and build flows though, so this patch set tries to fixup the integration mode.

These changes were developed and tested for backporting a v5.10 backports + linux branch to a v4.19 kernel. v5.15-rc6 backports + linux was successfully built against v4.19.

0: https://backports.wiki.kernel.org/index.php/Documentation/integration

Good stuff, looks good, just one thing the $FOO --> $(FOO) thing, does that assume/require a bump in kconfig used in backports, ie, if not using integration does that still work? If so then cool, otherwise an upgrade to kconfig would be needed, and if that is going to be done, I have a better solution to bump kconfig soon.

I'll be making kconfig code stand alone tree soon which projects which want to embrace it can use it as a git subtree (note this is different and better than a git sub module). Then updates can just be done with something like:

make refresh-kconfig

And that would just get the latest kconfig and trigger a merge commit locally.

Luis
--
To unsubscribe from this list: send the line "unsubscribe backports" in

#11 lore raw

Hi Luis,

Quoted 10 lines · Luis Chamberlain
Quoted 9 lines · Thomas Pedersen

The backports integration mode[0] seems to have suffered some bitrot and doesn't currently work. Integration mode can be convenient in certain use cases and build flows though, so this patch set tries to fixup the integration mode.

These changes were developed and tested for backporting a v5.10 backports + linux branch to a v4.19 kernel. v5.15-rc6 backports + linux was successfully built against v4.19.

Quoted 7 lines
Quoted 1 line

0: https://backports.wiki.kernel.org/index.php/Documentation/integration

Good stuff, looks good, just one thing the $FOO --> $(FOO) thing, does that assume/require a bump in kconfig used in backports, ie, if not using integration does that still work? If so then cool, otherwise an upgrade to kconfig would be needed, and if that is going to be done, I have a better solution to bump kconfig soon.

I just tried the package mode, and no it doesn't work. The embedded kconfig doesn't like "$()".

In that case I'll wait for your changes and resubmit once they've been merged.

Quoted 9 lines

I'll be making kconfig code stand alone tree soon which projects which want to embrace it can use it as a git subtree (note this is different and better than a git sub module). Then updates can just be done with something like:

make refresh-kconfig

And that would just get the latest kconfig and trigger a merge commit locally.

Cool. It seems kconfig is becoming somewhat of a standard for build time configuration (backports, u-boot, buildroot, etc.), so it makes sense to live as a standalone repo.

Thanks.

Signature · 3 lines
thomas
--
To unsubscribe from this list: send the line "unsubscribe backports" in
#12 lore raw
Quoted 24 lines · Thomas Pedersen

Hi Luis,

Quoted 12 lines · Luis Chamberlain
Quoted 11 lines · Thomas Pedersen

The backports integration mode[0] seems to have suffered some bitrot and
doesn't currently work. Integration mode can be convenient in certain use cases and build flows though, so this patch set tries to fixup the integration mode.

These changes were developed and tested for backporting a v5.10 backports + linux branch to a v4.19 kernel. v5.15-rc6 backports + linux
was successfully built against v4.19.

Quoted 8 lines
Quoted 2 lines

0:
https://backports.wiki.kernel.org/index.php/Documentation/integration

Good stuff, looks good, just one thing the $FOO --> $(FOO) thing, does that assume/require a bump in kconfig used in backports, ie, if not using integration does that still work? If so then cool, otherwise an upgrade to kconfig would be needed, and if that is going to be done, I have a better solution to bump kconfig soon.

Quoted 5 lines

I just tried the package mode, and no it doesn't work. The embedded kconfig doesn't like "$()".

In that case I'll wait for your changes and resubmit once they've been merged.

OK I have kconfig as a git subtree and two trees using it. The main kconfig tree:

https://github.com/mcgrof/kconfig

Two demos:

https://github.com/mcgrof/init-kconfig
https://github.com/mcgrof/kdevops

Can someone try to convert over backports to it?

First:

git rm -rf backport/kconf/

I think something like the following is needed after that:

backport/Makefile.real +2 -30
index 65508028..1488e117 100644
@@ -10,36 +10,8 @@ endif
 .SUFFIXES:
 
 export CONFIG_=CPTCFG_
-
-.PHONY: menuconfig
-menuconfig:
-	@$(MAKE) -C kconf mconf
-	@./kconf/mconf Kconfig
-
-.PHONY: listnewconfig oldaskconfig oldconfig \
-	silentoldconfig olddefconfig oldnoconfig \
-	allnoconfig allyesconfig allmodconfig \
-	alldefconfig randconfig
-listnewconfig oldaskconfig oldconfig \
-silentoldconfig olddefconfig oldnoconfig \
-allnoconfig allyesconfig allmodconfig \
-alldefconfig randconfig:
-	@$(MAKE) -C kconf conf
-	@./kconf/conf --$@ Kconfig
-
-.PHONY: usedefconfig
-usedefconfig:
-	@$(MAKE) -C kconf conf
-	@./kconf/conf --defconfig=defconfig Kconfig
-
-.PHONY: savedefconfig
-savedefconfig:
-	@$(MAKE) -C kconf conf
-	@./kconf/conf --savedefconfig=defconfig Kconfig
-
-defconfig-%::
-	@$(MAKE) -C kconf conf
-	@./kconf/conf --defconfig=defconfigs/$(@:defconfig-%=%) Kconfig
+export KCONFIG_DIR=$(CURDIR)/scripts/kconf
+include $(KCONFIG_DIR)/kconfig.Makefile
 
 .config:
 	@test -f defconfig && $(MAKE) usedefconfig || (			\

Or just wait to add the code until after the next commits. Then see this on init-kconfig example:

mcgrof@fulton ~/devel/init-kconfig (git::master)$ cat Makefile.subtrees # If you need to use a git subtree, please add it here. add-kconfig-remote:
git remote add kconfig https://github.com/mcgrof/kconfig.git

add-kconfig:
git subtree add --prefix=scripts/kconfig/ kconfig master

refresh-kconfig:
git fetch kconfig
git subtree pull --prefix=scripts/kconfig/ kconfig master

The prefix will be differnt for backports, so backport/kconfig/ So you can just run this manually first:

git remote add kconfig https://github.com/mcgrof/kconfig.git
git subtree add --prefix=backport/kconf/ kconfig master

Generate a tree and see if that worked.

Quoted 5 lines
Quoted 5 lines

I'll be making kconfig code stand alone tree soon which projects which want to embrace it can use it as a git subtree (note this is different and better than a git sub module). Then updates can just be done with something like:

Quoted 8 lines
Quoted 4 lines

make refresh-kconfig

And that would just get the latest kconfig and trigger a merge commit locally.

Cool. It seems kconfig is becoming somewhat of a standard for build time configuration (backports, u-boot, buildroot, etc.), so it makes sense to live as a standalone repo.

Indeed. Hence the above effort. I finally got it. If this works then we can just sync kconfig once in the kconfig tree and then projects which use it can just run the refresh target to update.

Luis
--
To unsubscribe from this list: send the line "unsubscribe backports" in

#13 lore raw
Quoted 1 line · Luis Chamberlain

Can someone try to convert over backports to it?

Nevermind, I've done this work and I'll post patches now.

Luis
--
To unsubscribe from this list: send the line "unsubscribe backports" in

#14 lore raw
In reply to Thomas Pedersen
Quoted 10 lines · Thomas Pedersen

The backports integration mode[0] seems to have suffered some bitrot and doesn't currently work. Integration mode can be convenient in certain use cases and build flows though, so this patch set tries to fixup the integration mode.

These changes were developed and tested for backporting a v5.10 backports + linux branch to a v4.19 kernel. v5.15-rc6 backports + linux was successfully built against v4.19.

0: https://backports.wiki.kernel.org/index.php/Documentation/integration

Thank you for your work. I didn't use this feature and you are right it did bit rot.

Hauke

Quoted 10 lines

Thomas Pedersen (7):
backport: refresh integration patch
backport: resurrect integrations
gentree: try to make patch operation idempotent in case of --clean
gentree: do not prefix Kernel.local symbols
lib/bpversion: calculate Kconfig.versions for next major version
backport: expose BP_MODULES in package mode only
kconfig: fix select conversion for BPAUTO_ symbols in integration mode

Quoted 11 lines
  backport/Kconfig.integrate                    | 11 ++--
  backport/Kconfig.package                      | 10 +--
  backport/Kconfig.package.hacks                |  9 +++
  backport/Kconfig.sources                      | 18 +++---
  backport/compat/Kconfig                       |  9 ---
  gentree.py                                    | 62 +++++++++++++------
  .../0001-enable-backports-built-in.patch      | 34 +++++-----
  lib/bpversion.py                              | 11 +++-
  lib/kconfig.py                                |  5 +-
  9 files changed, 96 insertions(+), 73 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe backports" in