Accepting request 584640 from home:fbui:systemd:Factory

- Fix hotplug memory in 80-hotplug-cpu-mem.rules
- Make sure /var/lib/machines is created when systemd-container is installed

OBS-URL: https://build.opensuse.org/request/show/584640
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1019
This commit is contained in:
Franck Bui 2018-03-09 09:28:21 +00:00 committed by Git OBS Bridge
parent 8ebe0a756c
commit 280afe7488
6 changed files with 102 additions and 63 deletions

View File

@ -1,12 +1,24 @@
# do not edit this file, it will be overwritten on update
#
# Hotplug physical CPU
SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", \
ATTR{online}="1"
#
SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", ATTR{online}="1"
# Hotplug physical memory
SUBSYSTEM=="memory", ACTION=="add", PROGRAM="/usr/bin/systemd-detect-virt", RESULT!="zvm", ATTR{state}=="offline", \
ATTR{state}="online", TAG+="tmpfs"
# See bnc#869603
TAG=="tmpfs", RUN+="/usr/lib/udev/remount-tmpfs"
#
# Hotplug physical memory. Instances of tmpfs are remounted so their
# size are recalculated. This might be needed if some sizes were
# specified relative to the total amount of memory (boo#869603). For
# now make it simple and remount all tmpfs regardless of how their
# size are specified. It should be handled by the kernel as it has a
# lot of shortcomings anyways (tmpfs mounted by other processes, mount
# namespaces, ...)
#
SUBSYSTEM=="memory", ACTION=="add", PROGRAM=="/usr/bin/systemd-detect-virt", RESULT!="zvm", ATTR{state}=="offline", \
ATTR{state}="online", \
RUN+="/bin/sh -c ' \
while read src dst fs opts unused; do \
case $fs in \
tmpfs) mount -o remount \"$dst\" ;; \
esac \
done </proc/self/mounts"

View File

@ -1,3 +1,26 @@
-------------------------------------------------------------------
Thu Mar 8 15:22:10 UTC 2018 - fbui@suse.com
- Remove udev-remount-tmpfs script
Complete the previous commit.
-------------------------------------------------------------------
Thu Mar 8 14:31:16 UTC 2018 - fbui@suse.com
- Fix hotplug memory in 80-hotplug-cpu-mem.rules
When new memory was hotplugged, the rule was supposed to call an
external script (udev-remount-tmpfs) to remount all tmpfs. However
the script was broken since its introduction (commit rev=715,
14/07/2014) and had no effects... this makes me wonder if we
shouldn't get rid of this...
-------------------------------------------------------------------
Wed Mar 7 14:34:22 UTC 2018 - fbui@suse.com
- Make sure /var/lib/machines is created when systemd-container is installed
-------------------------------------------------------------------
Thu Mar 1 10:43:09 UTC 2018 - fbui@suse.com
@ -12,8 +35,8 @@ Thu Mar 1 10:13:02 UTC 2018 - fbui@suse.com
Udev rules 60-ssd-scheduler.rules and 80-hotplug-cpu-mem.rules have
been removed from the git repo and are now maintained at the package
level. Those rules have been rejected by upstream and are defining
some defaults which should maintain by the kernel folks.
level. Those rules have been rejected by upstream as they seem to be
written to workaround some kernel shortcomings...
-------------------------------------------------------------------
Wed Feb 28 06:53:02 UTC 2018 - Thomas.Blume@suse.com

View File

