SHA256
1
0
forked from pool/systemd
Dr. Werner Fink 2014-02-20 12:23:32 +00:00 committed by Git OBS Bridge
parent 06f74989ab
commit a00958e919
2 changed files with 27 additions and 11 deletions

View File

@ -10,11 +10,11 @@ systemctl command as well as for the systemd-shutdown utility.
src/core/shutdown.c | 8 -
src/shared/hdflush.c | 365 ++++++++++++++++++++++++++++++++++++++++++++++
src/shared/hdflush.h | 25 +++
src/systemctl/systemctl.c | 17 +-
6 files changed, 416 insertions(+), 8 deletions(-)
src/systemctl/systemctl.c | 25 ++-
6 files changed, 424 insertions(+), 8 deletions(-)
--- systemd-208/Makefile.am
+++ systemd-208/Makefile.am 2014-01-28 11:06:55.638238060 +0000
+++ systemd-208/Makefile.am 2014-01-28 11:06:56.000000000 +0000
@@ -680,6 +680,8 @@ libsystemd_shared_la_SOURCES = \
src/shared/strbuf.h \
src/shared/strxcpyx.c \
@ -25,7 +25,7 @@ systemctl command as well as for the systemd-shutdown utility.
src/shared/conf-parser.h \
src/shared/log.c \
--- systemd-208/Makefile.in
+++ systemd-208/Makefile.in 2014-01-28 11:06:33.942246196 +0000
+++ systemd-208/Makefile.in 2014-01-28 11:06:34.000000000 +0000
@@ -1509,7 +1509,7 @@ am_libsystemd_shared_la_OBJECTS = src/sh
src/shared/hashmap.lo src/shared/set.lo src/shared/fdset.lo \
src/shared/prioq.lo src/shared/sleep-config.lo \
@ -62,7 +62,7 @@ systemctl command as well as for the systemd-shutdown utility.
@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/time-util.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/unit-name.Plo@am__quote@
--- systemd-208/src/shared/hdflush.c
+++ systemd-208/src/shared/hdflush.c 2014-01-28 10:58:56.490735704 +0000
+++ systemd-208/src/shared/hdflush.c 2014-01-28 10:58:56.000000000 +0000
@@ -0,0 +1,365 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
@ -430,7 +430,7 @@ systemctl command as well as for the systemd-shutdown utility.
+}
+#endif
--- systemd-208/src/shared/hdflush.h
+++ systemd-208/src/shared/hdflush.h 2014-01-28 11:00:08.286235696 +0000
+++ systemd-208/src/shared/hdflush.h 2014-01-28 11:00:08.000000000 +0000
@@ -0,0 +1,25 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
@ -458,7 +458,7 @@ systemctl command as well as for the systemd-shutdown utility.
+void hdflush(void);
+void hddown(void);
--- systemd-208/src/core/shutdown.c
+++ systemd-208/src/core/shutdown.c 2014-01-28 11:14:15.722235591 +0000
+++ systemd-208/src/core/shutdown.c 2014-01-28 11:14:16.000000000 +0000
@@ -40,6 +40,7 @@
#include "missing.h"
#include "log.h"
@ -483,7 +483,7 @@ systemctl command as well as for the systemd-shutdown utility.
if (cmd == LINUX_REBOOT_CMD_KEXEC) {
--- systemd-208/src/systemctl/systemctl.c
+++ systemd-208/src/systemctl/systemctl.c 2014-01-28 11:31:27.150735613 +0000
+++ systemd-208/src/systemctl/systemctl.c 2014-02-20 11:53:11.350234762 +0000
@@ -87,6 +87,7 @@ static bool arg_no_pager = false;
static bool arg_no_wtmp = false;
static bool arg_no_wall = false;
@ -515,15 +515,25 @@ systemctl command as well as for the systemd-shutdown utility.
case '?':
return -EINVAL;
@@ -5981,14 +5986,14 @@ static int halt_now(enum action a) {
@@ -5979,16 +5984,24 @@ static int halt_now(enum action a) {
* point on... */
reboot(RB_ENABLE_CAD);
switch (a) {
- switch (a) {
+ if (!arg_no_sync)
+ sync();
- case ACTION_HALT:
- log_info("Halting.");
- reboot(RB_HALT_SYSTEM);
- return -errno;
-
+ if (a == ACTION_POWEROFF || a == ACTION_HALT)
+ hddown();
+ else
+ hdflush();
+
+ switch (a) {
case ACTION_POWEROFF:
log_info("Powering off.");
reboot(RB_POWER_OFF);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Feb 20 12:22:15 UTC 2014 - werner@suse.de
- Modify patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch
to do a final sync() and flush the disks
-------------------------------------------------------------------
Fri Feb 14 16:03:16 UTC 2014 - werner@suse.de