]> code.ossystems Code Review - openembedded-core.git/commitdiff
systemd-serialgetty: Replace sed quoting using ' with " to allow var expansion
authorGeoff Parker <geoffhp@gmail.com>
Sat, 12 Sep 2020 03:07:05 +0000 (20:07 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 12 Sep 2020 15:23:14 +0000 (16:23 +0100)
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'
serial-getty@.service file having a literal $default_baudrate.

This broke the serial console getty service.

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

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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/systemd-serialgetty.bb

index 059fccc2b6e4daf0a1ff05b4ecf5418d99e854bb..0cc0dc8c79cdf663f7c99864b8c3cda05e516340 100644 (file)
@@ -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
@@ -34,7 +34,7 @@ do_install() {
                        else
                                # install custom service file for the non-default baudrate
                                install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
-                               sed -i -e s/\@BAUDRATE\@/$baudrate/g ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
+                               sed -i -e "s/\@BAUDRATE\@/$baudrate/g" ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
                                # enable the service
                                ln -sf ${systemd_unitdir}/system/serial-getty$baudrate@.service \
                                        ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty$baudrate@$ttydev.service