@ -52,7 +52,7 @@ Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 237
Release: 0
Summary: A System and Session Manager
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Base
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if ! 0%{?bootstrap}
@ -154,7 +154,6 @@ Source200: scripts-udev-convert-lib-udev-path.sh
Source1000: 60-ssd-scheduler.rules
Source1001: 80-hotplug-cpu-mem.rules
Source1002: 99-wakeup-from-idle.rules
Source1003: udev-remount-tmpfs
# Patches listed in here are put in quarantine. Normally all
# changes must go to upstream first and then are cherry-picked in the
@ -175,7 +174,7 @@ drop-in replacement for sysvinit.
%package devel
Summary: Development headers for systemd
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: Development/Libraries/C and C++
Requires: libsystemd0%{?mini} = %{version}-%{release}
Requires: systemd-rpm-macros
@ -188,7 +187,7 @@ Development headers and auxiliary files for developing applications for systemd.
%package sysvinit
Summary: System V init tools
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Base
Requires: %{name} = %{version}-%{release}
Provides: sbin_init
@ -200,7 +199,7 @@ Drop-in replacement of System V init tools.
%package -n libsystemd0%{?mini}
Summary: Component library for systemd
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Libraries
%if 0%{?bootstrap}
Conflicts: libsystemd0
@ -230,7 +229,7 @@ This library provides several of the systemd C APIs:
%package -n udev%{?mini}
Summary: A rule-based device node and kernel event manager
License: GPL-2.0
License: GPL-2.0-only
Group: System/Kernel
Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
Requires: system-group-hardware
@ -267,7 +266,7 @@ call tools to initialize a device, or load needed kernel modules.
%package -n libudev%{?mini}1
Summary: Dynamic library to access udev device information
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Libraries
%if 0%{?bootstrap}
Conflicts: libudev1
@ -282,7 +281,7 @@ access to udev device information
%package -n libudev%{?mini}-devel
Summary: Development files for libudev
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: Development/Libraries/Other
Requires: libudev%{?mini}1 = %{version}-%{release}
%if 0%{?bootstrap}
@ -297,7 +296,7 @@ dynamic library, which provides access to udev device information.
%package container
Summary: Systemd tools for container management
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Base
Requires: %{name} = %{version}-%{release}
%systemd_requires
@ -312,7 +311,7 @@ and systemd-importd.
%if ! 0%{?bootstrap}
%package logger
Summary: Journal only logging
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Base
Provides: syslog
Provides: sysvinit(syslog)
@ -324,7 +323,7 @@ This package marks the installation to not use syslog but only the journal.
%package -n nss-systemd
Summary: Plugin for local virtual host name resolution
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Libraries
%description -n nss-systemd
@ -337,7 +336,7 @@ To activate this NSS module, you will need to include it in
%package -n nss-myhostname
Summary: Plugin for local system host name resolution
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Libraries
%description -n nss-myhostname
@ -354,7 +353,7 @@ To activate this NSS module, you will need to include it in
%if %{with resolved}
%package -n nss-resolve
Summary: Plugin for local hostname resolution via systemd-resolved
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
@ -371,7 +370,7 @@ To activate this NSS module, you will need to include it in
%if %{with machined}
%package -n nss-mymachines
Summary: Plugin for local virtual host name resolution
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Libraries
%description -n nss-mymachines
@ -388,7 +387,7 @@ To activate this NSS module, you will need to include it in
%if %{with journal_remote}
%package journal-remote
Summary: Gateway for serving journal events over the network using HTTP
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Base
Requires: %{name} = %{version}-%{release}
Requires(post): systemd
@ -407,7 +406,7 @@ systemd-journal-remote, and systemd-journal-upload.
%package bash-completion
Summary: Bash completion support for systemd
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Base
Requires: bash-completion
BuildArch: noarch
@ -499,7 +498,6 @@ install -m0755 -D %{S:12} %{buildroot}/%{_prefix}/lib/systemd/systemd-sysv-insta
install -m0644 -D %{S:1000} %{buildroot}%{_udevrulesdir}/60-ssd-scheduler.rules
install -m0644 -D %{S:1001} %{buildroot}%{_udevrulesdir}/80-hotplug-cpu-mem.rules
install -m0644 -D %{S:1002} %{buildroot}%{_udevrulesdir}/99-wakeup-from-idle.rules
install -m0755 -D %{S:1003} %{buildroot}/%{_prefix}/lib/udev/remount-tmpfs
# Package the scripts used to fix all packaging issues. Also drop the
# "scripts-{systemd/udev}" prefix which is used because osc doesn't
@ -784,6 +782,7 @@ systemctl daemon-reload || :
%if ! 0%{?bootstrap}
%post container
%tmpfiles_create systemd-nspawn.conf
if [ $1 -gt 1 ]; then
# Convert /var/lib/machines subvolume to make it suitable for
# rollbacks, if needed. See bsc#992573. The installer has been fixed
@ -1177,7 +1176,6 @@ fi
%{_prefix}/lib/udev/mtd_probe
%{_prefix}/lib/udev/scsi_id
%{_prefix}/lib/udev/v4l_id
%{_prefix}/lib/udev/remount-tmpfs
%ghost %{_prefix}/lib/udev/compat-symlink-generation
%dir %{_udevrulesdir}/
%exclude %{_udevrulesdir}/70-uaccess.rules

