[elbe-devel] [PATCH] rfs: invert logic for getty setup

John Ogness john.ogness at linutronix.de
Tue Aug 6 21:32:03 CEST 2019


elbe tries both SysV and systemd methods for setting up getty.
However, the tries are written such that an error is generated,
even if the situation is normal. Invert the logic so that
error messages are only generated if there is really a problem.

Signed-off-by: John Ogness <john.ogness at linutronix.de>
---
 Let's get rid of these "normal" error messages!

 elbepack/rfs.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index 97aa48b..dca69c6 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -344,7 +344,7 @@ class BuildEnv (object):
             if serial_baud:
                 self.log.chroot(
                     self.rfs.path,
-                    """/bin/sh -c '[ -f /etc/inittab ] && """
+                    """/bin/sh -c '[ ! -f /etc/inittab ] || """
                     """echo "T0:23:respawn:/sbin/getty -L %s %s vt100" >> """
                     """/etc/inittab'""" % (serial_con, serial_baud),
                     allow_fail=True)
@@ -352,7 +352,7 @@ class BuildEnv (object):
                 self.log.chroot(
                     self.rfs.path,
                     """/bin/sh -c """
-                    """'[ -f /lib/systemd/system/serial-getty at .service ] && """
+                    """'[ ! -f /lib/systemd/system/serial-getty at .service ] || """
                     """ln -s /lib/systemd/system/serial-getty at .service """
                     """/etc/systemd/system/getty.target.wants/"""
                     """serial-getty@%s.service'""" % serial_con,
-- 
1.7.10.4



More information about the elbe-devel mailing list