systemd: convert to new package format, rework to enable initial systemd init support

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2013-08-04 13:56:23 +02:00
parent 16d7b5a941
commit 6457e3b365
9 changed files with 131 additions and 354 deletions

View File

@ -1,84 +0,0 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program 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, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. config/options $1
# dont build parallel
MAKEFLAGS=-j1
# TODO: use cpp directly to avoid using 'gcc -E' in Makefiles
export CPP=${TARGET_PREFIX}cpp
cd $PKG_BUILD
ac_cv_func_malloc_0_nonnull=yes \
./configure --host=$TARGET_NAME \
--build=$HOST_NAME \
--prefix=/usr \
--sysconfdir=/etc \
--libexecdir=/lib \
--localstatedir=/var \
--disable-static \
--enable-shared \
--disable-nls \
--disable-gtk-doc \
--disable-gtk-doc-html \
--disable-gtk-doc-pdf \
--disable-ima \
--disable-selinux \
--disable-xz \
--enable-kmod \
--enable-blkid \
--disable-chkconfig \
--disable-bootchart \
--disable-myhostname \
--disable-tcpwrap \
--disable-pam \
--disable-acl \
--enable-xattr \
--without-python \
--disable-gcrypt \
--disable-audit \
--disable-libcryptsetup \
--disable-qrencode \
--disable-microhttpd \
--disable-binfmt \
--disable-vconsole \
--disable-readahead \
--disable-quotacheck \
--disable-randomseed \
--disable-logind \
--disable-hostnamed \
--disable-timedated \
--disable-localed \
--disable-coredump \
--enable-gudev \
--disable-manpages \
--enable-split-usr \
--with-firmware-path="/storage/.config/firmware:/lib/firmware" \
--with-sysvinit-path="" \
--with-sysvrcnd-path="" \
--with-tty-gid="5" \
--with-rootprefix="/" \
--with-rootlibdir="/lib"
make V=1
$MAKEINSTALL

View File

@ -1,27 +0,0 @@
################################################################################
# Copyright (C) 2009-2010 OpenELEC.tv
# http://www.openelec.tv
#
# This Program 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, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
#
# creating tmpfiles
#
# runlevels: openelec, installer, textmode
progress "creating tmpfiles"
systemd-tmpfiles --create

View File

@ -1,33 +0,0 @@
################################################################################
# Copyright (C) 2009-2010 OpenELEC.tv
# http://www.openelec.tv
#
# This Program 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, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
#
# starting Udev daemon
#
# runlevels: openelec, installer, textmode
progress "starting udev daemon"
echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
if [ -d /storage/.config/udev.rules.d ] ; then
ln -sf /storage/.config/udev.rules.d /dev/rules.d
else
mkdir -p /dev/rules.d
fi
/lib/systemd/systemd-udevd --daemon

View File

@ -1,31 +0,0 @@
################################################################################
# Copyright (C) 2009-2010 OpenELEC.tv
# http://www.openelec.tv
#
# This Program 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, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
#
# monitoring udev events
#
# runlevels: openelec, installer, textmode
if [ "$DEBUG" = "yes" ]; then
(
progress "monitoring udev events"
exec udevadm monitor -e > /var/log/udev.log
)&
fi

View File

@ -1,33 +0,0 @@
################################################################################
# Copyright (C) 2009-2010 OpenELEC.tv
# http://www.openelec.tv
#
# This Program 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, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
#
# request events from the kernel
#
# runlevels: openelec, installer, textmode
progress "request udev events from the kernel (type: subsystems)"
udevadm trigger --type=subsystems --action=add
progress "request udev events from the kernel (type: devices)"
udevadm trigger --type=devices --action=add
progress "watching udev event queue from the kernel"
udevadm settle &

View File

