diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-02-01 12:29:32 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-02-02 17:37:45 +0000 |
commit | f1957bf59e538fb3762be31706671481c53ed6b6 (patch) | |
tree | 6786d9094231fec6a7f295e8b0c0269f0fcaf01d /scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py | |
parent | 653aaea3ccd4b671a6753bc9aecceb08f9eb0e41 (diff) | |
download | poky-f1957bf59e538fb3762be31706671481c53ed6b6.tar.gz |
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>
Diffstat (limited to 'scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py')
-rw-r--r-- | scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py index 1032019a5f..bd6fd6cec7 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 @@ | |||
19 | # | 19 | # |
20 | 20 | ||
21 | import os | 21 | import os |
22 | import re | ||
23 | |||
22 | from wic import msger | 24 | from wic import msger |
23 | from wic.utils import syslinux | ||
24 | from wic.utils import runner | 25 | from wic.utils import runner |
25 | from wic.utils.misc import get_bitbake_var, exec_cmd, exec_native_cmd | 26 | from wic.utils.misc import get_bitbake_var, exec_cmd, exec_native_cmd |
26 | from wic.utils.errors import ImageError | 27 | from wic.utils.errors import ImageError |
27 | from wic.pluginbase import SourcePlugin | 28 | from wic.pluginbase import SourcePlugin |
28 | 29 | ||
30 | def serial_console_form_kargs(kernel_args): | ||
31 | """ | ||
32 | Create SERIAL... line from kernel parameters | ||
33 | |||
34 | syslinux needs a line SERIAL port [baudrate [flowcontrol]] | ||
35 | in the syslinux.cfg file. The config line is generated based | ||
36 | on kernel boot parameters. The the parameters of the first | ||
37 | ttyS console are considered for syslinux config. | ||
38 | @param kernel_args kernel command line | ||
39 | @return line for syslinux config file e.g. "SERIAL 0 115200" | ||
40 | """ | ||
41 | syslinux_conf = "" | ||
42 | for param in kernel_args.split(): | ||
43 | param_match = re.match("console=ttyS([0-9]+),?([0-9]*)([noe]?)([0-9]?)(r?)", param) | ||
44 | if param_match: | ||
45 | syslinux_conf += "SERIAL " + param_match.group(1) | ||
46 | # baudrate | ||
47 | if param_match.group(2): | ||
48 | syslinux_conf += " " + param_match.group(2) | ||
49 | # parity | ||
50 | if param_match.group(3) and param_match.group(3) != 'n': | ||
51 | msger.warning("syslinux does not support parity for console. {} is ignored." | ||
52 | .format(param_match.group(3))) | ||
53 | # number of bits | ||
54 | if param_match.group(4) and param_match.group(4) != '8': | ||
55 | msger.warning("syslinux supports 8 bit console configuration only. {} is ignored." | ||
56 | .format(param_match.group(4))) | ||
57 | # flow control | ||
58 | if param_match.group(5) and param_match.group(5) != '': | ||
59 | msger.warning("syslinux console flowcontrol configuration. {} is ignored." | ||
60 | .format(param_match.group(5))) | ||
61 | break | ||
62 | |||
63 | return syslinux_conf | ||
64 | |||
29 | 65 | ||
30 | # pylint: disable=no-init | 66 | # pylint: disable=no-init |
31 | class RootfsPlugin(SourcePlugin): | 67 | class RootfsPlugin(SourcePlugin): |