From 262dfa849cb9b5a5e010faf62244f64a9ace96f6 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 14 Sep 2023 15:37:31 +0000 Subject: [PATCH] Allow to enable serial console on the command line Signed-off-by: Michael Tremer --- src/bricklayer | 2 ++ src/python/__init__.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bricklayer b/src/bricklayer index 2b5beb5..e5ac1e7 100644 --- a/src/bricklayer +++ b/src/bricklayer @@ -52,6 +52,8 @@ class Cli(object): help=_("Enable unattended mode")) parser.add_argument("--disk", nargs="*", dest="disks", default=[], help=_("A disk image file or device which will be used")) + parser.add_argument("--serial", action="store_true", + help=_("Create an image using a serial console")) # Parse arguments return parser.parse_args() diff --git a/src/python/__init__.py b/src/python/__init__.py index 339a67a..ba7f59c 100644 --- a/src/python/__init__.py +++ b/src/python/__init__.py @@ -49,7 +49,7 @@ class Bricklayer(object): Bricklayer's base class """ def __init__(self, arch, pakfire_conf=None, first_install=False, debug=False, - unattended=False, disks=[]): + unattended=False, disks=[], serial=False): self.arch = arch self.pakfire_conf = pakfire_conf self.first_install = first_install @@ -79,7 +79,7 @@ class Bricklayer(object): "kernel-cmdline" : ["quiet", "splash"], # Serial Console - "serial-console" : False, + "serial-console" : serial, "serial-console-device" : "ttyS0", "serial-console-baudrate" : 115200, } -- 2.47.2