@ -1,78 +0,0 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program 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, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. config/options $1
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
# install udev
mkdir -p $INSTALL/usr/bin
cp $PKG_BUILD/udevadm $INSTALL/usr/bin
mkdir -p $INSTALL/sbin
ln -sf /usr/bin/udevadm $INSTALL/sbin/udevadm
mkdir -p $INSTALL/lib
cp -PR $PKG_BUILD/.libs/libsystemd-daemon.so* $INSTALL/lib
cp -PR $PKG_BUILD/.libs/libudev.so* $INSTALL/lib
cp -PR $PKG_BUILD/.libs/libgudev*.so* $INSTALL/lib
rm -rf $INSTALL/lib/libgudev*.*T
mkdir -p $INSTALL/lib/systemd
cp $PKG_BUILD/systemd-udevd $INSTALL/lib/systemd
cp $PKG_BUILD/.libs/accelerometer $INSTALL/lib/udev
cp $PKG_BUILD/.libs/cdrom_id $INSTALL/lib/udev
cp $PKG_BUILD/.libs/v4l_id $INSTALL/lib/udev
for i in ata_id collect scsi_id; do
cp $PKG_BUILD/$i $INSTALL/lib/udev
done
cp $PKG_BUILD/mtd_probe $INSTALL/lib/udev
mkdir -p $INSTALL/lib/udev/rules.d
cp $PKG_BUILD/rules/*.rules $INSTALL/lib/udev/rules.d
rm -rf $INSTALL/lib/udev/rules.d/80-net-name-slot.rules
rm -rf $INSTALL/lib/udev/rules.d/99-systemd.rules
mkdir -p $INSTALL/lib/udev/hwdb.d
cp $PKG_BUILD/hwdb/*.hwdb $INSTALL/lib/udev/hwdb.d
mkdir -p $INSTALL/etc/udev
cp $PKG_BUILD/src/udev/udev.conf $INSTALL/etc/udev
ln -sf /dev/rules.d $INSTALL/etc/udev/rules.d
mkdir -p $INSTALL/usr/config
cp -R $PKG_DIR/config/*.sample $INSTALL/usr/config
# reserved for installing systemd
mkdir -p $INSTALL/bin
cp $PKG_BUILD/systemd-tmpfiles $INSTALL/bin

View File

@ -1,41 +0,0 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program 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, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
PKG_NAME="systemd"
PKG_VERSION="206"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.freedesktop.org/wiki/Software/systemd"
PKG_URL="http://www.freedesktop.org/software/systemd/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS="dbus kmod util-linux glib libgcrypt"
PKG_BUILD_DEPENDS="toolchain attr libcap dbus kmod util-linux glib libgcrypt"
PKG_PRIORITY="required"
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."
PKG_IS_ADDON="no"
PKG_AUTORECONF="yes"
# libgcrypt is needed actually only for autoreconf
PKG_DEPENDS="$PKG_DEPENDS libgcrypt"
PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libgcrypt"

View File

@ -0,0 +1,131 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program 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, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
PKG_NAME="systemd"
PKG_VERSION="206"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.freedesktop.org/wiki/Software/systemd"
PKG_URL="http://www.freedesktop.org/software/systemd/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS="dbus kmod util-linux glib libgcrypt"
PKG_BUILD_DEPENDS_TARGET="toolchain attr libcap dbus kmod util-linux glib libgcrypt"
PKG_PRIORITY="required"
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."
PKG_IS_ADDON="no"
PKG_AUTORECONF="yes"
# libgcrypt is needed actually only for autoreconf
PKG_DEPENDS="$PKG_DEPENDS libgcrypt"
PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libgcrypt"
# TODO: use cpp directly to avoid using 'gcc -E' in Makefiles
# export CPP=${TARGET_PREFIX}cpp
PKG_CONFIGURE_OPTS_TARGET="ac_cv_func_malloc_0_nonnull=yes \
--disable-nls \
--disable-gtk-doc \
--disable-gtk-doc-html \
--disable-gtk-doc-pdf \
--disable-coverage \
--enable-kmod \
--enable-blkid \
--disable-ima \
--disable-chkconfig \
--disable-selinux \
--disable-xz \
--disable-tcpwrap \
--disable-pam \
--disable-acl \
--enable-xattr \
--disable-smack \
--disable-gcrypt \
--disable-audit \
--disable-libcryptsetup \
--disable-qrencode \
--disable-microhttpd \
--disable-binfmt \
--disable-vconsole \
--disable-readahead \
--disable-bootchart \
--disable-quotacheck \
--enable-tmpfiles \
--disable-randomseed \
--enable-logind \
--disable-machined \
--enable-hostnamed \
--enable-timedated \
--disable-localed \
--disable-coredump \
--disable-polkit \
--disable-efi \
--disable-myhostname \
--enable-gudev \
--disable-manpages \
--disable-tests \
--without-python \
--enable-split-usr \
--with-firmware-path=/storage/.config/firmware:/lib/firmware \
--with-sysvinit-path= \
--with-sysvrcnd-path= \
--with-tty-gid=5 \
--with-rootprefix=/ \
--with-rootlibdir=/lib"
pre_make_target() {
# dont build parallel
MAKEFLAGS=-j1
}
post_makeinstall_target() {
# remove Network adaper renaming rule, this is confusing
rm -rf $INSTALL/lib/udev/rules.d/80-net-name-slot.rules
# remove debug-shell.service, we install our own
rm -rf $INSTALL/lib/systemd/system/debug-shell.service
# remove getty units, we dont want a console
rm -rf $INSTALL/lib/systemd/system/autovt@.service
rm -rf $INSTALL/lib/systemd/system/console-getty.service
rm -rf $INSTALL/lib/systemd/system/console-shell.service
rm -rf $INSTALL/lib/systemd/system/getty@.service
rm -rf $INSTALL/lib/systemd/system/getty.target
rm -rf $INSTALL/lib/systemd/system/multi-user.target.wants/getty.target
mkdir -p $INSTALL/usr/config
cp -R $PKG_DIR/config/*.sample $INSTALL/usr/config
}
post_install() {
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
}

View File

@ -1,27 +0,0 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program 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, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
wait_for_udevadm_settle () {
progress "Wait for udevadm settle to finish"
for i in $(seq 1 50) ; do
ps | grep -q "[u]devadm settle" || break
usleep 200000
done
}