sysmobts-config: Add script with postinst hook

Add post install script that will mangle the config to be the
right one for the given machine. This will be executed once
after the post installation. In case of the getty change the
system must re-start once to be fully usable. E.g. for the
sysmoBTS2050 the PA might not be powered up on first boot.
This commit is contained in:
Holger Hans Peter Freyther 2014-08-28 17:48:15 +02:00
parent ec3635eed8
commit fbf5089510
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#!/bin/bash
prepare_sysmobts_2050() {
# Disable getty and mangle the config
/bin/systemctl mask serial-getty@ttyS0.service
# We need to mange the systemd config file
sed -i s,#LogTarget=journal-or-kmsg,LogTarget=null, /etc/systemd/system.conf
sed -i s,#ShowStatus=yes,ShowStatus=no, /etc/systemd/system.conf
sed -i s,#DefaultStandardOutput=journal,DefaultStandardOutput=syslog, /etc/systemd/system.conf
sed -i s,#DefaultStandardError=inherit,DefaultStandardError=syslog, /etc/systemd/system.conf
}
#
MODEL=`/usr/bin/sysmobts-util -r model-nr`
if [ $MODEL -eq "2050" ];
then
echo "Going to fix the configuration for sysmobts-2050"
prepare_sysmobts_2050
fi

View File

@ -0,0 +1,21 @@
DESCRIPTION = "Script to mangle the configuration"
SECTION = "core"
LICENSE = "CLOSED"
SRC_URI = "file://sysmobts-post-install-config"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/sysmobts-post-install-config ${D}${bindir}/
}
pkg_postinst_${PN} () {
if test "x$D" != "x"; then
exit 1
else
echo "Going to run device specific post configuration"
/usr/bin/sysmobts-post-install-config
fi
}
PACKAGE_ARCH = "all"