2013-08-04 13:56:23 +02:00
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
2016-01-02 17:29:56 +01:00
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
2013-08-04 13:56:23 +02:00
#
2013-12-21 21:51:48 +01:00
# OpenELEC is free software: you can redistribute it and/or modify
2013-08-04 13:56:23 +02:00
# it under the terms of the GNU General Public License as published by
2013-12-21 21:51:48 +01:00
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
2013-08-04 13:56:23 +02:00
#
2013-12-21 21:51:48 +01:00
# OpenELEC is distributed in the hope that it will be useful,
2013-08-04 13:56:23 +02:00
# but WITHOUT ANY WARRANTY; without even the implied warranty of
2013-12-21 21:51:48 +01:00
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2013-08-04 13:56:23 +02:00
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
2013-12-21 21:51:48 +01:00
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
2013-08-04 13:56:23 +02:00
################################################################################
PKG_NAME = "systemd"
2017-10-09 15:11:25 -07:00
PKG_VERSION = "235"
PKG_SHA256 = "25811f96f5a027bf2a4c9383495cf5b623e385d84da31e473cf375932b3e9c52"
2013-08-04 13:56:23 +02:00
PKG_ARCH = "any"
PKG_LICENSE = "GPL"
PKG_SITE = "http://www.freedesktop.org/wiki/Software/systemd"
2015-05-22 12:28:24 -07:00
PKG_URL = " https://github.com/systemd/systemd/archive/v $PKG_VERSION .tar.gz "
2016-02-19 11:10:09 +01:00
PKG_DEPENDS_TARGET = "toolchain libcap kmod util-linux entropy"
2013-08-04 13:56:23 +02:00
PKG_SECTION = "system"
PKG_SHORTDESC = "systemd: a system and session manager"
PKG_LONGDESC = "systemd is a system and session manager for Linux, compatible with SysV and LSB init scripts. systemd provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux cgroups, supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic. It can work as a drop-in replacement for sysvinit."
2017-10-09 15:11:25 -07:00
PKG_MESON_OPTS_TARGET = " --libdir=/usr/lib \
-Drootprefix= /usr \
-Dsplit-usr= false \
-Ddefault-hierarchy= hybrid \
-Dtty-gid= 5 \
-Dseccomp= false \
-Dselinux= false \
-Dapparmor= false \
-Dpolkit= false \
-Dacl= false \
-Daudit= false \
-Dblkid= true \
-Dkmod= true \
-Dpam= false \
-Dmicrohttpd= false \
-Dlibcryptsetup= false \
-Dlibcurl= false \
-Dlibidn= false \
-Dlibidn2= false \
-Dlibiptc= false \
-Dqrencode= false \
-Dgcrypt= false \
-Dgnutls= false \
-Delfutils= false \
-Dzlib= false \
-Dbzip2= false \
-Dxz= false \
-Dlz4= false \
-Dxkbcommon= false \
-Dglib= false \
-Ddbus= false \
-Ddefault-dnssec= no \
-Dimportd= false \
-Dremote= false \
-Dutmp= false \
-Dhibernate= false \
-Denvironment-d= false \
-Dbinfmt= false \
-Dcoredump= false \
-Dresolve= false \
-Dlogind= true \
-Dhostnamed= false \
-Dlocaled= false \
-Dmachined= false \
-Dnetworkd= false \
-Dtimedated= false \
-Dtimesyncd= false \
-Dmyhostname= false \
-Dfirstboot= false \
-Drandomseed= false \
-Dbacklight= false \
-Dvconsole= false \
-Dquotacheck= false \
-Dsysusers= false \
-Dtmpfiles= true \
-Dhwdb= true \
-Drfkill= false \
-Dldconfig= false \
-Defi= false \
-Dtpm= false \
-Dima= false \
-Dsmack= false \
-Dgshadow= false \
-Didn= false \
-Dnss-systemd= false \
-Dman= false \
-Dhtml= false \
-Dbashcompletiondir= no \
-Dzshcompletiondir= no \
-Dkill-path= /usr/bin/kill \
-Dkmod-path= /usr/bin/kmod \
-Dmount-path= /usr/bin/mount \
-Dumount-path= /usr/bin/umount"
2015-05-22 12:28:24 -07:00
2015-10-06 11:50:12 -07:00
p r e _ c o n f i g u r e _ t a r g e t ( ) {
export CFLAGS = " $CFLAGS -fno-schedule-insns -fno-schedule-insns2 "
2017-10-09 15:11:25 -07:00
export LC_ALL = en_US.UTF-8
# meson needs a host compiler and it's detected through the environment. meh.
export CC = " $HOST_CC "
export CXX = " $HOST_CXX "
2015-10-06 11:50:12 -07:00
}
2013-08-04 13:56:23 +02:00
p o s t _ m a k e i n s t a l l _ t a r g e t ( ) {
2013-08-13 01:28:32 +02:00
# remove unneeded stuff
2017-10-09 15:11:25 -07:00
rm -rf $INSTALL /etc/init.d
rm -rf $INSTALL /etc/pam.d
2015-01-11 20:27:08 +02:00
rm -rf $INSTALL /etc/systemd/system
rm -rf $INSTALL /etc/xdg
2015-05-22 12:28:24 -07:00
rm -rf $INSTALL /etc/X11
2015-01-11 20:27:08 +02:00
rm -f $INSTALL /usr/bin/kernel-install
rm -rf $INSTALL /usr/lib/kernel/install.d
rm -rf $INSTALL /usr/lib/rpm
rm -rf $INSTALL /usr/lib/systemd/user
rm -rf $INSTALL /usr/lib/tmpfiles.d/etc.conf
2015-05-22 12:28:24 -07:00
rm -rf $INSTALL /usr/lib/tmpfiles.d/home.conf
2015-01-11 20:27:08 +02:00
rm -rf $INSTALL /usr/share/factory
rm -rf $INSTALL /usr/share/zsh
2013-08-13 01:28:32 +02:00
2015-01-11 20:27:08 +02:00
# clean up hwdb
rm -f $INSTALL /usr/lib/udev/hwdb.d/20-OUI.hwdb
rm -f $INSTALL /usr/lib/udev/hwdb.d/20-acpi-vendor.hwdb
rm -f $INSTALL /usr/lib/udev/hwdb.d/20-bluetooth-vendor-product.hwdb
rm -f $INSTALL /usr/lib/udev/hwdb.d/20-net-ifname.hwdb
rm -f $INSTALL /usr/lib/udev/hwdb.d/20-sdio-classes.hwdb
rm -f $INSTALL /usr/lib/udev/hwdb.d/20-sdio-vendor-model.hwdb
2013-08-04 15:38:57 +02:00
2013-08-04 13:56:23 +02:00
# remove Network adaper renaming rule, this is confusing
2015-01-11 20:27:08 +02:00
rm -rf $INSTALL /usr/lib/udev/rules.d/80-net-setup-link.rules
2013-08-04 13:56:23 +02:00
2017-07-16 22:32:27 +01:00
# remove the uaccess rules as we don't build systemd with ACL (see https://github.com/systemd/systemd/issues/4107)
rm -rf $INSTALL /usr/lib/udev/rules.d/70-uaccess.rules
rm -rf $INSTALL /usr/lib/udev/rules.d/71-seat.rules
rm -rf $INSTALL /usr/lib/udev/rules.d/73-seat-late.rules
2013-08-04 13:56:23 +02:00
# remove debug-shell.service, we install our own
2015-01-11 20:27:08 +02:00
rm -rf $INSTALL /usr/lib/systemd/system/debug-shell.service
2013-08-04 13:56:23 +02:00
# remove getty units, we dont want a console
2015-01-11 20:27:08 +02:00
rm -rf $INSTALL /usr/lib/systemd/system/autovt@.service
rm -rf $INSTALL /usr/lib/systemd/system/console-getty.service
rm -rf $INSTALL /usr/lib/systemd/system/console-shell.service
rm -rf $INSTALL /usr/lib/systemd/system/container-getty@.service
rm -rf $INSTALL /usr/lib/systemd/system/getty.target
rm -rf $INSTALL /usr/lib/systemd/system/getty@.service
rm -rf $INSTALL /usr/lib/systemd/system/serial-getty@.service
rm -rf $INSTALL /usr/lib/systemd/system/*.target.wants/getty.target
2013-08-04 13:56:23 +02:00
2014-07-04 15:44:53 +03:00
# remove other notused or nonsense stuff (our /etc is ro)
2015-01-11 20:27:08 +02:00
rm -rf $INSTALL /usr/lib/systemd/systemd-update-done
rm -rf $INSTALL /usr/lib/systemd/system/systemd-update-done.service
rm -rf $INSTALL /usr/lib/systemd/system/*.target.wants/systemd-update-done.service
2014-07-04 15:44:53 +03:00
2015-01-11 20:27:08 +02:00
# remove systemd-udev-hwdb-update. we have own hwdb.service
rm -rf $INSTALL /usr/lib/systemd/system/systemd-udev-hwdb-update.service
rm -rf $INSTALL /usr/lib/systemd/system/*.target.wants/systemd-udev-hwdb-update.service
2014-08-20 20:24:27 +03:00
2017-10-09 15:11:25 -07:00
# remove systemd-user-sessions
rm -rf $INSTALL /usr/lib/systemd/system/systemd-user-sessions.service
rm -rf $INSTALL /usr/lib/systemd/system/*.target.wants/systemd-user-sessions.service
2015-01-11 20:27:08 +02:00
# remove nspawn
rm -rf $INSTALL /usr/bin/systemd-nspawn
rm -rf $INSTALL /usr/lib/systemd/system/systemd-nspawn@.service
# remove genetators/catalog
rm -rf $INSTALL /usr/lib/systemd/system-generators
rm -rf $INSTALL /usr/lib/systemd/catalog
2016-05-22 20:15:23 +01:00
# distro preset policy
rm -f $INSTALL /usr/lib/systemd/system-preset/*
echo "disable *" > $INSTALL /usr/lib/systemd/system-preset/99-default.preset
2015-01-11 20:27:08 +02:00
# remove networkd
rm -rf $INSTALL /usr/lib/systemd/network
# tune journald.conf
sed -e " s,^.*Compress=.* $,Compress=no,g " -i $INSTALL /etc/systemd/journald.conf
sed -e " s,^.*SplitMode=.* $,SplitMode=none,g " -i $INSTALL /etc/systemd/journald.conf
sed -e " s,^.*RuntimeMaxUse=.* $,RuntimeMaxUse=2M,g " -i $INSTALL /etc/systemd/journald.conf
sed -e " s,^.*RuntimeMaxFileSize=.* $,RuntimeMaxFileSize=128K,g " -i $INSTALL /etc/systemd/journald.conf
sed -e " s,^.*SystemMaxUse=.* $,SystemMaxUse=10M,g " -i $INSTALL /etc/systemd/journald.conf
# tune logind.conf
sed -e " s,^.*HandleLidSwitch=.* $,HandleLidSwitch=ignore,g " -i $INSTALL /etc/systemd/logind.conf
# replace systemd-machine-id-setup with ours
rm -rf $INSTALL /usr/lib/systemd/systemd-machine-id-commit
rm -rf $INSTALL /usr/lib/systemd/system/systemd-machine-id-commit.service
2015-01-12 11:41:16 +02:00
rm -rf $INSTALL /usr/lib/systemd/system/*.target.wants/systemd-machine-id-commit.service
2015-01-11 20:27:08 +02:00
rm -rf $INSTALL /usr/bin/systemd-machine-id-setup
mkdir -p $INSTALL /usr/bin
cp $PKG_DIR /scripts/systemd-machine-id-setup $INSTALL /usr/bin
2017-03-23 18:59:11 +00:00
cp $PKG_DIR /scripts/userconfig-setup $INSTALL /usr/bin
2015-01-11 20:27:08 +02:00
mkdir -p $INSTALL /usr/sbin
2017-09-05 09:17:30 +02:00
cp $PKG_DIR /scripts/kernel-overlays-setup $INSTALL /usr/sbin
# provide 'halt', 'shutdown', 'reboot' & co.
2015-01-11 20:27:08 +02:00
ln -sf /usr/bin/systemctl $INSTALL /usr/sbin/halt
ln -sf /usr/bin/systemctl $INSTALL /usr/sbin/poweroff
ln -sf /usr/bin/systemctl $INSTALL /usr/sbin/reboot
ln -sf /usr/bin/systemctl $INSTALL /usr/sbin/runlevel
ln -sf /usr/bin/systemctl $INSTALL /usr/sbin/shutdown
ln -sf /usr/bin/systemctl $INSTALL /usr/sbin/telinit
2013-08-05 20:11:52 +02:00
2016-01-31 00:22:08 +01:00
# strip
debug_strip $INSTALL /usr
# defaults
2013-08-04 13:56:23 +02:00
mkdir -p $INSTALL /usr/config
2015-01-11 20:27:08 +02:00
cp -PR $PKG_DIR /config/* $INSTALL /usr/config
2013-08-13 01:28:32 +02:00
2015-01-11 20:27:08 +02:00
rm -rf $INSTALL /etc/modules-load.d
ln -sf /storage/.config/modules-load.d $INSTALL /etc/modules-load.d
rm -rf $INSTALL /etc/sysctl.d
ln -sf /storage/.config/sysctl.d $INSTALL /etc/sysctl.d
rm -rf $INSTALL /etc/tmpfiles.d
ln -sf /storage/.config/tmpfiles.d $INSTALL /etc/tmpfiles.d
rm -rf $INSTALL /etc/udev/hwdb.d
ln -sf /storage/.config/hwdb.d $INSTALL /etc/udev/hwdb.d
rm -rf $INSTALL /etc/udev/rules.d
ln -sf /storage/.config/udev.rules.d $INSTALL /etc/udev/rules.d
2013-08-04 13:56:23 +02:00
}
p o s t _ i n s t a l l ( ) {
2013-08-27 12:31:17 +02:00
add_group systemd-journal 190
2014-06-12 19:10:28 +03:00
add_group systemd-network 193
add_user systemd-network x 193 193 "systemd-network" "/" "/bin/sh"
2013-08-04 13:56:23 +02:00
add_group audio 63
add_group cdrom 11
add_group dialout 18
add_group disk 6
add_group floppy 19
add_group kmem 9
add_group lp 7
add_group tape 33
add_group tty 5
add_group video 39
add_group utmp 22
2015-04-07 11:34:08 +03:00
add_group input 199
2013-08-08 03:43:08 +02:00
enable_service machine-id.service
2013-08-11 00:25:22 +02:00
enable_service debugconfig.service
2013-08-08 04:00:57 +02:00
enable_service userconfig.service
2017-09-05 09:17:30 +02:00
enable_service kernel-overlays.service
2013-10-22 21:10:16 +03:00
enable_service hwdb.service
2013-08-04 13:56:23 +02:00
}