75. systemd

wget http://www.gnuwakes.org/depot/1.0/main/sources/systemd-219.tar.xz

tar -xf systemd-219.tar.xz

wget http://www.gnuwakes.org/depot/1.0/main/sources/systemd.patch
cd systemd-219
patch -p1 < ../systemd.patch 
cd ..

SOURCES_DIR=$PWD/systemd-219
INSTALL_DIR=$PWD/systemd-219-install
BUILD_DIR=$PWD/systemd-219-build

mkdir $INSTALL_DIR $BUILD_DIR
cd $BUILD_DIR

set -e

$SOURCES_DIR/configure                                    \
  --prefix=/usr                                           \
  --sysconfdir=/etc                                       \
  --localstatedir=/var                                    \
  --with-rootprefix=                                      \
  --with-rootlibdir=/lib                                  \
  --enable-split-usr                                      \
  --disable-gudev                                         \
  --disable-firstboot                                     \
  --disable-ldconfig                                      \
  --disable-sysusers                                      \
  --without-python                                        \
  --docdir=/usr/share/doc/systemd-219                     \
  --with-dbuspolicydir=/etc/dbus-1/system.d               \
  --with-dbussessionservicedir=/usr/share/dbus-1/services \
  --with-dbussystemservicedir=/usr/share/dbus-1/system-services && \
  make && make DESTDIR=$INSTALL_DIR install

mv -v $INSTALL_DIR/usr/lib/libnss_{myhostname,mymachines,resolve}.so.2 \
  $INSTALL_DIR/lib

rm -rfv $INSTALL_DIR/usr/lib/rpm

mkdir -v $INSTALL_DIR/sbin
for tool in runlevel reboot shutdown poweroff halt telinit
do
  ln -sfv /bin/systemctl $INSTALL_DIR/sbin/${tool}
done
ln -sfv /lib/systemd/systemd $INSTALL_DIR/sbin/init

sed -i "s:0775 root lock:0755 root root:g" \
  $INSTALL_DIR/usr/lib/tmpfiles.d/legacy.conf
sed -i "/pam.d/d" $INSTALL_DIR/usr/lib/tmpfiles.d/etc.conf

# needed by systemd to boot
mkdir -v $INSTALL_DIR/run
# systemd requires that the /run mount point exists. systemd also
# requires that /var/run is a a symlink to /run.
ln -vs /run $INSTALL_DIR/var/run

# disable screen clearing
mkdir -pv $INSTALL_DIR/etc/systemd/system/getty@tty1.service.d
cat > $INSTALL_DIR/etc/systemd/system/getty@tty1.service.d/noclear.conf << EOF
[Service]
TTYVTDisallocate=no
EOF

# disable console errors in fsck
for f in $INSTALL_DIR/lib/systemd/system/systemd-fsck@.service \
  $INSTALL_DIR/lib/systemd/system/systemd-fsck-root.service
do
  sed -i '/^StandardOutput=/s/^.*$/StandardOutput=journal/' $f
done