View File

@ -1,3 +1,26 @@
-------------------------------------------------------------------
Thu Mar 8 15:22:10 UTC 2018 - fbui@suse.com
- Remove udev-remount-tmpfs script
Complete the previous commit.
-------------------------------------------------------------------
Thu Mar 8 14:31:16 UTC 2018 - fbui@suse.com
- Fix hotplug memory in 80-hotplug-cpu-mem.rules
When new memory was hotplugged, the rule was supposed to call an
external script (udev-remount-tmpfs) to remount all tmpfs. However
the script was broken since its introduction (commit rev=715,
14/07/2014) and had no effects... this makes me wonder if we
shouldn't get rid of this...
-------------------------------------------------------------------
Wed Mar 7 14:34:22 UTC 2018 - fbui@suse.com
- Make sure /var/lib/machines is created when systemd-container is installed
-------------------------------------------------------------------
Thu Mar 1 10:43:09 UTC 2018 - fbui@suse.com
@ -12,8 +35,8 @@ Thu Mar 1 10:13:02 UTC 2018 - fbui@suse.com
Udev rules 60-ssd-scheduler.rules and 80-hotplug-cpu-mem.rules have
been removed from the git repo and are now maintained at the package
level. Those rules have been rejected by upstream and are defining
some defaults which should maintain by the kernel folks.
level. Those rules have been rejected by upstream as they seem to be
written to workaround some kernel shortcomings...
-------------------------------------------------------------------
Wed Feb 28 06:53:02 UTC 2018 - Thomas.Blume@suse.com

View File

