From 8a12ecca32766ecdceb72cae76e93f8aadcf3669 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 28 Jun 2011 16:21:44 +0200 Subject: systemd: move machine specific package out to a new recipe Signed-off-by: Koen Kooi --- .../recipes-core/systemd/systemd-serialgetty.bb | 43 ++++++++++++++++++++++ .../systemd-serialgetty/serial-getty@.service | 28 ++++++++++++++ .../systemd/systemd/serial-getty@.service | 28 -------------- meta-oe/recipes-core/systemd/systemd_git.bb | 26 +------------ 4 files changed, 73 insertions(+), 52 deletions(-) create mode 100644 meta-oe/recipes-core/systemd/systemd-serialgetty.bb create mode 100644 meta-oe/recipes-core/systemd/systemd-serialgetty/serial-getty@.service delete mode 100644 meta-oe/recipes-core/systemd/systemd/serial-getty@.service diff --git a/meta-oe/recipes-core/systemd/systemd-serialgetty.bb b/meta-oe/recipes-core/systemd/systemd-serialgetty.bb new file mode 100644 index 0000000000..acc6768370 --- /dev/null +++ b/meta-oe/recipes-core/systemd/systemd-serialgetty.bb @@ -0,0 +1,43 @@ +require systemd_git.bb + +SRC_URI = "git://anongit.freedesktop.org/systemd;protocol=git \ + file://serial-getty@.service \ + " + +DESCRIPTION = "Systemd serial config" +SERIAL_CONSOLE ?= "115200 /dev/ttyS0" + +do_configure() { + : +} + +do_compile() { + : +} + +def get_baudrate(bb, d): + return bb.data.getVar('SERIAL_CONSOLE', d, 1).split()[0] + +def get_console(bb, d): + return bb.data.getVar('SERIAL_CONSOLE', d, 1).split()[1] + +do_install() { + if [ ! ${@get_baudrate(bb, d)} = "" ]; then + sed -i -e s/\@BAUDRATE\@/${@get_baudrate(bb, d)}/g ${WORKDIR}/serial-getty@.service + install -d ${D}${base_libdir}/systemd/system/ + install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/ + install ${WORKDIR}/serial-getty@.service ${D}${base_libdir}/systemd/system/ + ln -sf ${base_libdir}/systemd/system/serial-getty@.service \ + ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@${@get_console(bb, d)}.service + fi +} + +PACKAGES = "{$PN} ${PN}-dbg ${PN}-dev ${PN}-doc" + +RRECOMMENDS_${PN} = "" +RDEPENDS_${PN} = "systemd" + +# This is a machine specific file +FILES_${PN} = "${base_libdir}/systemd/system/serial-getty@.service ${sysconfdir}/systemd/system/getty.target.wants/getty@${@get_console(bb, d)}.service" +PACKAGE_ARCH = "${MACHINE_ARCH}" + diff --git a/meta-oe/recipes-core/systemd/systemd-serialgetty/serial-getty@.service b/meta-oe/recipes-core/systemd/systemd-serialgetty/serial-getty@.service new file mode 100644 index 0000000000..daf0dac723 --- /dev/null +++ b/meta-oe/recipes-core/systemd/systemd-serialgetty/serial-getty@.service @@ -0,0 +1,28 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +[Unit] +Description=Serial Getty on %I +BindTo=dev-%i.device +After=dev-%i.device systemd-user-sessions.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target + +[Service] +Environment=TERM=vt100 +ExecStart=-/sbin/getty @BAUDRATE@ %I +Restart=always +RestartSec=0 +UtmpIdentifier=%I +KillMode=process + +# Some login implementations ignore SIGTERM, so we send SIGHUP +# instead, to ensure that login terminates cleanly. +KillSignal=SIGHUP diff --git a/meta-oe/recipes-core/systemd/systemd/serial-getty@.service b/meta-oe/recipes-core/systemd/systemd/serial-getty@.service deleted file mode 100644 index daf0dac723..0000000000 --- a/meta-oe/recipes-core/systemd/systemd/serial-getty@.service +++ /dev/null @@ -1,28 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -[Unit] -Description=Serial Getty on %I -BindTo=dev-%i.device -After=dev-%i.device systemd-user-sessions.service - -# If additional gettys are spawned during boot then we should make -# sure that this is synchronized before getty.target, even though -# getty.target didn't actually pull it in. -Before=getty.target - -[Service] -Environment=TERM=vt100 -ExecStart=-/sbin/getty @BAUDRATE@ %I -Restart=always -RestartSec=0 -UtmpIdentifier=%I -KillMode=process - -# Some login implementations ignore SIGTERM, so we send SIGHUP -# instead, to ensure that login terminates cleanly. -KillSignal=SIGHUP diff --git a/meta-oe/recipes-core/systemd/systemd_git.bb b/meta-oe/recipes-core/systemd/systemd_git.bb index dff299ee03..465a7f6dcc 100644 --- a/meta-oe/recipes-core/systemd/systemd_git.bb +++ b/meta-oe/recipes-core/systemd/systemd_git.bb @@ -23,7 +23,6 @@ SRCREV = "ae556c210942cb6986c6d77b58505b5daa66bbe2" SRC_URI = "git://anongit.freedesktop.org/systemd;protocol=git \ file://0001-systemd-disable-xml-file-stuff-and-introspection.patch \ - file://serial-getty@.service \ " S = "${WORKDIR}/git" @@ -38,37 +37,16 @@ EXTRA_OECONF = " --with-distro=${SYSTEMDDISTRO} \ --disable-gtk \ " -def get_baudrate(bb, d): - return bb.data.getVar('SERIAL_CONSOLE', d, 1).split()[0] - -def get_console(bb, d): - return bb.data.getVar('SERIAL_CONSOLE', d, 1).split()[1] - -do_install() { - autotools_do_install - - if [ ! ${@get_baudrate(bb, d)} = "" ]; then - sed -i -e s/\@BAUDRATE\@/${@get_baudrate(bb, d)}/g ${WORKDIR}/serial-getty@.service - install ${WORKDIR}/serial-getty@.service ${D}${base_libdir}/systemd/system/ - ln -sf ${base_libdir}/systemd/system/serial-getty@.service \ - ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@${@get_console(bb, d)}.service - fi -} - # ARM doesn't support hugepages, so don't try to mount them do_install_append_arm() { rm -f ${D}${base_libdir}/systemd/system/*hugepages.mount rm -f ${D}${base_libdir}/systemd/system/*/*hugepages.mount } -PACKAGES =+ "${PN}-gui ${PN}-serialgetty" +PACKAGES =+ "${PN}-gui" FILES_${PN}-gui = "${bindir}/systemadm" -# This is a machine specific file -FILES_${PN}-serialgetty = "${base_libdir}/systemd/system/serial-getty@.service ${sysconfdir}/systemd/system/getty.target.wants/getty@${@get_console(bb, d)}.service" -PACKAGE_ARCH_${PN}-serialgetty = "${MACHINE_ARCH}" - FILES_${PN} = " ${base_bindir}/* \ ${datadir}/dbus-1/services \ ${datadir}/dbus-1/system-services \ @@ -94,7 +72,7 @@ RDEPENDS_${PN} += "dbus-systemd udev-systemd" # of blacklist support, so use proper modprobe from module-init-tools # And pull in the kernel modules mentioned in INSTALL RRECOMMENDS_${PN} += "kbd kbd-consolefonts \ - ${PN}-serialgetty \ + systemd-serialgetty \ util-linux-agetty \ module-init-tools \ kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \ -- cgit 1.2.3-korg