Skip to contentSkip to conversation

Revert "systemd-serialgetty: Fix sed expression quoting"

PATCH In review Geoff Parker 2 participants 3 messages Sep 12, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "systemd-serialgetty: Fix sed expression quoting"

From: Geoff Parker <[email protected]>

This reverts commit 12d0fdd9c990bdc67bf6c8fd2d269cb766069ea5.

Adding quotes around sed string treats $default_baudrate as a literal rather than a variable substitution in the do_install function. Breaks the systemd [email protected] file and
serial console getty.

[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

---
 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 059fccc2b6..044c6c5b67 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.20.1
#1 lore raw

instead of revert can you try double quotes?

e.g.
sed -e "s/\@BAUDRATE\@/$default_baudrate/g" ....

Quoted 39 lines · Geoff Parker

From: Geoff Parker <[email protected]>

This reverts commit 12d0fdd9c990bdc67bf6c8fd2d269cb766069ea5.

Adding quotes around sed string treats $default_baudrate as a literal rather than a variable substitution in the do_install function. Breaks the systemd [email protected] file and
serial console getty.

[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

---
 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 059fccc2b6..044c6c5b67 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
#2 lore raw
In reply to Geoff Parker

instead of revert can you try double quotes?

e.g.
sed -i -e "s/\@BAUDRATE\@/$default_baudrate/g" ....

Quoted 39 lines · Geoff Parker

From: Geoff Parker <[email protected]>

This reverts commit 12d0fdd9c990bdc67bf6c8fd2d269cb766069ea5.

Adding quotes around sed string treats $default_baudrate as a literal rather than a variable substitution in the do_install function. Breaks the systemd [email protected] file and
serial console getty.

[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

---
 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 059fccc2b6..044c6c5b67 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