@ -50,7 +50,7 @@ Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 237
Release: 0
Summary: A System and Session Manager
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Base
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if ! 0%{?bootstrap}
@ -152,7 +152,6 @@ Source200: scripts-udev-convert-lib-udev-path.sh
Source1000: 60-ssd-scheduler.rules
Source1001: 80-hotplug-cpu-mem.rules
Source1002: 99-wakeup-from-idle.rules
Source1003: udev-remount-tmpfs
# Patches listed in here are put in quarantine. Normally all
# changes must go to upstream first and then are cherry-picked in the
@ -173,7 +172,7 @@ drop-in replacement for sysvinit.
%package devel
Summary: Development headers for systemd
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: Development/Libraries/C and C++
Requires: libsystemd0%{?mini} = %{version}-%{release}
Requires: systemd-rpm-macros
@ -186,7 +185,7 @@ Development headers and auxiliary files for developing applications for systemd.
%package sysvinit
Summary: System V init tools
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Base
Requires: %{name} = %{version}-%{release}
Provides: sbin_init
@ -198,7 +197,7 @@ Drop-in replacement of System V init tools.
%package -n libsystemd0%{?mini}
Summary: Component library for systemd
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Libraries
%if 0%{?bootstrap}
Conflicts: libsystemd0
@ -228,7 +227,7 @@ This library provides several of the systemd C APIs:
%package -n udev%{?mini}
Summary: A rule-based device node and kernel event manager
License: GPL-2.0
License: GPL-2.0-only
Group: System/Kernel
Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
Requires: system-group-hardware
@ -265,7 +264,7 @@ call tools to initialize a device, or load needed kernel modules.
%package -n libudev%{?mini}1
Summary: Dynamic library to access udev device information
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Libraries
%if 0%{?bootstrap}
Conflicts: libudev1
@ -280,7 +279,7 @@ access to udev device information
%package -n libudev%{?mini}-devel
Summary: Development files for libudev
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: Development/Libraries/Other
Requires: libudev%{?mini}1 = %{version}-%{release}
%if 0%{?bootstrap}
@ -295,7 +294,7 @@ dynamic library, which provides access to udev device information.
%package container
Summary: Systemd tools for container management
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Base
Requires: %{name} = %{version}-%{release}
%systemd_requires
@ -310,7 +309,7 @@ and systemd-importd.
%if ! 0%{?bootstrap}
%package logger
Summary: Journal only logging
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Base
Provides: syslog
Provides: sysvinit(syslog)
@ -322,7 +321,7 @@ This package marks the installation to not use syslog but only the journal.
%package -n nss-systemd
Summary: Plugin for local virtual host name resolution
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Libraries
%description -n nss-systemd
@ -335,7 +334,7 @@ To activate this NSS module, you will need to include it in
%package -n nss-myhostname
Summary: Plugin for local system host name resolution
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Libraries
%description -n nss-myhostname
@ -352,7 +351,7 @@ To activate this NSS module, you will need to include it in
%if %{with resolved}
%package -n nss-resolve
Summary: Plugin for local hostname resolution via systemd-resolved
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
@ -369,7 +368,7 @@ To activate this NSS module, you will need to include it in
%if %{with machined}
%package -n nss-mymachines
Summary: Plugin for local virtual host name resolution
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Libraries
%description -n nss-mymachines
@ -386,7 +385,7 @@ To activate this NSS module, you will need to include it in
%if %{with journal_remote}
%package journal-remote
Summary: Gateway for serving journal events over the network using HTTP
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Base
Requires: %{name} = %{version}-%{release}
Requires(post): systemd
@ -405,7 +404,7 @@ systemd-journal-remote, and systemd-journal-upload.
%package bash-completion
Summary: Bash completion support for systemd
License: LGPL-2.1+
License: LGPL-2.1-or-later
Group: System/Base
Requires: bash-completion
BuildArch: noarch
@ -497,7 +496,6 @@ install -m0755 -D %{S:12} %{buildroot}/%{_prefix}/lib/systemd/systemd-sysv-insta
install -m0644 -D %{S:1000} %{buildroot}%{_udevrulesdir}/60-ssd-scheduler.rules
install -m0644 -D %{S:1001} %{buildroot}%{_udevrulesdir}/80-hotplug-cpu-mem.rules
install -m0644 -D %{S:1002} %{buildroot}%{_udevrulesdir}/99-wakeup-from-idle.rules
install -m0755 -D %{S:1003} %{buildroot}/%{_prefix}/lib/udev/remount-tmpfs
# Package the scripts used to fix all packaging issues. Also drop the
# "scripts-{systemd/udev}" prefix which is used because osc doesn't
@ -782,6 +780,7 @@ systemctl daemon-reload || :
%if ! 0%{?bootstrap}
%post container
%tmpfiles_create systemd-nspawn.conf
if [ $1 -gt 1 ]; then
# Convert /var/lib/machines subvolume to make it suitable for
# rollbacks, if needed. See bsc#992573. The installer has been fixed
@ -1175,7 +1174,6 @@ fi
%{_prefix}/lib/udev/mtd_probe
%{_prefix}/lib/udev/scsi_id
%{_prefix}/lib/udev/v4l_id
%{_prefix}/lib/udev/remount-tmpfs
%ghost %{_prefix}/lib/udev/compat-symlink-generation
%dir %{_udevrulesdir}/
%exclude %{_udevrulesdir}/70-uaccess.rules

View File

@ -1,15 +0,0 @@
#!/bin/sh
PATH=/usr/bin:/bin:/usr/sbin:/sbin
DIR=$(sed -rn '/^#/d;\@^[[:graph:]]+[[:space:]]+/[[:graph:]]+[[:space:]]+tmpfs[[:space:]]+.*size=[0-9]+[kmg,[:space:]]@{ s@^[[:graph:]]+[[:space:]]+(/[[:graph:]]+).*@\1@p }' /etc/fstab)
if [ -n "$DIR" ]; then
for i in $DIR; do
echo $i
mount -o remount "$i" >/dev/null 2>&1
STATE=$?
if [ "$STATE" -gt 0 ]; then
logger "Remount of $i failed with state $STATE"
fi
done
fi