Date: Tuesday, February 25, 2014 @ 16:27:59 Author: dreisner Revision: 206417
upgpkg: systemd 210-1 - purge obsolete per-version upgrade logic - fix sd_booted function - ship systemd-networkd as disabled (conditionally enable for 209 users) - print warning about need to reboot for upgrade from 208-* Modified: systemd/trunk/PKGBUILD systemd/trunk/systemd.install Deleted: systemd/trunk/0001-sd-event-Fix-systemd-crash-when-using-timer-units.patch --------------------------------------------------------------+ 0001-sd-event-Fix-systemd-crash-when-using-timer-units.patch | 30 --- PKGBUILD | 29 --- systemd.install | 91 +++------- 3 files changed, 43 insertions(+), 107 deletions(-) Deleted: 0001-sd-event-Fix-systemd-crash-when-using-timer-units.patch =================================================================== --- 0001-sd-event-Fix-systemd-crash-when-using-timer-units.patch 2014-02-25 15:19:35 UTC (rev 206416) +++ 0001-sd-event-Fix-systemd-crash-when-using-timer-units.patch 2014-02-25 15:27:59 UTC (rev 206417) @@ -1,30 +0,0 @@ -From 9ac441c0f40a10a6c498398e5876a5256b833e31 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Thomas=20B=C3=A4chler?= <tho...@archlinux.org> -Date: Fri, 21 Feb 2014 11:20:24 +0100 -Subject: [PATCH] sd-event: Fix systemd crash when using timer units. - -There was a copy-paste error introduced in commit c2ba3ad6604ef2e189d7e0a36d6911116e84d3ab -which causes the following error when using timer units: - -Assertion '(x->type == SOURCE_MONOTONIC && y->type == SOURCE_MONOTONIC) || (x->type == SOURCE_REALTIME && y->type == SOURCE_REALTIME)' -failed at src/libsystemd/sd-event/sd-event.c:264, function latest_time_prioq_compare(). Aborting. ---- - src/libsystemd/sd-event/sd-event.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c -index 25dfd17..1f039bc 100644 ---- a/src/libsystemd/sd-event/sd-event.c -+++ b/src/libsystemd/sd-event/sd-event.c -@@ -771,7 +771,7 @@ _public_ int sd_event_add_realtime(sd_event *e, - sd_event_time_handler_t callback, - void *userdata) { - -- return event_add_time_internal(e, ret, SOURCE_REALTIME, &e->realtime_fd, CLOCK_REALTIME, &e->realtime_earliest, &e->monotonic_latest, usec, accuracy, callback, userdata); -+ return event_add_time_internal(e, ret, SOURCE_REALTIME, &e->realtime_fd, CLOCK_REALTIME, &e->realtime_earliest, &e->realtime_latest, usec, accuracy, callback, userdata); - } - - static int event_update_signal_fd(sd_event *e) { --- -1.9.0 - Modified: PKGBUILD =================================================================== --- PKGBUILD 2014-02-25 15:19:35 UTC (rev 206416) +++ PKGBUILD 2014-02-25 15:27:59 UTC (rev 206417) @@ -3,8 +3,8 @@ pkgbase=systemd pkgname=('systemd' 'systemd-sysvcompat') -pkgver=209 -pkgrel=3 +pkgver=210 +pkgrel=1 arch=('i686' 'x86_64') url="http://www.freedesktop.org/wiki/Software/systemd" makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gobject-introspection' 'gperf' @@ -12,22 +12,14 @@ 'linux-api-headers' 'pam' 'python' 'python-lxml' 'quota-tools' 'xz') options=('strip' 'debug') source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz" - '0001-sd-event-Fix-systemd-crash-when-using-timer-units.patch' 'initcpio-hook-udev' 'initcpio-install-systemd' 'initcpio-install-udev') -md5sums=('2c7a7c8ffede079a3e1b241565bd4ed7' - 'bd3f3d91daf425bf76e55682a7274622' +md5sums=('03efddf8c9eca36d4d590f9967e7e818' '29245f7a240bfba66e2b1783b63b6b40' '8b68b0218a3897d4d37a6ccf47914774' 'bde43090d4ac0ef048e3eaee8202a407') -prepare() { - cd "$pkgname-$pkgver" - - patch -Np1 <../0001-sd-event-Fix-systemd-crash-when-using-timer-units.patch -} - build() { cd "$pkgname-$pkgver" @@ -84,11 +76,10 @@ make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install - # don't write units to /etc by default -- we'll enable this on post_install - # as a sane default - # TODO(dreisner): handle systemd-networkd in the same way in 210 since it'll - # have the same "auto opt-in" behavior. + # don't write units to /etc by default -- we'll enable the getty on + # post_install as a sane default. rm "$pkgdir/etc/systemd/system/getty.target.wants/getty@tty1.service" + rm "$pkgdir/etc/systemd/system/multi-user.target.wants/systemd-networkd.service" rmdir "$pkgdir/etc/systemd/system/getty.target.wants" # get rid of RPM macros @@ -107,13 +98,9 @@ install -Dm644 "$srcdir/initcpio-install-udev" "$pkgdir/usr/lib/initcpio/install/udev" install -Dm644 "$srcdir/initcpio-hook-udev" "$pkgdir/usr/lib/initcpio/hooks/udev" - # BUG(dreisner): v209 doesn't ship /var/log/journal, but this is fixed - # upstream. carry the "patch" in the PKGBUILD rather than patching the - # buildsys and autoreconf'ing. - install -o root -g systemd-journal -dm2755 "$pkgdir/var/log/journal" # ensure proper permissions for /var/log/journal - # chown root:systemd-journal "$pkgdir/var/log/journal" - # chmod 2755 "$pkgdir/var/log/journal" + chown root:systemd-journal "$pkgdir/var/log/journal" + chmod 2755 "$pkgdir/var/log/journal" # fix pam file sed 's|system-auth|system-login|g' -i "$pkgdir/etc/pam.d/systemd-user" Modified: systemd.install =================================================================== --- systemd.install 2014-02-25 15:19:35 UTC (rev 206416) +++ systemd.install 2014-02-25 15:27:59 UTC (rev 206417) @@ -1,7 +1,7 @@ #!/bin/sh sd_booted() { - [[ -d /run/systemd/systemd/ ]] + [ -d /run/systemd/system ] } add_privs() { @@ -17,16 +17,11 @@ : } -post_common() { - systemd-machine-id-setup - - add_privs usr/bin/systemd-detect-virt 'cap_dac_override,cap_sys_ptrace+ep' - - udevadm hwdb --update - journalctl --update-catalog - - # don't reexec on 209-1 upgrade - if [ -n "$2" ] && [ "$(vercmp 209-1 "$2")" -eq 1 ]; then +maybe_reexec() { + # don't reexec on 209-1 upgrade due to large infrastructural changes. + if [ "$(vercmp 209-1 "$2")" -eq 1 ]; then + echo ':: systemd has not been reexecuted. It is recommended that you' + echo ' reboot at your earliest convenience.' return fi @@ -35,20 +30,20 @@ fi } -mask_net_naming() { - if [ ! -e etc/udev/rules.d/80-net-name-slot.rules ]; then - printf >etc/udev/rules.d/80-net-name-slot.rules '# %s\n' \ - "This file masks persistent renaming rules for network devices. If you" \ - "delete this file, /usr/lib/udev/rules.d/80-net-name-slot.rules may" \ - "rename network devices according to ID_NET_NAME_{ONBOARD,SLOT,PATH}" \ - "properties of your network devices, with priority in that order. See" \ - "the output of 'udevadm test-builtin net_id /sys/class/net/\$interface'" \ - "for details on what that new name might be." \ - "" \ - "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames" - fi +_dir_empty() { + set -- "$1"/* + [ ! -e "$1" ] && [ ! -L "$1" ] } +post_common() { + systemd-machine-id-setup + + add_privs usr/bin/systemd-detect-virt 'cap_dac_override,cap_sys_ptrace+ep' + + udevadm hwdb --update + journalctl --update-catalog +} + _208_changes() { chown root:systemd-journal var/log/journal chmod 2755 var/log/journal @@ -87,8 +82,18 @@ fi } +_210_changes() { + if sd_booted; then + # If /etc/systemd/network is non-empty, then this is a 209 user who used + # networkd. Re-enable it for them. + if ! _dir_empty etc/systemd/network; then + systemctl enable systemd-networkd + fi + fi +} + post_install() { - post_common + post_common "$@" add_journal_acls @@ -100,40 +105,10 @@ } post_upgrade() { - post_common + post_common "$@" - # getty@tty1.service is no longer enabled by default, but we don't want to break - # existing setups. - if [ "$(vercmp 183 "$2")" -eq 1 ]; then - # systemctl seems to be whiny on sysvinit. this will succeed unless something - # horrific happens, so just mask the error. - systemctl -q enable getty@tty1.service || true - fi + maybe_reexec "$@" - if [ "$(vercmp 194-4 "$2")" -eq 1 ]; then - printf '==> journald now writes to /var/log/journal by default. This can be\n' - printf ' controlled with the Storage setting in /etc/systemd/journald.conf\n' - fi - - # logind's protocol changed. kindly restart the daemon to avoid locking - # out further logins. - if [ "$(vercmp 195 "$2")" -eq 1 ]; then - if sd_booted; then - systemctl restart systemd-logind.service - fi - fi - - if [ "$(vercmp 196-1 "$2")" -eq 1 ]; then - printf '==> The legacy configuration options are no longer supported in rc.conf,\n' - printf ' convert your rc.conf to the new configuration formats.\n' - fi - - if [ "$(vercmp 197-1 "$2")" -eq 1 ]; then - mask_net_naming - printf '==> Persistent net naming rules have been shipped as disabled.\n' - printf ' See /etc/udev/rules.d/80-net-name-slot.rules for more detail\n' - fi - if [ "$(vercmp 204-1 "$2")" -eq 1 ]; then printf '==> The /bin/systemd symlink has been removed. Any references in your\n' printf ' bootloader (or elsewhere) must be updated to /usr/lib/systemd/systemd.\n' @@ -161,6 +136,10 @@ if [ "$(vercmp 209-1 "$2")" -eq 1 ]; then _209_changes fi + + if [ "$(vercmp 210-1 "$2")" -eq 1 ]; then + _210_changes + fi } # vim:set ts=2 sw=2 et: