systemd: Get rescue.service and emergency.service to work

This commit is contained in:
Eelco Dolstra 2013-01-08 18:11:56 +01:00
parent 30201193ea
commit cdb2f64a35
2 changed files with 12 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, pkgconfig, intltool, gperf, libcap, dbus, kmod
, xz, pam, acl, cryptsetup, libuuid, m4, utillinux
, glib, kbd, libxslt, coreutils, libgcrypt
, glib, kbd, libxslt, coreutils, libgcrypt, sysvtools
}:
assert stdenv.gcc.libc or null != null;
@ -42,14 +42,17 @@ stdenv.mkDerivation rec {
preConfigure =
''
# FIXME: patch this in systemd properly (and send upstream).
for i in src/remount-fs/remount-fs.c src/core/mount.c src/core/swap.c src/fsck/fsck.c; do
# FIXME: use sulogin from util-linux once updated.
for i in src/remount-fs/remount-fs.c src/core/mount.c src/core/swap.c src/fsck/fsck.c units/emergency.service.in units/rescue.service.m4.in; do
test -e $i
substituteInPlace $i \
--replace /bin/mount ${utillinux}/bin/mount \
--replace /bin/umount ${utillinux}/bin/umount \
--replace /sbin/swapon ${utillinux}/sbin/swapon \
--replace /sbin/swapoff ${utillinux}/sbin/swapoff \
--replace /sbin/fsck ${utillinux}/sbin/fsck
--replace /sbin/fsck ${utillinux}/sbin/fsck \
--replace /bin/echo ${coreutils}/bin/echo \
--replace /sbin/sulogin ${sysvtools}/sbin/sulogin
done
substituteInPlace src/journal/catalog.c \

View File

@ -4,12 +4,12 @@ let version = "2.88dsf"; in
stdenv.mkDerivation {
name = (if withoutInitTools then "sysvtools" else "sysvinit") + "-" + version;
src = fetchurl {
url = "mirror://savannah/sysvinit/sysvinit-${version}.tar.bz2";
sha256 = "068mvzaz808a673zigyaqb63xc8bndh2klk16zi5c83rw70wifv0";
};
prePatch = ''
# Patch some minimal hard references, so halt/shutdown work
sed -i -e "s,/sbin/,$out/sbin/," src/halt.c src/init.c src/paths.h
@ -27,16 +27,17 @@ stdenv.mkDerivation {
'';
postInstall = stdenv.lib.optionalString withoutInitTools
''
''
mv $out/sbin/killall5 $out/bin
ln -sf killall5 $out/bin/pidof
rm -rf $out/sbin
shopt -s extglob
rm -rf $out/sbin/!(sulogin)
rm -rf $out/include
rm -rf $out/share/man/man5
rm $(for i in $out/share/man/man8/*; do echo $i; done | grep -v 'pidof\|killall5')
rm $out/bin/{mountpoint,wall} $out/share/man/man1/{mountpoint.1,wall.1}
'';
meta = {
homepage = http://www.nongnu.org/sysvinit/;
description = "Utilities related to booting and shutdown";