Skip to contentSkip to conversation

Patch review

PATCH New Steve Sakoman 1 participant 8 messages Sep 18, 2020

lore
Share & tools
lore
#0 lore raw

cover Patch review

Please review this next set of patches for dunfell and have comments back by end of day Monday.

The following changes since commit b98e50f08b2bcf61fbc75ea1b0ad83a17c0a736a:

cve-check: avoid FileNotFoundError if no do_cve_check task has run (2020-09-14 04:26:37 -1000)

are available in the Git repository at:

git://git.openembedded.org/openembedded-core-contrib stable/dunfell-nut
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=stable/dunfell-nut

Christophe GUIBOUT (1):
initramfs-framework: support kernel cmdline with double quotes

Geoff Parker (1):
systemd-serialgetty: Replace sed quoting using ' with " to allow var
expansion

Khem Raj (1):
populate_sdk_ext: Do not assume local.conf will always exist

Michael Gloff (1):
sysvinit: Remove ${B} assignment

Pierre-Jean Texier (1):
libubootenv: upgrade 0.3 -> 0.3.1

Rahul Kumar (1):
systemd-serialgetty: Fix sed expression quoting

Steve Sakoman (1):
Revert "kernel.bbclass: run do_symlink_kernsrc before do_patch"

 meta/classes/kernel.bbclass                         |  2 +-
 meta/classes/populate_sdk_ext.bbclass               |  5 +++--
 .../{libubootenv_0.3.bb => libubootenv_0.3.1.bb}    |  2 +-
 .../initrdscripts/initramfs-framework/init          | 13 +++++++++++++
 meta/recipes-core/systemd/systemd-serialgetty.bb    |  4 ++--
 meta/recipes-core/sysvinit/sysvinit_2.96.bb         |  1 -
 6 files changed, 20 insertions(+), 7 deletions(-)
 rename meta/recipes-bsp/u-boot/{libubootenv_0.3.bb => libubootenv_0.3.1.bb} (94%)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/7 systemd-serialgetty: Fix sed expression quoting

From: Rahul Kumar <[email protected]>

Fix sed: -e expression #1, char 13: unterminated `s' command

Error Message:

| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['pseudo-native', 'glibc', 'patch-native', 'quilt-native', 'gcc-cross-arm', 'gcc-runtime', 'linux-libc-headers', 'libgcc', 'flex-native', 'xz-native', 'libtool-native', 'automake-native', 'binutils-cross-arm', 'zlib-native', 'mpfr-native', 'texinfo-dummy-native', 'autoconf-native', 'libmpc-native', 'gnu-config-native', 'gmp-native', 'attr-native', 'm4-native', 'gettext-minimal-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| sed: -e expression #1, char 13: unterminated `s' command
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/opt/Projects/poky/build/tmp/work/qemux86_64-poky-linux/systemd-serialgetty/1.0-r5/temp/run.do_install.11228' failed with exit code 1:
| sed: -e expression #1, char 13: unterminated `s' command
| WARNING: exit code 1 from a shell command.
|

To Fix this Issue using the strong (single quote) character in sed command.
It is recommend to use quotes. If we have meta-characters in the command, quotes are necessary.

(cherry picked from commit e2fea05e150dcfec4b7dfbd8edddb53897026bf9)
---
 meta/recipes-core/systemd/systemd-serialgetty.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd-serialgetty.bb +1 -1
index 044c6c5b67..059fccc2b6 100644
@@ -21,7 +21,7 @@ do_install() {
 		install -d ${D}${systemd_unitdir}/system/
 		install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
 		install -m 0644 ${WORKDIR}/[email protected] ${D}${systemd_unitdir}/system/
-		sed -i -e s/\@BAUDRATE\@/$default_baudrate/g ${D}${systemd_unitdir}/system/[email protected]
+		sed -i -e 's/\@BAUDRATE\@/$default_baudrate/g' ${D}${systemd_unitdir}/system/[email protected]
 
 		tmp="${SERIAL_CONSOLES}"
 		for entry in $tmp ; do
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/7 systemd-serialgetty: Replace sed quoting using ' with " to allow var expansion

In reply to Steve Sakoman

From: Geoff Parker <[email protected]>

A recent commit added single quotes around the sed regex's. This prevented the expansion of $default_baudrate in do_install(), and ended up with systemd's' [email protected] file having a literal $default_baudrate.

This broke the serial console getty service.

[email protected] was getting a line which looked like this:

ExecStart=-/sbin/agetty -8 -L %I $default_baudrate $TERM

Rather than:

ExecStart=-/sbin/agetty -8 -L %I 115200 $TERM

Fixed by repacing the single quotes with double quotes in the sed expressions.

(cherry picked from commit 80b721bfa4fe300a2f52f233f44fa2835426d304)
---
 meta/recipes-core/systemd/systemd-serialgetty.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/systemd/systemd-serialgetty.bb +2 -2
index 059fccc2b6..0cc0dc8c79 100644
@@ -21,7 +21,7 @@ do_install() {
 		install -d ${D}${systemd_unitdir}/system/
 		install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
 		install -m 0644 ${WORKDIR}/[email protected] ${D}${systemd_unitdir}/system/
-		sed -i -e 's/\@BAUDRATE\@/$default_baudrate/g' ${D}${systemd_unitdir}/system/[email protected]
+		sed -i -e "s/\@BAUDRATE\@/$default_baudrate/g" ${D}${systemd_unitdir}/system/[email protected]
 
 		tmp="${SERIAL_CONSOLES}"
 		for entry in $tmp ; do
@@ -34,7 +34,7 @@ do_install() {
 			else
 				# install custom service file for the non-default baudrate
 				install -m 0644 ${WORKDIR}/[email protected] ${D}${systemd_unitdir}/system/[email protected]
-				sed -i -e s/\@BAUDRATE\@/$baudrate/g ${D}${systemd_unitdir}/system/[email protected]
+				sed -i -e "s/\@BAUDRATE\@/$baudrate/g" ${D}${systemd_unitdir}/system/[email protected]
 				# enable the service
 				ln -sf ${systemd_unitdir}/system/[email protected] \
 					${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty$baudrate@$ttydev.service
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/7 initramfs-framework: support kernel cmdline with double quotes

In reply to Steve Sakoman

From: Christophe GUIBOUT <[email protected]>

It avoids init to crash when kernel cmdline contains a string with spaces inside, like that:
dyndbg="file drivers/usb/core/hub.c +pltf"

(cherry picked from commit 88b8b94bd2d052bca29d27bd5cd00eddb0f5999d)
---
 .../initrdscripts/initramfs-framework/init          | 13 +++++++++++++
 1 file changed, 13 insertions(+)
meta/recipes-core/initrdscripts/initramfs-framework/init +13 -0
index c71ce0ce8c..567694aff7 100755
@@ -88,12 +88,25 @@ fi
 
 # populate bootparam environment
 for p in `cat /proc/cmdline`; do
+	if [ -n "$quoted" ]; then
+		value="$value $p"
+		if [ "`echo $p | sed -e 's/\"$//'`" != "$p" ]; then
+			eval "bootparam_${quoted}=${value}"
+			unset quoted
+		fi
+		continue
+	fi
+
 	opt=`echo $p | cut -d'=' -f1`
 	opt=`echo $opt | sed -e 'y/.-/__/'`
 	if [ "`echo $p | cut -d'=' -f1`" = "$p" ]; then
 		eval "bootparam_${opt}=true"
 	else
 		value="`echo $p | cut -d'=' -f2-`"
+		if [ "`echo $value | sed -e 's/^\"//'`" != "$value" ]; then
+			quoted=${opt}
+			continue
+		fi
 		eval "bootparam_${opt}=\"${value}\""
 	fi
 done
Signature · 1 line
2.17.1
#4 lore raw

PATCH 4/7 libubootenv: upgrade 0.3 -> 0.3.1

In reply to Steve Sakoman

From: Pierre-Jean Texier <[email protected]>

This is a bugfix release which includes the following changes:

824551a Prepare 0.3.1
ca6aaa1 Fix file reading/writing when the environment is in EEPROM a031dea Fix regression in UBI volume support
c91c150 Define SOVERSION to indicate API version

(cherry picked from commit 447eb941ef43cd5af19aed650fb7da718cedda61)
---
 .../u-boot/{libubootenv_0.3.bb => libubootenv_0.3.1.bb}         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta/recipes-bsp/u-boot/{libubootenv_0.3.bb => libubootenv_0.3.1.bb} (94%)
meta/recipes-bsp/u-boot/libubootenv_0.3.1.bb renamed from meta/recipes-bsp/u-boot/libubootenv_0.3.bb +1 -1
similarity index 94%
rename from meta/recipes-bsp/u-boot/libubootenv_0.3.bb
rename to meta/recipes-bsp/u-boot/libubootenv_0.3.1.bb
index 07711484ac..613e3161fb 100644
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://Licenses/lgpl-2.1.txt;md5=4fbd65380cdd255951079008b36
 SECTION = "libs"
 
 SRC_URI = "git://github.com/sbabic/libubootenv;protocol=https"
-SRCREV = "ad253cfdb07c8492f2ee46a52fbc607ad0b96414"
+SRCREV = "824551ac77bab1d0f7ae34d7a7c77b155240e754"
 
 S = "${WORKDIR}/git"
 
Signature · 1 line
2.17.1
#5 lore raw

PATCH 5/7 sysvinit: Remove ${B} assignment

In reply to Steve Sakoman

From: Michael Gloff <[email protected]>

The VERSION variable is not set unless the
top level Makefile is used as the version is
derived from the Changelog.
If VERSION is not set, none of the binaries built
in the sysvinit recipe will have a valid version
output.
Before:
INIT: version booting
After:
INIT: version 2.96 booting

Using the top level Makefile does not cause any
additional builds to occur.

(cherry picked from commit 10992ad4f343d0f92d9d6246cc2e58effd3f3eeb)
---
 meta/recipes-core/sysvinit/sysvinit_2.96.bb | 1 -
 1 file changed, 1 deletion(-)
meta/recipes-core/sysvinit/sysvinit_2.96.bb +0 -1
index d2b85ed9c0..7358f02385 100644
@@ -25,7 +25,6 @@ SRC_URI[md5sum] = "48cebffebf2a96ab09bec14bf9976016"
 SRC_URI[sha256sum] = "2a2e26b72aa235a23ab1c8471005f890309ce1196c83fbc9413c57b9ab62b587"
 
 S = "${WORKDIR}/sysvinit-${PV}"
-B = "${S}/src"
 
 inherit update-alternatives features_check
 DEPENDS_append = " update-rc.d-native base-passwd virtual/crypt"
Signature · 1 line
2.17.1
#6 lore raw

PATCH 6/7 populate_sdk_ext: Do not assume local.conf will always exist

In reply to Steve Sakoman

From: Khem Raj <[email protected]>

Some distros may not have local.conf, and use auto.conf or site.conf alone to describe distro config metadata, therefore make code robust to not fail eSDK builds for such setups

(cherry picked from commit 6379f951ba92b2b86a55de5fc267bacf8c6095d2)
---
 meta/classes/populate_sdk_ext.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/populate_sdk_ext.bbclass +3 -2
index fd0da16e7e..71686bc993 100644
@@ -310,8 +310,9 @@ python copy_buildsystem () {
         if os.path.exists(builddir + '/conf/auto.conf'):
             with open(builddir + '/conf/auto.conf', 'r') as f:
                 oldlines += f.readlines()
-        with open(builddir + '/conf/local.conf', 'r') as f:
-            oldlines += f.readlines()
+        if os.path.exists(builddir + '/conf/local.conf'):
+            with open(builddir + '/conf/local.conf', 'r') as f:
+                oldlines += f.readlines()
         (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var)
 
         with open(baseoutpath + '/conf/local.conf', 'w') as f:
Signature · 1 line
2.17.1
#7 lore raw

PATCH 7/7 Revert "kernel.bbclass: run do_symlink_kernsrc before do_patch"

In reply to Steve Sakoman

This reverts commit 914d8a00e34a8edf75a349da6f5978e4ed60e6d5.

Due to bug introduced for externalsrc

https://bugzilla.yoctoproject.org/show_bug.cgi?id=14044

---
 meta/classes/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel.bbclass +1 -1
index 9eb9bd2844..9e3c34ad48 100644
@@ -152,7 +152,7 @@ python do_symlink_kernsrc () {
             shutil.move(s, kernsrc)
             os.symlink(kernsrc, s)
 }
-addtask symlink_kernsrc before do_patch after do_unpack
+addtask symlink_kernsrc before do_configure after do_unpack
 
 inherit kernel-arch deploy
 
Signature · 1 line
2.17.1