mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-08-30 09:13:49 +00:00
Avoids the recompile of this package every time systemd is change. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
37 lines
1.2 KiB
BlitzBasic
37 lines
1.2 KiB
BlitzBasic
DESCRIPTION = "Systemd serial config"
|
|
LICENSE = "GPLv2+"
|
|
LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=751419260aa954499f7abaabaa882bbe"
|
|
|
|
SERIAL_CONSOLE ?= "115200 /dev/ttyS0"
|
|
|
|
SRC_URI = "file://LICENSE \
|
|
file://serial-getty@.service"
|
|
|
|
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/
|
|
|
|
# enable the service
|
|
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}"
|
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|