From 40f28050404f839190300b624a337acaca2f4676c358eca9f19c89029e4349f9 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 9 Mar 2018 09:28:21 +0000 Subject: [PATCH] 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 --- 80-hotplug-cpu-mem.rules | 28 ++++++++++++++++++++-------- systemd-mini.changes | 27 +++++++++++++++++++++++++-- systemd-mini.spec | 34 ++++++++++++++++------------------ systemd.changes | 27 +++++++++++++++++++++++++-- systemd.spec | 34 ++++++++++++++++------------------ udev-remount-tmpfs | 15 --------------- 6 files changed, 102 insertions(+), 63 deletions(-) delete mode 100644 udev-remount-tmpfs diff --git a/80-hotplug-cpu-mem.rules b/80-hotplug-cpu-mem.rules index 9a9614df..86a6c272 100644 --- a/80-hotplug-cpu-mem.rules +++ b/80-hotplug-cpu-mem.rules @@ -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 /dev/null 2>&1 - STATE=$? - if [ "$STATE" -gt 0 ]; then - logger "Remount of $i failed with state $STATE" - fi - done -fi