From 47c564fe3ecce15f696e75ecaf2f7260b492894a Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mar 01 2014 12:59:32 +0000 Subject: Apply a few patches --- diff --git a/0001-login-fix-pos-array-allocation.patch b/0001-login-fix-pos-array-allocation.patch new file mode 100644 index 0000000..abad77d --- /dev/null +++ b/0001-login-fix-pos-array-allocation.patch @@ -0,0 +1,51 @@ +From 2d426f2ad06032979fa7a54d11b74be52b8ec047 Mon Sep 17 00:00:00 2001 +From: David Herrmann +Date: Tue, 25 Feb 2014 12:20:25 +0100 +Subject: [PATCH] login: fix pos-array allocation + +GREEDY_REALLOC takes a pointer to the real size, not the array-width as +argument. Therefore, our array is currently way to small to keep the seat +positions. + +Introduce GREEDY_REALLOC0_T() as typed version of GREEDY_REALLOC and store +the array-width instead of array-size. + +(cherry picked from commit a1937e679f76758635d295287398abe526de2522) +--- + src/login/logind-seat.c | 2 +- + src/shared/util.h | 9 +++++++++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c +index 631be5f..36ec7ed 100644 +--- a/src/login/logind-seat.c ++++ b/src/login/logind-seat.c +@@ -475,7 +475,7 @@ void seat_claim_position(Seat *s, Session *session, unsigned int pos) { + if (seat_has_vts(s)) + pos = session->vtnr; + +- if (!GREEDY_REALLOC0(s->positions, s->position_count, pos + 1)) ++ if (!GREEDY_REALLOC0_T(s->positions, s->position_count, pos + 1)) + return; + + seat_evict_position(s, session); +diff --git a/src/shared/util.h b/src/shared/util.h +index 9913fce..78b1444 100644 +--- a/src/shared/util.h ++++ b/src/shared/util.h +@@ -723,6 +723,15 @@ void* greedy_realloc0(void **p, size_t *allocated, size_t need); + #define GREEDY_REALLOC0(array, allocated, need) \ + greedy_realloc0((void**) &(array), &(allocated), sizeof((array)[0]) * (need)) + ++#define GREEDY_REALLOC0_T(array, count, need) \ ++ ({ \ ++ size_t _size = (count) * sizeof((array)[0]); \ ++ void *_ptr = GREEDY_REALLOC0((array), _size, (need)); \ ++ if (_ptr) \ ++ (count) = _size / sizeof((array)[0]); \ ++ _ptr; \ ++ }) ++ + static inline void _reset_errno_(int *saved_errno) { + errno = *saved_errno; + } diff --git a/0002-login-set-pos-slot-to-fallback-on-pos-eviction.patch b/0002-login-set-pos-slot-to-fallback-on-pos-eviction.patch new file mode 100644 index 0000000..522436e --- /dev/null +++ b/0002-login-set-pos-slot-to-fallback-on-pos-eviction.patch @@ -0,0 +1,51 @@ +From aa6c8bcd17b37634fc7e4d5d59b6b9d93625b4a3 Mon Sep 17 00:00:00 2001 +From: David Herrmann +Date: Tue, 25 Feb 2014 13:08:24 +0100 +Subject: [PATCH] login: set pos-slot to fallback on pos-eviction + +If we evict a session position, we open the position slot for future +sessions. However, there might already be another session on the same +position if both were started on the same VT. This is currently done if +gdm spawns the session on its own Xserver. + +Hence, look for such a session on pos-eviction and claim the new slot +immediately. + +(cherry picked from commit 3e6b205f81e743c7354ccbc69eb45afbdbebe2dc) +--- + src/login/logind-seat.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c +index 36ec7ed..96cf08e 100644 +--- a/src/login/logind-seat.c ++++ b/src/login/logind-seat.c +@@ -459,6 +459,7 @@ int seat_stop_sessions(Seat *s, bool force) { + } + + void seat_evict_position(Seat *s, Session *session) { ++ Session *iter; + unsigned int pos = session->pos; + + session->pos = 0; +@@ -466,8 +467,19 @@ void seat_evict_position(Seat *s, Session *session) { + if (!pos) + return; + +- if (pos < s->position_count && s->positions[pos] == session) ++ if (pos < s->position_count && s->positions[pos] == session) { + s->positions[pos] = NULL; ++ ++ /* There might be another session claiming the same ++ * position (eg., during gdm->session transition), so lets look ++ * for it and set it on the free slot. */ ++ LIST_FOREACH(sessions_by_seat, iter, s->sessions) { ++ if (iter->pos == pos) { ++ s->positions[pos] = iter; ++ break; ++ } ++ } ++ } + } + + void seat_claim_position(Seat *s, Session *session, unsigned int pos) { diff --git a/0003-login-Allow-calling-org.freedesktop.login1.Seat.Swit.patch b/0003-login-Allow-calling-org.freedesktop.login1.Seat.Swit.patch new file mode 100644 index 0000000..c7897da --- /dev/null +++ b/0003-login-Allow-calling-org.freedesktop.login1.Seat.Swit.patch @@ -0,0 +1,33 @@ +From 0d0b9805baaed3e4e584916bbff710fec6cb1e8b Mon Sep 17 00:00:00 2001 +From: "Jasper St. Pierre" +Date: Fri, 21 Feb 2014 18:23:17 -0500 +Subject: [PATCH] login: Allow calling org.freedesktop.login1.Seat.SwitchTo + +(cherry picked from commit 9c413373d2112055a0142ef522bf95af9b491b4a) +--- + src/login/org.freedesktop.login1.conf | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/login/org.freedesktop.login1.conf b/src/login/org.freedesktop.login1.conf +index d677f61..1318328 100644 +--- a/src/login/org.freedesktop.login1.conf ++++ b/src/login/org.freedesktop.login1.conf +@@ -141,6 +141,18 @@ + send_member="ActivateSession"/> + + ++ ++ ++ ++ ++ ++ + diff --git a/0004-fix-typo-in-iDRAC-network-interface-name-irdac-idrac.patch b/0004-fix-typo-in-iDRAC-network-interface-name-irdac-idrac.patch new file mode 100644 index 0000000..dc89037 --- /dev/null +++ b/0004-fix-typo-in-iDRAC-network-interface-name-irdac-idrac.patch @@ -0,0 +1,20 @@ +From d0550e668858e1af94e2746062931680dc15b555 Mon Sep 17 00:00:00 2001 +From: Tomasz Torcz +Date: Tue, 25 Feb 2014 12:43:55 +0100 +Subject: [PATCH] fix typo in iDRAC network interface name: irdac->idrac + +(cherry picked from commit b3e4387351c835766f96796a20d94971afea7d3b) +--- + hwdb/20-net-ifname.hwdb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hwdb/20-net-ifname.hwdb b/hwdb/20-net-ifname.hwdb +index 29d2633..2408dc1 100644 +--- a/hwdb/20-net-ifname.hwdb ++++ b/hwdb/20-net-ifname.hwdb +@@ -2,4 +2,4 @@ + + # Dell iDRAC Virtual USB NIC + usb:v413CpA102* +- ID_NET_NAME_FROM_DATABASE=irdac ++ ID_NET_NAME_FROM_DATABASE=idrac diff --git a/0005-Replace-var-run-with-run-in-remaining-places.patch b/0005-Replace-var-run-with-run-in-remaining-places.patch new file mode 100644 index 0000000..9b75cef --- /dev/null +++ b/0005-Replace-var-run-with-run-in-remaining-places.patch @@ -0,0 +1,88 @@ +From a980c3fa6bee1b4f0185d9d317c1bbf30ce6b832 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Tue, 25 Feb 2014 20:11:04 -0500 +Subject: [PATCH] Replace /var/run with /run in remaining places + +/run was already used almost everywhere, fix the remaining places +for consistency. + +(cherry picked from commit 41a55c46ab8fb4ef6727434227071321fc762cce) +--- + man/daemon.xml | 2 +- + man/runlevel.xml | 2 +- + man/tmpfiles.d.xml | 4 ++-- + src/libsystemd/sd-bus/sd-bus.c | 4 ++-- + src/systemctl/systemctl.c | 4 ++-- + 5 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/man/daemon.xml b/man/daemon.xml +index 88dd082..fd29ba7 100644 +--- a/man/daemon.xml ++++ b/man/daemon.xml +@@ -149,7 +149,7 @@ + write the daemon PID (as returned by + getpid()) to a + PID file, for example +- /var/run/foobar.pid ++ /run/foobar.pid + (for a hypothetical daemon "foobar") + to ensure that the daemon cannot be + started more than once. This must be +diff --git a/man/runlevel.xml b/man/runlevel.xml +index 976753a..4db06dc 100644 +--- a/man/runlevel.xml ++++ b/man/runlevel.xml +@@ -124,7 +124,7 @@ + + + +- /var/run/utmp ++ /run/utmp + + The utmp database + runlevel reads the +diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml +index 812129f..0a006d1 100644 +--- a/man/tmpfiles.d.xml ++++ b/man/tmpfiles.d.xml +@@ -441,8 +441,8 @@ r! /tmp/.X[0-9]*-lock + /etc/tmpfiles.d/screen.conf example + screen needs two directories created at boot with specific modes and ownership. + +- d /var/run/screens 1777 root root 10d +-d /var/run/uscreens 0755 root root 10d12h ++ d /run/screens 1777 root root 10d ++d /run/uscreens 0755 root root 10d12h + + + /etc/tmpfiles.d/abrt.conf example +diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c +index 20f540d..1318272 100644 +--- a/src/libsystemd/sd-bus/sd-bus.c ++++ b/src/libsystemd/sd-bus/sd-bus.c +@@ -794,8 +794,8 @@ static int parse_container_unix_address(sd_bus *b, const char **p, char **guid) + machine = NULL; + + b->sockaddr.un.sun_family = AF_UNIX; +- strncpy(b->sockaddr.un.sun_path, "/var/run/dbus/system_bus_socket", sizeof(b->sockaddr.un.sun_path)); +- b->sockaddr_size = offsetof(struct sockaddr_un, sun_path) + sizeof("/var/run/dbus/system_bus_socket") - 1; ++ strncpy(b->sockaddr.un.sun_path, "/run/dbus/system_bus_socket", sizeof(b->sockaddr.un.sun_path)); ++ b->sockaddr_size = offsetof(struct sockaddr_un, sun_path) + strlen("/run/dbus/system_bus_socket"); + + return 0; + } +diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c +index 34d7079..8692716 100644 +--- a/src/systemctl/systemctl.c ++++ b/src/systemctl/systemctl.c +@@ -3758,8 +3758,8 @@ static int show_one( + streq(verb, "status")) { + /* According to LSB: "program not running" */ + /* 0: program is running or service is OK +- * 1: program is dead and /var/run pid file exists +- * 2: program is dead and /var/lock lock file exists ++ * 1: program is dead and /run PID file exists ++ * 2: program is dead and /run/lock lock file exists + * 3: program is not running + * 4: program or service status is unknown + */ diff --git a/0006-Revert-back-to-var-run-at-a-couple-of-problems.patch b/0006-Revert-back-to-var-run-at-a-couple-of-problems.patch new file mode 100644 index 0000000..b172ec0 --- /dev/null +++ b/0006-Revert-back-to-var-run-at-a-couple-of-problems.patch @@ -0,0 +1,59 @@ +From ab64c275efac13ed8fb255e4b2ccf1c287aa0bc6 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 26 Feb 2014 02:47:43 +0100 +Subject: [PATCH] Revert back to /var/run at a couple of problems +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This partially reverts 41a55c46ab8fb4ef6727434227071321fc762cce + +Some specifications we want to stay compatibility actually document +/var/run, not /run, and we should stay compatible with that. In order to +make sure our D-Bus implementation works on any system, regardless if +running systemd or not, we should always use /var/run which is the +only path mandated by the D-Bus spec. + +Similar, glibc hardcodes the utmp location to /var/run, and this is +exposed in _UTMP_PATH in limits.h, hence let's stay in sync with this +public API, too. + +We simply do not support systems where /var/run is not a symlink → /run. +Hence both are equivalent. Staying compatible with upstream +specifications hence weighs more than cleaning up superficial +appearance. + +(cherry picked from commit df1e02046144f41176c32ed011369fd8dba36b76) +--- + man/runlevel.xml | 2 +- + src/libsystemd/sd-bus/sd-bus.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/man/runlevel.xml b/man/runlevel.xml +index 4db06dc..976753a 100644 +--- a/man/runlevel.xml ++++ b/man/runlevel.xml +@@ -124,7 +124,7 @@ + + + +- /run/utmp ++ /var/run/utmp + + The utmp database + runlevel reads the +diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c +index 1318272..636715f 100644 +--- a/src/libsystemd/sd-bus/sd-bus.c ++++ b/src/libsystemd/sd-bus/sd-bus.c +@@ -794,8 +794,8 @@ static int parse_container_unix_address(sd_bus *b, const char **p, char **guid) + machine = NULL; + + b->sockaddr.un.sun_family = AF_UNIX; +- strncpy(b->sockaddr.un.sun_path, "/run/dbus/system_bus_socket", sizeof(b->sockaddr.un.sun_path)); +- b->sockaddr_size = offsetof(struct sockaddr_un, sun_path) + strlen("/run/dbus/system_bus_socket"); ++ strncpy(b->sockaddr.un.sun_path, "/var/run/dbus/system_bus_socket", sizeof(b->sockaddr.un.sun_path)); ++ b->sockaddr_size = offsetof(struct sockaddr_un, sun_path) + strlen("/var/run/dbus/system_bus_socket"); + + return 0; + } diff --git a/0007-README-document-that-var-run-must-be-a-symlink-run.patch b/0007-README-document-that-var-run-must-be-a-symlink-run.patch new file mode 100644 index 0000000..c6f2c8a --- /dev/null +++ b/0007-README-document-that-var-run-must-be-a-symlink-run.patch @@ -0,0 +1,28 @@ +From 10acd244847eb8689e79efbf95475aef8818bb51 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 26 Feb 2014 02:54:37 +0100 +Subject: [PATCH] =?UTF-8?q?README:=20document=20that=20/var/run=20must=20b?= + =?UTF-8?q?e=20a=20symlink=20=E2=86=92=20/run?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +(cherry picked from commit 47bc23c18cbc87471dc832534c8565625e4a9d16) +--- + README | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/README b/README +index b918132..7a227e7 100644 +--- a/README ++++ b/README +@@ -190,6 +190,9 @@ WARNINGS: + about this, since this kind of file system setup is not really + supported anymore by the basic set of Linux OS components. + ++ systemd requires that the /run mount point exists. systemd also ++ requires that /var/run is a a symlink → /run. ++ + For more information on this issue consult + http://freedesktop.org/wiki/Software/systemd/separate-usr-is-broken + diff --git a/0008-Use-var-run-dbus-system_bus_socket-for-the-D-Bus-soc.patch b/0008-Use-var-run-dbus-system_bus_socket-for-the-D-Bus-soc.patch new file mode 100644 index 0000000..7ce26de --- /dev/null +++ b/0008-Use-var-run-dbus-system_bus_socket-for-the-D-Bus-soc.patch @@ -0,0 +1,63 @@ +From d5194bbb174d0b9a87e81d465644624ab455bbf6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Tue, 25 Feb 2014 21:26:31 -0500 +Subject: [PATCH] Use /var/run/dbus/system_bus_socket for the D-Bus socket + +(cherry picked from commit 1ae383a8a3ae4824453e297352fda603d2d3fd5e) +--- + man/systemd-bus-proxyd@.service.xml | 2 +- + src/libsystemd/sd-bus/PORTING-DBUS1 | 2 +- + src/shared/def.h | 2 +- + units/systemd-bus-proxyd.socket | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/man/systemd-bus-proxyd@.service.xml b/man/systemd-bus-proxyd@.service.xml +index 75a3c8b..3a5930d 100644 +--- a/man/systemd-bus-proxyd@.service.xml ++++ b/man/systemd-bus-proxyd@.service.xml +@@ -59,7 +59,7 @@ along with systemd; If not, see . + systemd-bus-proxyd.socket will launch + systemd-bus-proxyd@.service for connections + to the classic D-Bus socket in +- /run/dbus/system_bus_socket. ++ /var/run/dbus/system_bus_socket. + + systemd-bus-proxyd@.service is launched + for an existing D-Bus connection and will use +diff --git a/src/libsystemd/sd-bus/PORTING-DBUS1 b/src/libsystemd/sd-bus/PORTING-DBUS1 +index 90d184b7..0253a42 100644 +--- a/src/libsystemd/sd-bus/PORTING-DBUS1 ++++ b/src/libsystemd/sd-bus/PORTING-DBUS1 +@@ -536,7 +536,7 @@ parameter. + Client libraries should use the following connection string when + connecting to the system bus: + +- kernel:path=/dev/kdbus/0-system/bus;unix:path=/run/dbus/system_bus_socket ++ kernel:path=/dev/kdbus/0-system/bus;unix:path=/var/run/dbus/system_bus_socket + + This will ensure that kdbus is preferred over the legacy AF_UNIX + socket, but compatibility is kept. For the user bus use: +diff --git a/src/shared/def.h b/src/shared/def.h +index 7777756..aa489d8 100644 +--- a/src/shared/def.h ++++ b/src/shared/def.h +@@ -61,7 +61,7 @@ + "/usr/lib/kbd/keymaps/\0" + #endif + +-#define UNIX_SYSTEM_BUS_PATH "unix:path=/run/dbus/system_bus_socket" ++#define UNIX_SYSTEM_BUS_PATH "unix:path=/var/run/dbus/system_bus_socket" + #define KERNEL_SYSTEM_BUS_PATH "kernel:path=/dev/kdbus/0-system/bus" + + #ifdef ENABLE_KDBUS +diff --git a/units/systemd-bus-proxyd.socket b/units/systemd-bus-proxyd.socket +index 406e15b..6c42d38 100644 +--- a/units/systemd-bus-proxyd.socket ++++ b/units/systemd-bus-proxyd.socket +@@ -9,5 +9,5 @@ + Description=Legacy D-Bus Protocol Compatibility Socket + + [Socket] +-ListenStream=/run/dbus/system_bus_socket ++ListenStream=/var/run/dbus/system_bus_socket + Accept=yes diff --git a/0009-mount-don-t-send-out-PropertiesChanged-message-if-ac.patch b/0009-mount-don-t-send-out-PropertiesChanged-message-if-ac.patch new file mode 100644 index 0000000..25ad758 --- /dev/null +++ b/0009-mount-don-t-send-out-PropertiesChanged-message-if-ac.patch @@ -0,0 +1,68 @@ +From f230c64b5ad069b271f163da3142df52eab1202b Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 26 Feb 2014 04:27:50 +0100 +Subject: [PATCH] mount: don't send out PropertiesChanged message if actually + nothing got changed + +(cherry picked from commit ff5f34d08c191c326c41a083745522383ac86cae) +--- + src/core/mount.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/src/core/mount.c b/src/core/mount.c +index a0cea1e..75b133b 100644 +--- a/src/core/mount.c ++++ b/src/core/mount.c +@@ -1388,7 +1388,7 @@ static int mount_add_one( + _cleanup_free_ char *e = NULL, *w = NULL, *o = NULL, *f = NULL; + bool load_extras = false; + MountParameters *p; +- bool delete; ++ bool delete, changed = false; + Unit *u; + int r; + +@@ -1456,6 +1456,7 @@ static int mount_add_one( + } + + unit_add_to_load_queue(u); ++ changed = true; + } else { + delete = false; + +@@ -1474,6 +1475,7 @@ static int mount_add_one( + /* Load in the extras later on, after we + * finished initialization of the unit */ + load_extras = true; ++ changed = true; + } + } + +@@ -1485,10 +1487,16 @@ static int mount_add_one( + } + + p = &MOUNT(u)->parameters_proc_self_mountinfo; ++ ++ changed = changed || ++ !streq_ptr(p->options, options) || ++ !streq_ptr(p->what, what) || ++ !streq_ptr(p->fstype, fstype); ++ + if (set_flags) { + MOUNT(u)->is_mounted = true; + MOUNT(u)->just_mounted = !MOUNT(u)->from_proc_self_mountinfo; +- MOUNT(u)->just_changed = !streq_ptr(p->options, o); ++ MOUNT(u)->just_changed = changed; + } + + MOUNT(u)->from_proc_self_mountinfo = true; +@@ -1511,7 +1519,8 @@ static int mount_add_one( + goto fail; + } + +- unit_add_to_dbus_queue(u); ++ if (changed) ++ unit_add_to_dbus_queue(u); + + return 0; + diff --git a/0010-mount-don-t-fire-PropertiesChanged-signals-for-mount.patch b/0010-mount-don-t-fire-PropertiesChanged-signals-for-mount.patch new file mode 100644 index 0000000..5d61e4b --- /dev/null +++ b/0010-mount-don-t-fire-PropertiesChanged-signals-for-mount.patch @@ -0,0 +1,49 @@ +From 3a144cfb90e6c0c6586a976138fc8e472b90bbaf Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 26 Feb 2014 04:28:37 +0100 +Subject: [PATCH] mount: don't fire PropertiesChanged signals for mounts that + are stopped + +(cherry picked from commit aef831369cd2a7a1bd4a58dd96ff8628ed6a85f9) +--- + src/core/mount.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/src/core/mount.c b/src/core/mount.c +index 75b133b..68b2e83 100644 +--- a/src/core/mount.c ++++ b/src/core/mount.c +@@ -1676,20 +1676,20 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents, + Mount *mount = MOUNT(u); + + if (!mount->is_mounted) { +- /* This has just been unmounted. */ + + mount->from_proc_self_mountinfo = false; + + switch (mount->state) { + + case MOUNT_MOUNTED: ++ /* This has just been unmounted by ++ * somebody else, follow the state ++ * change. */ + mount_enter_dead(mount, MOUNT_SUCCESS); + break; + + default: +- mount_set_state(mount, mount->state); + break; +- + } + + } else if (mount->just_mounted || mount->just_changed) { +@@ -1700,6 +1700,9 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents, + + case MOUNT_DEAD: + case MOUNT_FAILED: ++ /* This has just been mounted by ++ * somebody else, follow the state ++ * change. */ + mount_enter_mounted(mount, MOUNT_SUCCESS); + break; + diff --git a/0011-logs-show-fix-corrupt-output-with-empty-messages.patch b/0011-logs-show-fix-corrupt-output-with-empty-messages.patch new file mode 100644 index 0000000..9c47d01 --- /dev/null +++ b/0011-logs-show-fix-corrupt-output-with-empty-messages.patch @@ -0,0 +1,40 @@ +From 494bf9d6d22406676c63822cbf941214fed3111c Mon Sep 17 00:00:00 2001 +From: Uoti Urpala +Date: Thu, 20 Feb 2014 03:00:09 +0200 +Subject: [PATCH] logs-show: fix corrupt output with empty messages + +If a message had zero length, journalctl would print no newline, and +two output lines would be concatenated. Fix. The problem was +introduced in commit 31f7bf199452 ("logs-show: print multiline +messages"). Affected short and verbose output modes. + +Before fix: + +Feb 09 21:16:17 glyph dhclient[1323]: Feb 09 21:16:17 glyph NetworkManager[788]: (enp4s2): DHCPv4 state changed nbi -> preinit + +after: + +Feb 09 21:16:17 glyph dhclient[1323]: +Feb 09 21:16:17 glyph NetworkManager[788]: (enp4s2): DHCPv4 state changed nbi -> preinit + +(cherry picked from commit 47d80904a1f72d559962cc5ad32fffd46672a34a) +--- + src/shared/logs-show.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c +index 61c3652..12d4a1c 100644 +--- a/src/shared/logs-show.c ++++ b/src/shared/logs-show.c +@@ -124,6 +124,11 @@ static bool print_multiline(FILE *f, unsigned prefix, unsigned n_columns, Output + } + } + ++ /* A special case: make sure that we print a newline when ++ the message is empty. */ ++ if (message_len == 0) ++ fputs("\n", f); ++ + for (pos = message; + pos < message + message_len; + pos = end + 1, line++) { diff --git a/0012-journalctl-refuse-extra-arguments-with-verify-and-si.patch b/0012-journalctl-refuse-extra-arguments-with-verify-and-si.patch new file mode 100644 index 0000000..d9481cc --- /dev/null +++ b/0012-journalctl-refuse-extra-arguments-with-verify-and-si.patch @@ -0,0 +1,29 @@ +From 0c4b94ed59075c38da2aa30d162fc9f963d419aa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Wed, 26 Feb 2014 23:01:43 -0500 +Subject: [PATCH] journalctl: refuse extra arguments with --verify and similar + +Positional arguments only make sense with the default action. +For other actions, complain instead of ignoring them silently. + +(cherry picked from commit 0b6b7c2004317da48e5bbd3078c5662d8f0061b6) +--- + src/journal/journalctl.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c +index a328ba1..0619b25 100644 +--- a/src/journal/journalctl.c ++++ b/src/journal/journalctl.c +@@ -658,6 +658,11 @@ static int parse_argv(int argc, char *argv[]) { + return -EINVAL; + } + ++ if (arg_action != ACTION_SHOW && optind < argc) { ++ log_error("Extraneous arguments starting with '%s'", argv[optind]); ++ return -EINVAL; ++ } ++ + return 1; + } + diff --git a/0013-cdrom_id-use-the-old-MMC-fallback.patch b/0013-cdrom_id-use-the-old-MMC-fallback.patch new file mode 100644 index 0000000..5b0489b --- /dev/null +++ b/0013-cdrom_id-use-the-old-MMC-fallback.patch @@ -0,0 +1,52 @@ +From 2388edd10d9aab9c0f3817e73addd3dc0bc870bf Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 27 Feb 2014 11:06:37 +0100 +Subject: [PATCH] cdrom_id: use the old MMC fallback + +https://bugzilla.redhat.com/show_bug.cgi?id=1038015 +The problem seems to be that the your virtual DVD is emulating a really +old DVD device, and doing it kind of strangely. + +> dracut:# /lib/udev/cdrom_id --debug /dev/sr0 +> probing: '/dev/sr0' +> INQUIRY: [IMM ][Virtual CD/DVD ][0316] +> GET CONFIGURATION failed with SK=5h/ASC=24h/ACQ=00h + +So your virtual drive rejects the GET CONFIGURATION command as illegal. + +Other pre-MMC2 drives that don't accept this command usually return the +error +SK=5h,ASC=20h (invalid/unsupported command code), in which case cdrom_id +tries an older method, and then ID_CDROM_MEDIA_TRACK_COUNT_DATA gets set +and all the /dev/disk/by-label (etc) links get set up. + +The virtual drive returns the error SK=5h,ASC=24h (invalid field in +Command Descriptor Block), which cdrom_id doesn't handle, so it gives up +and the links never get made. + +The ideal solution would be to make the IMM to emulate a device that's +less than 15 years old, but I'm not going to hold my breath waiting for +that. + +So probably cdrom_id should also use the old MMC fallback when the error +is SK=5h,ASC=24h, and then all of this would work as expected. + +Suggested-by:Luca Miccini +(cherry picked from commit a14f14976094650e17d39f3a7d15a1c68c93c333) +--- + src/udev/cdrom_id/cdrom_id.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c +index 93467c2..33b2bc3 100644 +--- a/src/udev/cdrom_id/cdrom_id.c ++++ b/src/udev/cdrom_id/cdrom_id.c +@@ -556,7 +556,7 @@ static int cd_profiles(struct udev *udev, int fd) + if ((err != 0)) { + info_scsi_cmd_err(udev, "GET CONFIGURATION", err); + /* handle pre-MMC2 drives which do not support GET CONFIGURATION */ +- if (SK(err) == 0x5 && ASC(err) == 0x20) { ++ if (SK(err) == 0x5 && (ASC(err) == 0x20 || ASC(err) == 0x24)) { + log_debug("drive is pre-MMC2 and does not support 46h get configuration command"); + log_debug("trying to work around the problem"); + ret = cd_profiles_old_mmc(udev, fd); diff --git a/0014-udev-rules-setup-tty-permissions-and-group-for-sclp_.patch b/0014-udev-rules-setup-tty-permissions-and-group-for-sclp_.patch new file mode 100644 index 0000000..dcf7d0c --- /dev/null +++ b/0014-udev-rules-setup-tty-permissions-and-group-for-sclp_.patch @@ -0,0 +1,25 @@ +From 107e2ed29711c813a34a07e4ce626f98c3607534 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 27 Feb 2014 11:19:09 +0100 +Subject: [PATCH] udev/rules: setup tty permissions and group for sclp_line, + ttysclp and 3270/tty + +(cherry picked from commit c594cccee264cfd98f183ae6ec289b11e70f2d6c) +--- + rules/50-udev-default.rules | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/rules/50-udev-default.rules b/rules/50-udev-default.rules +index 679dfdf..0bccf67 100644 +--- a/rules/50-udev-default.rules ++++ b/rules/50-udev-default.rules +@@ -15,6 +15,9 @@ ACTION!="add", GOTO="default_permissions_end" + SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666" + SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666" + SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620" ++SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620" ++SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620" ++SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620" + SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty" + KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout" + diff --git a/0015-architecture-Add-tilegx.patch b/0015-architecture-Add-tilegx.patch new file mode 100644 index 0000000..c7b8171 --- /dev/null +++ b/0015-architecture-Add-tilegx.patch @@ -0,0 +1,55 @@ +From ff02c36bfc811fc7ecbcaebdbc3bc4bebb5f19ab Mon Sep 17 00:00:00 2001 +From: Henrik Grindal Bakken +Date: Thu, 27 Feb 2014 21:19:13 +0100 +Subject: [PATCH] architecture: Add tilegx + +Add Tilera's TILE-GX processor family support. + +(cherry picked from commit 46eea341c36f0caf0bdd5b2274a1ef7cb4e83e97) +--- + src/shared/architecture.c | 3 +++ + src/shared/architecture.h | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/src/shared/architecture.c b/src/shared/architecture.c +index ceba492..fcdb3d5 100644 +--- a/src/shared/architecture.c ++++ b/src/shared/architecture.c +@@ -112,6 +112,8 @@ Architecture uname_architecture(void) { + { "sh", ARCHITECTURE_SH }, + #elif defined(__m68k__) + { "m68k", ARCHITECTURE_M68K }, ++#elif defined(__tilegx__) ++ { "tilegx", ARCHITECTURE_TILEGX }, + #else + #error "Please register your architecture here!" + #endif +@@ -158,6 +160,7 @@ static const char *const architecture_table[_ARCHITECTURE_MAX] = { + [ARCHITECTURE_SH] = "sh", + [ARCHITECTURE_SH64] = "sh64", + [ARCHITECTURE_M68K] = "m68k", ++ [ARCHITECTURE_TILEGX] = "tilegx", + }; + + DEFINE_STRING_TABLE_LOOKUP(architecture, Architecture); +diff --git a/src/shared/architecture.h b/src/shared/architecture.h +index 3183645..e589a91 100644 +--- a/src/shared/architecture.h ++++ b/src/shared/architecture.h +@@ -47,6 +47,7 @@ typedef enum Architecture { + ARCHITECTURE_SH, + ARCHITECTURE_SH64, + ARCHITECTURE_M68K, ++ ARCHITECTURE_TILEGX, + _ARCHITECTURE_MAX, + _ARCHITECTURE_INVALID = -1 + } Architecture; +@@ -107,6 +108,8 @@ Architecture uname_architecture(void); + # define native_architecture() ARCHITECTURE_SH + #elif defined(__m68k__) + # define native_architecture() ARCHITECTURE_M68K ++#elif defined(__tilegx__) ++# define native_architecture() ARCHITECTURE_TILEGX + #else + #error "Please register your architecture here!" + #endif diff --git a/0016-nspawn-fix-detection-of-missing-proc-self-loginuid.patch b/0016-nspawn-fix-detection-of-missing-proc-self-loginuid.patch new file mode 100644 index 0000000..d5aef96 --- /dev/null +++ b/0016-nspawn-fix-detection-of-missing-proc-self-loginuid.patch @@ -0,0 +1,30 @@ +From 0b37b2b7a3fe8e8f96f368848ff46db325a59e70 Mon Sep 17 00:00:00 2001 +From: Tero Roponen +Date: Tue, 25 Feb 2014 17:19:35 +0200 +Subject: [PATCH] nspawn: fix detection of missing /proc/self/loginuid + +Running 'systemd-nspawn -D /srv/Fedora/' gave me this error: + Failed to read /proc/self/loginuid: No such file or directory + + Container Fedora failed with error code 1. + +This patch fixes the problem. + +(cherry picked from commit 13e8ceb84e56907d73b6b07418deb37faaf0e66d) +--- + src/nspawn/nspawn.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c +index de74a43..84b7276 100644 +--- a/src/nspawn/nspawn.c ++++ b/src/nspawn/nspawn.c +@@ -1341,7 +1341,7 @@ static int reset_audit_loginuid(void) { + return 0; + + r = read_one_line_file("/proc/self/loginuid", &p); +- if (r == -EEXIST) ++ if (r == -ENOENT) + return 0; + if (r < 0) { + log_error("Failed to read /proc/self/loginuid: %s", strerror(-r)); diff --git a/0017-bash-add-completion-for-systemd-nspawn.patch b/0017-bash-add-completion-for-systemd-nspawn.patch new file mode 100644 index 0000000..4746722 --- /dev/null +++ b/0017-bash-add-completion-for-systemd-nspawn.patch @@ -0,0 +1,142 @@ +From 3300150b370b2a58522d55d7ff17632e5dd58af8 Mon Sep 17 00:00:00 2001 +From: Thomas Andersen +Date: Sat, 1 Mar 2014 03:27:49 +0100 +Subject: [PATCH] bash: add completion for systemd-nspawn + +(cherry picked from commit 0d6883b6a870b66c8c70e43695d22de96aab68e7) +--- + Makefile.am | 1 + + shell-completion/bash/systemd-nspawn | 112 +++++++++++++++++++++++++++++++++++ + 2 files changed, 113 insertions(+) + create mode 100644 shell-completion/bash/systemd-nspawn + +diff --git a/Makefile.am b/Makefile.am +index 529b525..8e6c392 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -353,6 +353,7 @@ dist_bashcompletion_DATA = \ + shell-completion/bash/systemctl \ + shell-completion/bash/systemd-analyze \ + shell-completion/bash/systemd-delta \ ++ shell-completion/bash/systemd-nspawn \ + shell-completion/bash/systemd-run \ + shell-completion/bash/udevadm \ + shell-completion/bash/kernel-install +diff --git a/shell-completion/bash/systemd-nspawn b/shell-completion/bash/systemd-nspawn +new file mode 100644 +index 0000000..5b2ac82 +--- /dev/null ++++ b/shell-completion/bash/systemd-nspawn +@@ -0,0 +1,112 @@ ++# systemd-nspawn(1) completion -*- shell-script -*- ++# ++# This file is part of systemd. ++# ++# Copyright 2014 Thomas H.P. Andersen ++# ++# systemd is free software; you can redistribute it and/or modify it ++# under the terms of the GNU Lesser General Public License as published by ++# the Free Software Foundation; either version 2.1 of the License, or ++# (at your option) any later version. ++# ++# systemd 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 Lesser General Public License ++# along with systemd; If not, see . ++ ++__contains_word() { ++ local w word=$1; shift ++ for w in "$@"; do ++ [[ $w = "$word" ]] && return ++ done ++} ++ ++__get_users() { ++ local a b ++ loginctl list-users --no-legend --no-pager | { while read a b; do echo " $b"; done; }; ++} ++ ++__get_slices() { ++ local a b ++ systemctl list-units -t slice --no-legend --no-pager | { while read a b; do echo " $a"; done; }; ++} ++ ++_systemd_nspawn() { ++ local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} ++ local i verb comps ++ ++ local -A OPTS=( ++ [STANDALONE]='-h --help --version --private-network -b --boot --read-only -q --quiet --share-system --keep-unit --network-veth -j' ++ [ARG]='-D --directory -u --user --uuid --capability --drop-capability --link-journal --bind --bind-ro -M --machine ++ -S --slice --setenv -Z --selinux-context -L --selinux-apifs-context --register --network-interface --network-bridge ++ --personality' ++ ) ++ ++ _init_completion || return ++ ++ if __contains_word "$prev" ${OPTS[ARG]}; then ++ case $prev in ++ --directory|-D) ++ comps=$(compgen -A directory -- "$cur" ) ++ ;; ++ --user|-u) ++ comps=$( __get_users ) ++ ;; ++ --uuid) ++ comps='' ++ ;; ++ --capability) ++ comps='CAP_BLOCK_SUSPEND CAP_IPC_LOCK CAP_MAC_ADMIN CAP_MAC_OVERRIDE CAP_SYS_MODULE CAP_SYS_PACCT CAP_SYS_RAWIO ++ CAP_SYS_TIME CAP_SYSLOG CAP_WAKE_ALARM CAP_NET_ADMIN' ++ ;; ++ --drop-capability) ++ comps='CAP_AUDIT_CONTROL CAP_AUDIT_WRITE CAP_CHOWN CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH CAP_FOWNER CAP_FSETID ++ CAP_IPC_OWNER CAP_KILL CAP_LEASE CAP_LINUX_IMMUTABLE CAP_MKNOD CAP_NET_ADMIN CAP_NET_BIND_SERVICE ++ CAP_NET_BROADCAST CAP_NET_RAW CAP_SETFCAP CAP_SETGID CAP_SETPCAP CAP_SETUID CAP_SYS_ADMIN CAP_SYS_BOOT ++ CAP_SYS_CHROOT CAP_SYS_NICE CAP_SYS_PTRACE CAP_SYS_RESOURCE CAP_SYS_TTY_CONFIG' ++ ;; ++ --link-journal) ++ comps='no auto guest host' ++ ;; ++ --bind|--bind-ro) ++ comps='' ++ ;; ++ --machine|-M) ++ comps='' ++ ;; ++ --slice|-S) ++ comps=$( __get_slices ) ++ ;; ++ --setenv) ++ comps='' ++ ;; ++ --selinux-context|-Z) ++ comps='' ++ ;; ++ --selinux-apifs-context|-L) ++ comps='' ++ ;; ++ --register) ++ comps='yes no' ++ ;; ++ --network-interface) ++ comps='' ++ ;; ++ --network-bridge) ++ comps='' ++ ;; ++ --personality) ++ comps='x86 x86-64' ++ ;; ++ esac ++ COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) ++ return 0 ++ fi ++ ++ COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) ++} ++ ++complete -F _systemd_nspawn systemd-nspawn diff --git a/systemd.spec b/systemd.spec index e11fcdc..95b496f 100644 --- a/systemd.spec +++ b/systemd.spec @@ -36,6 +36,27 @@ Source4: listen.conf # Prevent accidental removal of the systemd package Source6: yum-protect-systemd.conf +# Patch series is available from http://cgit.freedesktop.org/systemd/systemd-stable/log/?h=v210-stable +# GIT_DIR=~/src/systemd/.git git format-patch-ab -M -N --no-signature v210..v210-stable +# i=1; for p in 0*patch;do printf "Patch%03d: %s\n" $i $p; ((i++));done +Patch001: 0001-login-fix-pos-array-allocation.patch +Patch002: 0002-login-set-pos-slot-to-fallback-on-pos-eviction.patch +Patch003: 0003-login-Allow-calling-org.freedesktop.login1.Seat.Swit.patch +Patch004: 0004-fix-typo-in-iDRAC-network-interface-name-irdac-idrac.patch +Patch005: 0005-Replace-var-run-with-run-in-remaining-places.patch +Patch006: 0006-Revert-back-to-var-run-at-a-couple-of-problems.patch +Patch007: 0007-README-document-that-var-run-must-be-a-symlink-run.patch +Patch008: 0008-Use-var-run-dbus-system_bus_socket-for-the-D-Bus-soc.patch +Patch009: 0009-mount-don-t-send-out-PropertiesChanged-message-if-ac.patch +Patch010: 0010-mount-don-t-fire-PropertiesChanged-signals-for-mount.patch +Patch011: 0011-logs-show-fix-corrupt-output-with-empty-messages.patch +Patch012: 0012-journalctl-refuse-extra-arguments-with-verify-and-si.patch +Patch013: 0013-cdrom_id-use-the-old-MMC-fallback.patch +Patch014: 0014-udev-rules-setup-tty-permissions-and-group-for-sclp_.patch +Patch015: 0015-architecture-Add-tilegx.patch +Patch016: 0016-nspawn-fix-detection-of-missing-proc-self-loginuid.patch +Patch017: 0017-bash-add-completion-for-systemd-nspawn.patch + # kernel-install patch for grubby, drop if grubby is obsolete Patch1000: kernel-install-grubby.patch @@ -233,6 +254,7 @@ systemd-journal-gatewayd serves journal events over the network using HTTP. --exclude test/.gitignore \ --exclude units/.gitignore \ --exclude units/user/.gitignore \ + --exclude src/libsystemd/sd-bus/PORTING-DBUS1 \ %{patches} %endif %ifarch ppc ppc64 @@ -635,21 +657,7 @@ getent passwd systemd-journal-gateway >/dev/null 2>&1 || useradd -r -l -u 191 -g %{_datadir}/polkit-1/actions/org.freedesktop.timedate1.policy %{_datadir}/pkgconfig/systemd.pc %{_datadir}/pkgconfig/udev.pc -%{_datadir}/bash-completion/completions/hostnamectl -%{_datadir}/bash-completion/completions/journalctl -%{_datadir}/bash-completion/completions/localectl -%{_datadir}/bash-completion/completions/loginctl -%{_datadir}/bash-completion/completions/systemctl -%{_datadir}/bash-completion/completions/systemd-coredumpctl -%{_datadir}/bash-completion/completions/timedatectl -%{_datadir}/bash-completion/completions/udevadm -%{_datadir}/bash-completion/completions/systemd-analyze -%{_datadir}/bash-completion/completions/kernel-install -%{_datadir}/bash-completion/completions/systemd-run -%{_datadir}/bash-completion/completions/busctl -%{_datadir}/bash-completion/completions/bootctl -%{_datadir}/bash-completion/completions/machinectl -%{_datadir}/bash-completion/completions/systemd-delta +%{_datadir}/bash-completion/completions/* %{_datadir}/zsh/site-functions/* %{_prefix}/lib/systemd/catalog/systemd.*.catalog %{_prefix}/lib/systemd/network/99-default.link @@ -724,6 +732,9 @@ getent passwd systemd-journal-gateway >/dev/null 2>&1 || useradd -r -l -u 191 -g %{_datadir}/systemd/gatewayd %changelog +* Sat Mar 01 2014 Zbigniew Jędrzejewski-Szmek - 210-3 +- Backport a few patches, add completion for systemd-nspawn. + * Fri Feb 28 2014 Zbigniew Jędrzejewski-Szmek - 210-3 - Apply work-arounds for ppc/ppc64 for bugs 1071278 and 1071284