diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd-serialgetty.bb')
-rw-r--r-- | meta/recipes-core/systemd/systemd-serialgetty.bb | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/meta/recipes-core/systemd/systemd-serialgetty.bb b/meta/recipes-core/systemd/systemd-serialgetty.bb index 44a93ac684..c3fe9d5b6d 100644 --- a/meta/recipes-core/systemd/systemd-serialgetty.bb +++ b/meta/recipes-core/systemd/systemd-serialgetty.bb | |||
@@ -1,15 +1,13 @@ | |||
1 | SUMMARY = "Serial terminal support for systemd" | 1 | SUMMARY = "Serial terminal support for systemd (using SERIAL_CONSOLES)" |
2 | HOMEPAGE = "https://www.freedesktop.org/wiki/Software/systemd/" | 2 | HOMEPAGE = "https://www.freedesktop.org/wiki/Software/systemd/" |
3 | LICENSE = "GPL-2.0-or-later" | 3 | LICENSE = "GPL-2.0-or-later" |
4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" | 4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" |
5 | 5 | ||
6 | 6 | # Note that this recipe explicitly creates a serial-getty@ service for every tty | |
7 | SERIAL_CONSOLES ?= "115200;ttyS0" | 7 | # in SERIAL_CONSOLES. This is typically not always needed with systemd as it |
8 | SERIAL_TERM ?= "linux" | 8 | # will probe at boot and generate getty instances for any active consoles as |
9 | 9 | # required. This recipe (enabled via disabling serial-getty-generator in systemd) | |
10 | SRC_URI = "file://serial-getty@.service" | 10 | # should only be used if the generator is not appropriate. |
11 | |||
12 | S = "${WORKDIR}" | ||
13 | 11 | ||
14 | # As this package is tied to systemd, only build it when we're also building systemd. | 12 | # As this package is tied to systemd, only build it when we're also building systemd. |
15 | inherit features_check | 13 | inherit features_check |
@@ -19,11 +17,7 @@ REQUIRED_DISTRO_FEATURES += "usrmerge" | |||
19 | do_install() { | 17 | do_install() { |
20 | if [ ! -z "${SERIAL_CONSOLES}" ] ; then | 18 | if [ ! -z "${SERIAL_CONSOLES}" ] ; then |
21 | default_baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'` | 19 | default_baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'` |
22 | install -d ${D}${systemd_system_unitdir}/ | ||
23 | install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/ | 20 | install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/ |
24 | install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_system_unitdir}/ | ||
25 | sed -i -e "s/\@BAUDRATE\@/$default_baudrate/g" ${D}${systemd_system_unitdir}/serial-getty@.service | ||
26 | sed -i -e "s/\@TERM\@/${SERIAL_TERM}/g" ${D}${systemd_system_unitdir}/serial-getty@.service | ||
27 | 21 | ||
28 | tmp="${SERIAL_CONSOLES}" | 22 | tmp="${SERIAL_CONSOLES}" |
29 | for entry in $tmp ; do | 23 | for entry in $tmp ; do |
@@ -35,7 +29,7 @@ do_install() { | |||
35 | ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@$ttydev.service | 29 | ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@$ttydev.service |
36 | else | 30 | else |
37 | # install custom service file for the non-default baudrate | 31 | # install custom service file for the non-default baudrate |
38 | install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_system_unitdir}/serial-getty$baudrate@.service | 32 | install -m 0644 ${S}/serial-getty@.service ${D}${systemd_system_unitdir}/serial-getty$baudrate@.service |
39 | sed -i -e "s/\@BAUDRATE\@/$baudrate/g" ${D}${systemd_system_unitdir}/serial-getty$baudrate@.service | 33 | sed -i -e "s/\@BAUDRATE\@/$baudrate/g" ${D}${systemd_system_unitdir}/serial-getty$baudrate@.service |
40 | # enable the service | 34 | # enable the service |
41 | ln -sf ${systemd_system_unitdir}/serial-getty$baudrate@.service \ | 35 | ln -sf ${systemd_system_unitdir}/serial-getty$baudrate@.service \ |
@@ -46,7 +40,7 @@ do_install() { | |||
46 | } | 40 | } |
47 | 41 | ||
48 | # This is a machine specific file | 42 | # This is a machine specific file |
49 | FILES:${PN} = "${systemd_system_unitdir}/*.service ${sysconfdir}" | ||
50 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 43 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
44 | FILES:${PN} = "${sysconfdir}" | ||
51 | 45 | ||
52 | ALLOW_EMPTY:${PN} = "1" | 46 | ALLOW_EMPTY:${PN} = "1" |