Skip to contentSkip to conversation

Patch review

PATCH New Anuj Mittal 1 participant 7 messages Mar 14, 2022

lore
Share & tools
lore
#0 lore raw

cover Patch review

Next set of changes to be merged for honister. Please review.

No problems seen while testing:

https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/3349

Thanks,

Anuj

The following changes since commit c2ebef2113d05aefb98b41caf380e03ec368934c:

expat: Upgrade 2.4.6 -> 2.4.7 (2022-03-07 11:10:21 +0800)

are available in the Git repository at:

git://push.openembedded.org/openembedded-core-contrib anujm/honister

Alexander Kanavin (2):
util-linux: update 2.37.2 -> 2.37.3
util-linux: upgrade 2.37.3 -> 2.37.4

Bill Pittman (1):
wic: Use custom kernel path if provided

Jose Quaresma (1):
sstate: inside the threadedpool don't write to the shared localdata

Pavel Zhukov (1):
patch.py: Prevent git repo reinitialization

Richard Purdie (1):
vim: Update to 8.2.4524 for further CVE fixes

 .../recipes-test/gitrepotest/gitrepotest.bb    | 16 ++++++++++++++++
 .../gitrepotest/0001-testpatch.patch           |  9 +++++++++
 meta/classes/sstate.bbclass                    |  2 +-
 meta/lib/oe/patch.py                           | 11 ++++++++---
 meta/lib/oeqa/selftest/cases/bbtests.py        | 18 ++++++++++++++++--
 ..._2.37.2.bb => util-linux-libuuid_2.37.4.bb} |  0
 meta/recipes-core/util-linux/util-linux.inc    |  2 +-
 ...il-linux_2.37.2.bb => util-linux_2.37.4.bb} |  0
 meta/recipes-support/vim/vim.inc               |  4 ++--
 scripts/wic                                    |  3 +++
 10 files changed, 56 insertions(+), 9 deletions(-)
 create mode 100644 meta-selftest/recipes-test/gitrepotest/gitrepotest.bb
 create mode 100644 meta-selftest/recipes-test/gitrepotest/gitrepotest/0001-testpatch.patch
 rename meta/recipes-core/util-linux/{util-linux-libuuid_2.37.2.bb => util-linux-libuuid_2.37.4.bb} (100%)
 rename meta/recipes-core/util-linux/{util-linux_2.37.2.bb => util-linux_2.37.4.bb} (100%)
Signature · 1 line
2.35.1
#1 lore raw

PATCH 1/6 sstate: inside the threadedpool don't write to the shared localdata

From: Jose Quaresma <[email protected]>

When inside the threadedpool we make a copy of the localdata to avoid some race condition, so we need to use this new localdata2 and stop write the shared localdata.

(cherry picked from commit 1fa763b2022822a76fde541724e83e1977833d03)
---
 meta/classes/sstate.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/sstate.bbclass +1 -1
index 103de01264..d3816ec7b0 100644
@@ -977,7 +977,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
 
             localdata2 = bb.data.createCopy(localdata)
             srcuri = "file://" + sstatefile
-            localdata.setVar('SRC_URI', srcuri)
+            localdata2.setVar('SRC_URI', srcuri)
             bb.debug(2, "SState: Attempting to fetch %s" % srcuri)
 
             try:
Signature · 1 line
2.35.1
#2 lore raw

PATCH 2/6 vim: Update to 8.2.4524 for further CVE fixes

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

Includes CVE-2022-0696, CVE-2022-0714, CVE-2022-0729.

(cherry picked from commit 0d29988958e48534a0076307bb2393a3c1309e03)
---
 meta/recipes-support/vim/vim.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-support/vim/vim.inc +2 -2
index 59e0b4ed7a..a05e91fe20 100644
@@ -21,8 +21,8 @@ SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https \
            file://racefix.patch \
            "
 
-PV .= ".4424"
-SRCREV = "cdf717283ca70b18f20b8a2cefe7957083280c6f"
+PV .= ".4524"
+SRCREV = "d8f8629b1bf566e1dada7515e9b146c69e5d9757"
 
 # Do not consider .z in x.y.z, as that is updated with every commit
 UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+)\.0"
Signature · 1 line
2.35.1
#3 lore raw

PATCH 3/6 wic: Use custom kernel path if provided

In reply to Anuj Mittal

From: Bill Pittman <[email protected]>

If the custom kernel path is provided in options, then use that path instead of the default path.

(cherry picked from commit 1068102216a894c467f71f6046fdb37d5577545c)
---
 scripts/wic | 3 +++
 1 file changed, 3 insertions(+)
scripts/wic +3 -0
index 4bcff8f79c..aee63a45aa 100755
@@ -159,6 +159,9 @@ def wic_create_subcommand(options, usage_str):
                            "(Use -e/--image-name to specify it)")
         native_sysroot = options.native_sysroot
 
