From 74b2bf3650ae1a807fd5ca0ee5bd7e4cfef332d4c8caa943005b5e5316f78d1c Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Sat, 26 Apr 2014 09:45:02 +0000 Subject: [PATCH] Accepting request 230483 from Base:System - Extend avoid-divide-by-zero-sigtrap.patch to make the crash handler know about SIGTRAP and SIGSYS - Add avoid-divide-by-zero-sigtrap.patch which fixes bnc#867663 that is a divide by zero on a jobless system - Use latest regenerate-initrd rpm macros (fate#313506) - Add rescue-emergency-target-conflicts.patch to avoid that emergency and rescue sulogin are fighting on console - Modify systemd-sleep-grub to let hybrid-sleep.target work even on XEN, changes from Thomas Blume (bnc#873432) - Add backported upstream patch 0001-reduce-the-amount-of-messages-logged-to-dev-kmsg-whe.patch - Add patch systemd-detect-xendom.patch from Thomas Blume to be able to detect XEN dom0 as well as domU - systemd conflicts with sysvinit, ven if the package systemd-sysvinit does already conflict with sysvinit-init (bnc#873444) - Extend avoid-divide-by-zero-sigtrap.patch to make the crash handler know about SIGTRAP and SIGSYS - Add avoid-divide-by-zero-sigtrap.patch which fixes bnc#867663 that is a divide by zero on a jobless system - Use latest regenerate-initrd rpm macros (fate#313506) - Add rescue-emergency-target-conflicts.patch to avoid that emergency and rescue sulogin are fighting on console OBS-URL: https://build.opensuse.org/request/show/230483 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=182 --- ...t-of-messages-logged-to-dev-kmsg-whe.patch | 27 ++++++++++++ avoid-divide-by-zero-sigtrap.patch | 25 +++++++++++ rescue-emergency-target-conflicts.patch | 20 +++++++++ systemd-detect-xendom.patch | 35 ++++++++++++++++ systemd-mini.changes | 35 ++++++++++++++++ systemd-mini.spec | 42 +++++++++++++++++++ systemd-sleep-grub | 6 +-- systemd.changes | 35 ++++++++++++++++ systemd.spec | 42 +++++++++++++++++++ 9 files changed, 264 insertions(+), 3 deletions(-) create mode 100644 0001-reduce-the-amount-of-messages-logged-to-dev-kmsg-whe.patch create mode 100644 avoid-divide-by-zero-sigtrap.patch create mode 100644 rescue-emergency-target-conflicts.patch create mode 100644 systemd-detect-xendom.patch diff --git a/0001-reduce-the-amount-of-messages-logged-to-dev-kmsg-whe.patch b/0001-reduce-the-amount-of-messages-logged-to-dev-kmsg-whe.patch new file mode 100644 index 00000000..9d10cced --- /dev/null +++ b/0001-reduce-the-amount-of-messages-logged-to-dev-kmsg-whe.patch @@ -0,0 +1,27 @@ +Based on b2103dccb354de3f38c49c14ccb637bdf665e40f Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Sat, 5 Apr 2014 13:59:01 -0400 +Subject: [PATCH] reduce the amount of messages logged to /dev/kmsg when + "debug" is specified + +--- + src/core/main.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +--- src/core/main.c ++++ src/core/main.c 2014-04-14 13:50:48.490814738 +0000 +@@ -412,12 +412,8 @@ static int parse_proc_cmdline_word(const + if (arg_show_status == _SHOW_STATUS_UNSET) + arg_show_status = SHOW_STATUS_AUTO; + } else if (streq(word, "debug")) { +- /* Log to kmsg, the journal socket will fill up before the +- * journal is started and tools running during that time +- * will block with every log message for for 60 seconds, +- * before they give up. */ +- log_set_max_level(LOG_DEBUG); +- log_set_target(detect_container(NULL) > 0 ? LOG_TARGET_CONSOLE : LOG_TARGET_KMSG); ++ if (detect_container(NULL) > 0) ++ log_set_target(LOG_TARGET_CONSOLE); + } else if (!in_initrd()) { + unsigned i; + diff --git a/avoid-divide-by-zero-sigtrap.patch b/avoid-divide-by-zero-sigtrap.patch new file mode 100644 index 00000000..4f676e87 --- /dev/null +++ b/avoid-divide-by-zero-sigtrap.patch @@ -0,0 +1,25 @@ +Nasty bug reported on bnc#867663 + +--- systemd-210/src/core/manager.c ++++ systemd-210/src/core/manager.c 2014-04-17 13:29:07.366236714 +0000 +@@ -1780,7 +1780,8 @@ static int manager_dispatch_jobs_in_prog + assert(m); + assert(source); + +- manager_print_jobs_in_progress(m); ++ if (m->n_running_jobs > 0) ++ manager_print_jobs_in_progress(m); + + next = now(CLOCK_MONOTONIC) + JOBS_IN_PROGRESS_PERIOD_USEC; + r = sd_event_source_set_time(source, next); +--- systemd-210/src/shared/def.h ++++ systemd-210/src/shared/def.h 2014-04-17 13:47:10.946234983 +0000 +@@ -37,7 +37,7 @@ + + #define SYSTEMD_CGROUP_CONTROLLER "name=systemd" + +-#define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT ++#define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT,SIGTRAP,SIGSYS + #define SIGNALS_IGNORE SIGPIPE + + #define DIGITS "0123456789" diff --git a/rescue-emergency-target-conflicts.patch b/rescue-emergency-target-conflicts.patch new file mode 100644 index 00000000..f4f15988 --- /dev/null +++ b/rescue-emergency-target-conflicts.patch @@ -0,0 +1,20 @@ +--- systemd-210/units/emergency.target ++++ systemd-210/units/emergency.target 2014-04-15 11:11:18.618235831 +0000 +@@ -10,4 +10,5 @@ Description=Emergency Mode + Documentation=man:systemd.special(7) + Requires=emergency.service + After=emergency.service ++Conflicts=getty.target rescue.target + AllowIsolate=yes +--- systemd-210/units/rescue.target ++++ systemd-210/units/rescue.target 2014-04-15 11:14:40.606808928 +0000 +@@ -10,7 +10,8 @@ Description=Rescue Mode + Documentation=man:systemd.special(7) + Requires=sysinit.target rescue.service + After=sysinit.target rescue.service +-Conflicts=getty.target ++Conflicts=getty.target emergency.target ++Before=emergency.target + AllowIsolate=yes + + [Install] diff --git a/systemd-detect-xendom.patch b/systemd-detect-xendom.patch new file mode 100644 index 00000000..7c02a07a --- /dev/null +++ b/systemd-detect-xendom.patch @@ -0,0 +1,35 @@ +diff -Naur systemd-210/src/shared/virt.c systemd-210-mod/src/shared/virt.c +--- systemd-210/src/shared/virt.c 2014-02-24 15:38:03.909784909 +0100 ++++ systemd-210/src/shared/virt.c 2014-04-10 13:48:05.568766957 +0200 +@@ -149,7 +149,7 @@ + + /* Returns a short identifier for the various VM implementations */ + int detect_vm(const char **id) { +- _cleanup_free_ char *hvtype = NULL, *cpuinfo_contents = NULL; ++ _cleanup_free_ char *domcap = NULL, *cpuinfo_contents = NULL; + static thread_local int cached_found = -1; + static thread_local const char *cached_id = NULL; + const char *_id = NULL; +@@ -166,13 +166,18 @@ + /* Try high-level hypervisor sysfs file first: + * + * https://bugs.freedesktop.org/show_bug.cgi?id=61491 */ +- r = read_one_line_file("/sys/hypervisor/type", &hvtype); ++ r = read_one_line_file("/proc/xen/capabilities", &domcap); + if (r >= 0) { +- if (streq(hvtype, "xen")) { +- _id = "xen"; ++ if (strstr(domcap, "control_d")) { ++ r = 0; ++ _id = "xen-dom0"; ++ } else { + r = 1; +- goto finish; ++ _id = "xen-domU"; + } ++ ++ goto finish; ++ + } else if (r != -ENOENT) + return r; + diff --git a/systemd-mini.changes b/systemd-mini.changes index 8459a4a0..f6234b04 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,38 @@ +------------------------------------------------------------------- +Thu Apr 17 13:56:31 UTC 2014 - werner@suse.de + +- Extend avoid-divide-by-zero-sigtrap.patch to make the crash + handler know about SIGTRAP and SIGSYS + +------------------------------------------------------------------- +Thu Apr 17 13:37:06 UTC 2014 - werner@suse.de + +- Add avoid-divide-by-zero-sigtrap.patch which fixes bnc#867663 + that is a divide by zero on a jobless system + +------------------------------------------------------------------- +Wed Apr 16 10:17:13 UTC 2014 - werner@suse.de + +- Use latest regenerate-initrd rpm macros (fate#313506) +- Add rescue-emergency-target-conflicts.patch to avoid that + emergency and rescue sulogin are fighting on console + +------------------------------------------------------------------- +Tue Apr 15 12:19:24 UTC 2014 - werner@suse.de + +- Modify systemd-sleep-grub to let hybrid-sleep.target work even + on XEN, changes from Thomas Blume (bnc#873432) + +------------------------------------------------------------------- +Mon Apr 14 13:55:36 UTC 2014 - werner@suse.de + +- Add backported upstream patch + 0001-reduce-the-amount-of-messages-logged-to-dev-kmsg-whe.patch +- Add patch systemd-detect-xendom.patch from Thomas Blume + to be able to detect XEN dom0 as well as domU +- systemd conflicts with sysvinit, ven if the package systemd-sysvinit + does already conflict with sysvinit-init (bnc#873444) + ------------------------------------------------------------------- Thu Apr 10 10:17:47 UTC 2014 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index 25a939eb..abc3731a 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -45,6 +45,7 @@ BuildRequires: audit-devel BuildRequires: binutils-gold %endif %endif +BuildRequires: config(suse-module-tools) %if ! 0%{?bootstrap} BuildRequires: docbook-xsl-stylesheets %endif @@ -104,6 +105,9 @@ BuildRequires: pkgconfig(libseccomp) %endif BuildRequires: pkgconfig(libselinux) >= 2.1.9 BuildRequires: pkgconfig(libsepol) +%if 0%{?suse_version} > 1310 +Conflicts: sysvinit +%endif %if 0%{?bootstrap} #!BuildIgnore: dbus-1 Requires: this-is-only-for-build-envs @@ -375,6 +379,14 @@ Patch192: let-linker-find-libudev-for-libdevmapper.patch Patch193: portmap-wants-rpcbind-socket.patch # PATCH-FIX-USTREAM added at 2014/03/11 Patch194: 0007-dbus-suppress-duplicate-and-misleading-messages.patch +# PATCH-FIX-USTREAM added at 2014/03/14 +Patch195: 0001-reduce-the-amount-of-messages-logged-to-dev-kmsg-whe.patch +# PATCH-FIX-SUSE Detect XEN dom0 as well as domU +Patch196: systemd-detect-xendom.patch +# PATCH-FIX-SUSE Avoid that emergency and rescue sulogin are fighting on console +Patch197: rescue-emergency-target-conflicts.patch +# PATCH-FIX-SUSE Avoid a divide by zero sigtrap +Patch198: avoid-divide-by-zero-sigtrap.patch # UDEV PATCHES # ============ @@ -463,6 +475,17 @@ Group: System/Kernel Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html PreReq: /bin/rm /usr/bin/stat %insserv_prereq %fillup_prereq /usr/sbin/groupadd /usr/bin/getent /sbin/mkinitrd /usr/bin/sg_inq Requires(post): lib%{udevpkgname}%{udev_major} +Requires(post): sed +Requires(post): systemd +%if %{defined regenerate_initrd_post} +Requires(post): coreutils +Requires(postun): coreutils +Requires(posttrans): suse-module-tools +Requires(posttrans): /sbin/mkinitrd +%else +Requires(post): /sbin/mkinitrd +Requires(postun): /sbin/mkinitrd +%endif Conflicts: systemd < 39 Conflicts: aaa_base < 11.5 Conflicts: filesystem < 11.5 @@ -737,6 +760,10 @@ cp %{SOURCE7} m4/ %patch192 -p1 %patch193 -p1 %patch194 -p0 +%patch195 -p0 +%patch196 -p1 +%patch197 -p1 +%patch198 -p1 # udev patches %patch1001 -p1 @@ -1121,9 +1148,14 @@ if [ "${YAST_IS_RUNNING}" != "instsys" ]; then if [ -e %{_localstatedir}/lib/no_initrd_recreation_by_suspend ]; then echo "Skipping recreation of existing initial ramdisks, due" echo "to presence of %{_localstatedir}/lib/no_initrd_recreation_by_suspend" +%if %{defined regenerate_initrd_post} + else + %regenerate_initrd_post +%else elif [ -x /sbin/mkinitrd ]; then [ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup /sbin/mkinitrd || : +%endif fi fi @@ -1135,12 +1167,22 @@ if [ "${YAST_IS_RUNNING}" != "instsys" ]; then if [ -e %{_localstatedir}/lib/no_initrd_recreation_by_suspend ]; then echo "Skipping recreation of existing initial ramdisks, due" echo "to presence of %{_localstatedir}/lib/no_initrd_recreation_by_suspend" +%if %{defined regenerate_initrd_post} + else + %regenerate_initrd_post +%else elif [ -x /sbin/mkinitrd ]; then [ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup /sbin/mkinitrd || : +%endif fi fi +%if %{defined regenerate_initrd_post} +%posttrans -n %{udevpkgname} +%regenerate_initrd_posttrans +%endif + %post -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig %postun -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig diff --git a/systemd-sleep-grub b/systemd-sleep-grub index beeed387..5cd8bef3 100644 --- a/systemd-sleep-grub +++ b/systemd-sleep-grub @@ -50,10 +50,10 @@ getkernels-grub2() fi ;; - linux*noresume*) + linux*noresume*|module*xen*noresume*) echo " Skipping grub entry #${J}, because it has the noresume option" >&2 ;; - linux*root=*) + linux*root=*|module*xen*root=*) local ROOT ROOT=${LINE#*root=} DUMMY=($ROOT) @@ -77,7 +77,7 @@ getkernels-grub2() # DEBUG "Found kernel entry #${I}: '${DUMMY[1]##*/}'" INFO let I++ ;; - linux*) + linux*|module*xen*) # a kernel without "root="? We better skip that one... echo " Skipping grub entry #${J}, because it has no root= option" >&2 ;; diff --git a/systemd.changes b/systemd.changes index 8459a4a0..f6234b04 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,38 @@ +------------------------------------------------------------------- +Thu Apr 17 13:56:31 UTC 2014 - werner@suse.de + +- Extend avoid-divide-by-zero-sigtrap.patch to make the crash + handler know about SIGTRAP and SIGSYS + +------------------------------------------------------------------- +Thu Apr 17 13:37:06 UTC 2014 - werner@suse.de + +- Add avoid-divide-by-zero-sigtrap.patch which fixes bnc#867663 + that is a divide by zero on a jobless system + +------------------------------------------------------------------- +Wed Apr 16 10:17:13 UTC 2014 - werner@suse.de + +- Use latest regenerate-initrd rpm macros (fate#313506) +- Add rescue-emergency-target-conflicts.patch to avoid that + emergency and rescue sulogin are fighting on console + +------------------------------------------------------------------- +Tue Apr 15 12:19:24 UTC 2014 - werner@suse.de + +- Modify systemd-sleep-grub to let hybrid-sleep.target work even + on XEN, changes from Thomas Blume (bnc#873432) + +------------------------------------------------------------------- +Mon Apr 14 13:55:36 UTC 2014 - werner@suse.de + +- Add backported upstream patch + 0001-reduce-the-amount-of-messages-logged-to-dev-kmsg-whe.patch +- Add patch systemd-detect-xendom.patch from Thomas Blume + to be able to detect XEN dom0 as well as domU +- systemd conflicts with sysvinit, ven if the package systemd-sysvinit + does already conflict with sysvinit-init (bnc#873444) + ------------------------------------------------------------------- Thu Apr 10 10:17:47 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 2a626ba8..e31a1834 100644 --- a/systemd.spec +++ b/systemd.spec @@ -40,6 +40,7 @@ BuildRequires: audit-devel BuildRequires: binutils-gold %endif %endif +BuildRequires: config(suse-module-tools) %if ! 0%{?bootstrap} BuildRequires: docbook-xsl-stylesheets %endif @@ -99,6 +100,9 @@ BuildRequires: pkgconfig(libseccomp) %endif BuildRequires: pkgconfig(libselinux) >= 2.1.9 BuildRequires: pkgconfig(libsepol) +%if 0%{?suse_version} > 1310 +Conflicts: sysvinit +%endif %if 0%{?bootstrap} #!BuildIgnore: dbus-1 Requires: this-is-only-for-build-envs @@ -370,6 +374,14 @@ Patch192: let-linker-find-libudev-for-libdevmapper.patch Patch193: portmap-wants-rpcbind-socket.patch # PATCH-FIX-USTREAM added at 2014/03/11 Patch194: 0007-dbus-suppress-duplicate-and-misleading-messages.patch +# PATCH-FIX-USTREAM added at 2014/03/14 +Patch195: 0001-reduce-the-amount-of-messages-logged-to-dev-kmsg-whe.patch +# PATCH-FIX-SUSE Detect XEN dom0 as well as domU +Patch196: systemd-detect-xendom.patch +# PATCH-FIX-SUSE Avoid that emergency and rescue sulogin are fighting on console +Patch197: rescue-emergency-target-conflicts.patch +# PATCH-FIX-SUSE Avoid a divide by zero sigtrap +Patch198: avoid-divide-by-zero-sigtrap.patch # UDEV PATCHES # ============ @@ -458,6 +470,17 @@ Group: System/Kernel Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html PreReq: /bin/rm /usr/bin/stat %insserv_prereq %fillup_prereq /usr/sbin/groupadd /usr/bin/getent /sbin/mkinitrd /usr/bin/sg_inq Requires(post): lib%{udevpkgname}%{udev_major} +Requires(post): sed +Requires(post): systemd +%if %{defined regenerate_initrd_post} +Requires(post): coreutils +Requires(postun): coreutils +Requires(posttrans): suse-module-tools +Requires(posttrans): /sbin/mkinitrd +%else +Requires(post): /sbin/mkinitrd +Requires(postun): /sbin/mkinitrd +%endif Conflicts: systemd < 39 Conflicts: aaa_base < 11.5 Conflicts: filesystem < 11.5 @@ -732,6 +755,10 @@ cp %{SOURCE7} m4/ %patch192 -p1 %patch193 -p1 %patch194 -p0 +%patch195 -p0 +%patch196 -p1 +%patch197 -p1 +%patch198 -p1 # udev patches %patch1001 -p1 @@ -1116,9 +1143,14 @@ if [ "${YAST_IS_RUNNING}" != "instsys" ]; then if [ -e %{_localstatedir}/lib/no_initrd_recreation_by_suspend ]; then echo "Skipping recreation of existing initial ramdisks, due" echo "to presence of %{_localstatedir}/lib/no_initrd_recreation_by_suspend" +%if %{defined regenerate_initrd_post} + else + %regenerate_initrd_post +%else elif [ -x /sbin/mkinitrd ]; then [ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup /sbin/mkinitrd || : +%endif fi fi @@ -1130,12 +1162,22 @@ if [ "${YAST_IS_RUNNING}" != "instsys" ]; then if [ -e %{_localstatedir}/lib/no_initrd_recreation_by_suspend ]; then echo "Skipping recreation of existing initial ramdisks, due" echo "to presence of %{_localstatedir}/lib/no_initrd_recreation_by_suspend" +%if %{defined regenerate_initrd_post} + else + %regenerate_initrd_post +%else elif [ -x /sbin/mkinitrd ]; then [ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup /sbin/mkinitrd || : +%endif fi fi +%if %{defined regenerate_initrd_post} +%posttrans -n %{udevpkgname} +%regenerate_initrd_posttrans +%endif + %post -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig %postun -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig