[gnome-continuous-yocto/gnomeostree-3.28-rocko: 4466/8267] wic: remove syslinux.py
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 4466/8267] wic: remove syslinux.py
- Date: Sun, 17 Dec 2017 02:04:35 +0000 (UTC)
commit f1957bf59e538fb3762be31706671481c53ed6b6
Author: Ed Bartosh <ed bartosh linux intel com>
Date: Wed Feb 1 12:29:32 2017 +0200
wic: remove syslinux.py
This module contains singe function serial_console_form_kargs, which
is used only by rootfs_pcbios_ext plugin. Moved it there and removed
syslinux module to make it easy to find and mainain plugin code.
[YOCTO #10619]
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
.../lib/wic/plugins/source/rootfs_pcbios_ext.py | 38 +++++++++++++-
scripts/lib/wic/utils/syslinux.py | 58 --------------------
2 files changed, 37 insertions(+), 59 deletions(-)
---
diff --git a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
index 1032019..bd6fd6c 100644
--- a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
+++ b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
@@ -19,13 +19,49 @@
#
import os
+import re
+
from wic import msger
-from wic.utils import syslinux
from wic.utils import runner
from wic.utils.misc import get_bitbake_var, exec_cmd, exec_native_cmd
from wic.utils.errors import ImageError
from wic.pluginbase import SourcePlugin
+def serial_console_form_kargs(kernel_args):
+ """
+ Create SERIAL... line from kernel parameters
+
+ syslinux needs a line SERIAL port [baudrate [flowcontrol]]
+ in the syslinux.cfg file. The config line is generated based
+ on kernel boot parameters. The the parameters of the first
+ ttyS console are considered for syslinux config.
+ @param kernel_args kernel command line
+ @return line for syslinux config file e.g. "SERIAL 0 115200"
+ """
+ syslinux_conf = ""
+ for param in kernel_args.split():
+ param_match = re.match("console=ttyS([0-9]+),?([0-9]*)([noe]?)([0-9]?)(r?)", param)
+ if param_match:
+ syslinux_conf += "SERIAL " + param_match.group(1)
+ # baudrate
+ if param_match.group(2):
+ syslinux_conf += " " + param_match.group(2)
+ # parity
+ if param_match.group(3) and param_match.group(3) != 'n':
+ msger.warning("syslinux does not support parity for console. {} is ignored."
+ .format(param_match.group(3)))
+ # number of bits
+ if param_match.group(4) and param_match.group(4) != '8':
+ msger.warning("syslinux supports 8 bit console configuration only. {} is ignored."
+ .format(param_match.group(4)))
+ # flow control
+ if param_match.group(5) and param_match.group(5) != '':
+ msger.warning("syslinux console flowcontrol configuration. {} is ignored."
+ .format(param_match.group(5)))
+ break
+
+ return syslinux_conf
+
# pylint: disable=no-init
class RootfsPlugin(SourcePlugin):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]