+    if options.kernel_dir:
+        kernel_dir = options.kernel_dir
+
     if not options.vars_dir and (not native_sysroot or not os.path.isdir(native_sysroot)):
         logger.info("Building wic-tools...\n")
         subprocess.check_call(["bitbake", "wic-tools"])
Signature · 1 line
2.35.1
#4 lore raw

PATCH 4/6 util-linux: update 2.37.2 -> 2.37.3

In reply to Anuj Mittal

From: Alexander Kanavin <[email protected]>

(cherry picked from commit e543d4407fdc91559a77d6c5cd41bcb75bc8c73c)
---
 ...til-linux-libuuid_2.37.2.bb => util-linux-libuuid_2.37.3.bb} | 0
 meta/recipes-core/util-linux/util-linux.inc                     | 2 +-
 .../util-linux/{util-linux_2.37.2.bb => util-linux_2.37.3.bb}   | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename meta/recipes-core/util-linux/{util-linux-libuuid_2.37.2.bb => util-linux-libuuid_2.37.3.bb} (100%)
 rename meta/recipes-core/util-linux/{util-linux_2.37.2.bb => util-linux_2.37.3.bb} (100%)
meta/recipes-core/util-linux/util-linux-libuuid_2.37.3.bb renamed from meta/recipes-core/util-linux/util-linux-libuuid_2.37.2.bb +0 -0
similarity index 100%
rename from meta/recipes-core/util-linux/util-linux-libuuid_2.37.2.bb
rename to meta/recipes-core/util-linux/util-linux-libuuid_2.37.3.bb
meta/recipes-core/util-linux/util-linux.inc +1 -1
index 1e3cd28801..0309332722 100644
@@ -37,4 +37,4 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
            file://avoid_parallel_tests.patch \
            "
 
-SRC_URI[sha256sum] = "6a0764c1aae7fb607ef8a6dd2c0f6c47d5e5fd27aa08820abaad9ec14e28e9d9"
+SRC_URI[sha256sum] = "590c592e58cd6bf38519cb467af05ce6a1ab18040e3e3418f24bcfb2f55f9776"
meta/recipes-core/util-linux/util-linux_2.37.3.bb renamed from meta/recipes-core/util-linux/util-linux_2.37.2.bb +0 -0
similarity index 100%
rename from meta/recipes-core/util-linux/util-linux_2.37.2.bb
rename to meta/recipes-core/util-linux/util-linux_2.37.3.bb
Signature · 1 line
2.35.1
#5 lore raw

PATCH 5/6 util-linux: upgrade 2.37.3 -> 2.37.4

In reply to Anuj Mittal

From: Alexander Kanavin <[email protected]>

(cherry picked from commit 6a3289c4786c4d278e2bf0ec1a5e04363772d8bc)
---
 ...til-linux-libuuid_2.37.3.bb => util-linux-libuuid_2.37.4.bb} | 0
 meta/recipes-core/util-linux/util-linux.inc                     | 2 +-
 .../util-linux/{util-linux_2.37.3.bb => util-linux_2.37.4.bb}   | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename meta/recipes-core/util-linux/{util-linux-libuuid_2.37.3.bb => util-linux-libuuid_2.37.4.bb} (100%)
 rename meta/recipes-core/util-linux/{util-linux_2.37.3.bb => util-linux_2.37.4.bb} (100%)
meta/recipes-core/util-linux/util-linux-libuuid_2.37.4.bb renamed from meta/recipes-core/util-linux/util-linux-libuuid_2.37.3.bb +0 -0
similarity index 100%
rename from meta/recipes-core/util-linux/util-linux-libuuid_2.37.3.bb
rename to meta/recipes-core/util-linux/util-linux-libuuid_2.37.4.bb
meta/recipes-core/util-linux/util-linux.inc +1 -1
index 0309332722..c48f9572f5 100644
@@ -37,4 +37,4 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
            file://avoid_parallel_tests.patch \
            "
 
-SRC_URI[sha256sum] = "590c592e58cd6bf38519cb467af05ce6a1ab18040e3e3418f24bcfb2f55f9776"
+SRC_URI[sha256sum] = "634e6916ad913366c3536b6468e7844769549b99a7b2bf80314de78ab5655b83"
meta/recipes-core/util-linux/util-linux_2.37.4.bb renamed from meta/recipes-core/util-linux/util-linux_2.37.3.bb +0 -0
similarity index 100%
rename from meta/recipes-core/util-linux/util-linux_2.37.3.bb
rename to meta/recipes-core/util-linux/util-linux_2.37.4.bb
Signature · 1 line
2.35.1
#6 lore raw

PATCH 6/6 patch.py: Prevent git repo reinitialization

In reply to Anuj Mittal

From: Pavel Zhukov <[email protected]>

