Revert "systemd-serialgetty: Fix sed expression quoting"

Submitted by Geoff Parker on Sept. 12, 2020, 12:17 a.m. | Patch ID: 176425

Details

Message ID 20200912001721.12801-1-geoffhp@gmail.com
State New
Headers show

Commit Message

Geoff Parker Sept. 12, 2020, 12:17 a.m.
From: Geoff Parker <geoffhp@gmail.com>

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 serial-getty@.service file and
serial console getty.

serial-getty@.service 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

Signed-off-by: Geoff Parker <geoffhp@gmail.com>
---
 meta/recipes-core/systemd/systemd-serialgetty.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-core/systemd/systemd-serialgetty.bb b/meta/recipes-core/systemd/systemd-serialgetty.bb
index 059fccc2b6..044c6c5b67 100644
--- a/meta/recipes-core/systemd/systemd-serialgetty.bb
+++ b/meta/recipes-core/systemd/systemd-serialgetty.bb
@@ -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}/serial-getty@.service ${D}${systemd_unitdir}/system/
-		sed -i -e 's/\@BAUDRATE\@/$default_baudrate/g' ${D}${systemd_unitdir}/system/serial-getty@.service
+		sed -i -e s/\@BAUDRATE\@/$default_baudrate/g ${D}${systemd_unitdir}/system/serial-getty@.service
 
 		tmp="${SERIAL_CONSOLES}"
 		for entry in $tmp ; do

Comments

Khem Raj Sept. 12, 2020, 1:48 a.m.
instead of revert can you try double quotes?

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

On 9/11/20 5:17 PM, Geoff Parker wrote:
> From: Geoff Parker <geoffhp@gmail.com>
> 
> 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 serial-getty@.service file and
> serial console getty.
> 
> serial-getty@.service 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
> 
> Signed-off-by: Geoff Parker <geoffhp@gmail.com>
> ---
>  meta/recipes-core/systemd/systemd-serialgetty.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-core/systemd/systemd-serialgetty.bb b/meta/recipes-core/systemd/systemd-serialgetty.bb
> index 059fccc2b6..044c6c5b67 100644
> --- a/meta/recipes-core/systemd/systemd-serialgetty.bb
> +++ b/meta/recipes-core/systemd/systemd-serialgetty.bb
> @@ -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}/serial-getty@.service ${D}${systemd_unitdir}/system/
> -		sed -i -e 's/\@BAUDRATE\@/$default_baudrate/g' ${D}${systemd_unitdir}/system/serial-getty@.service
> +		sed -i -e s/\@BAUDRATE\@/$default_baudrate/g ${D}${systemd_unitdir}/system/serial-getty@.service
>  
>  		tmp="${SERIAL_CONSOLES}"
>  		for entry in $tmp ; do
> 
> 
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142447): https://lists.openembedded.org/g/openembedded-core/message/142447
Mute This Topic: https://lists.openembedded.org/mt/76792280/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Khem Raj Sept. 12, 2020, 1:48 a.m.
instead of revert can you try double quotes?

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

On 9/11/20 5:17 PM, Geoff Parker wrote:
> From: Geoff Parker <geoffhp@gmail.com>
> 
> 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 serial-getty@.service file and
> serial console getty.
> 
> serial-getty@.service 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
> 
> Signed-off-by: Geoff Parker <geoffhp@gmail.com>
> ---
>  meta/recipes-core/systemd/systemd-serialgetty.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-core/systemd/systemd-serialgetty.bb b/meta/recipes-core/systemd/systemd-serialgetty.bb
> index 059fccc2b6..044c6c5b67 100644
> --- a/meta/recipes-core/systemd/systemd-serialgetty.bb
> +++ b/meta/recipes-core/systemd/systemd-serialgetty.bb
> @@ -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}/serial-getty@.service ${D}${systemd_unitdir}/system/
> -		sed -i -e 's/\@BAUDRATE\@/$default_baudrate/g' ${D}${systemd_unitdir}/system/serial-getty@.service
> +		sed -i -e s/\@BAUDRATE\@/$default_baudrate/g ${D}${systemd_unitdir}/system/serial-getty@.service
>  
>  		tmp="${SERIAL_CONSOLES}"
>  		for entry in $tmp ; do
> 
> 
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142448): https://lists.openembedded.org/g/openembedded-core/message/142448
Mute This Topic: https://lists.openembedded.org/mt/76792280/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-