There were few bugs in the _isInitialized() function which might trigger git repo to be reinitialized and patches failing to apply.

---
 .../recipes-test/gitrepotest/gitrepotest.bb    | 16 ++++++++++++++++
 .../gitrepotest/0001-testpatch.patch           |  9 +++++++++
 meta/lib/oe/patch.py                           | 11 ++++++++---
 meta/lib/oeqa/selftest/cases/bbtests.py        | 18 ++++++++++++++++--
 4 files changed, 49 insertions(+), 5 deletions(-)
 create mode 100644 meta-selftest/recipes-test/gitrepotest/gitrepotest.bb
 create mode 100644 meta-selftest/recipes-test/gitrepotest/gitrepotest/0001-testpatch.patch
meta-selftest/recipes-test/gitrepotest/gitrepotest.bb new file +16 -0
new file mode 100644
index 0000000000..f1b6c55833
@@ -0,0 +1,16 @@
+SUMMARY = "Test recipe for git repo initialization"
+HOMEPAGE = "https://git.yoctoproject.org/git/matchbox-panel-2"
+LICENSE = "GPL-2.0-or-later"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+PATCHTOOL="git"
+
+SRC_URI = "git://git.yoctoproject.org/git/matchbox-panel-2;branch=master;protocol=https \
+           file://0001-testpatch.patch \
+          "
+
+SRCREV = "f82ca3f42510fb3ef10f598b393eb373a2c34ca7"
+
+S = "${WORKDIR}/git"
meta-selftest/recipes-test/gitrepotest/gitrepotest/0001-testpatch.patch new file +9 -0
new file mode 100644
index 0000000000..bccda17ee9
@@ -0,0 +1,9 @@
+diff --git a/Makefile.am b/Makefile.am
+index 432a9b4..bbf7c74 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,3 +1,4 @@
++## This is useless comment to test if patch works
+ ACLOCAL_AMFLAGS = -I m4
+ 
+ SUBDIRS = matchbox-panel applets data po
meta/lib/oe/patch.py +8 -3
index 950fe723dc..9034fcae03 100644
@@ -304,14 +304,19 @@ class GitApplyTree(PatchTree):
 
     def _isInitialized(self):
         cmd = "git rev-parse --show-toplevel"
-        (status, output) = subprocess.getstatusoutput(cmd.split())
+        try:
+            output = runcmd(cmd.split(), self.dir).strip()
+        except CmdError as err:
+            ## runcmd returned non-zero which most likely means 128
+            ## Not a git directory
+            return False
         ## Make sure repo is in builddir to not break top-level git repos
-        return status == 0 and os.path.samedir(output, self.dir)
+        return os.path.samefile(output, self.dir)
 
     def _initRepo(self):
         runcmd("git init".split(), self.dir)
         runcmd("git add .".split(), self.dir)
-        runcmd("git commit -a --allow-empty -m Patching_started".split(), self.dir)
+        runcmd("git commit -a --allow-empty -m bitbake_patching_started".split(), self.dir)
 
     @staticmethod
     def extractPatchHeader(patchfile):
meta/lib/oeqa/selftest/cases/bbtests.py +16 -2
index 31962b92d7..a08001a173 100644
@@ -310,8 +310,22 @@ INHERIT:remove = \"report-error\"
         src = get_bb_var("SRC_URI",test_recipe)
         gitscm = re.search("git://", src)
         self.assertFalse(gitscm, "test_git_patchtool pre-condition failed: {} test recipe contains git repo!".format(test_recipe))
-        result = bitbake('man-db -c patch', ignore_status=False)
+        result = bitbake('{} -c patch'.format(test_recipe), ignore_status=False)
         fatal = re.search("fatal: not a git repository (or any of the parent directories)", result.output)
         self.assertFalse(fatal, "Failed to patch using PATCHTOOL=\"git\"")
         self.delete_recipeinc(test_recipe)
-        bitbake('-cclean man-db')
+        bitbake('-cclean {}'.format(test_recipe))
+
+    def test_git_patchtool2(self):
+        """ Test if PATCHTOOL=git works with git repo and doesn't reinitialize it
+        """
+        test_recipe = "gitrepotest"
+        src = get_bb_var("SRC_URI",test_recipe)
+        gitscm = re.search("git://", src)
+        self.assertTrue(gitscm, "test_git_patchtool pre-condition failed: {} test recipe doesn't contains git repo!".format(test_recipe))
+        result = bitbake('{} -c patch'.format(test_recipe), ignore_status=False)
+        srcdir = get_bb_var('S', test_recipe)
+        result = runCmd("git log", cwd = srcdir)
+        self.assertFalse("bitbake_patching_started" in result.output, msg = "Repository has been reinitialized. {}".format(srcdir))
+        self.delete_recipeinc(test_recipe)
+        bitbake('-cclean {}'.format(test_recipe))
Signature · 1 line
2.35.1