summaryrefslogtreecommitdiff
path: root/pcr/systemd-knock/0001-shutdown-fix-arguments-to-run-initramfs-shutdown.patch
diff options
context:
space:
mode:
authorcoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2015-05-11 21:35:08 -0300
committercoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2015-05-11 21:35:08 -0300
commit345b8c4070212e489cfc754155bc8dfea4db17b3 (patch)
treead081c796dc4926227ce9b536266fe7c354b9d54 /pcr/systemd-knock/0001-shutdown-fix-arguments-to-run-initramfs-shutdown.patch
parent5b032464a13505085ad85bcc646b5181c11c6bf1 (diff)
downloadabslibre-345b8c4070212e489cfc754155bc8dfea4db17b3.tar.gz
abslibre-345b8c4070212e489cfc754155bc8dfea4db17b3.tar.bz2
abslibre-345b8c4070212e489cfc754155bc8dfea4db17b3.zip
mv aqsis,blender-addon-ogre,cambozola,cinepaint-lts,collada-dom,gimp-art,gimp-pcr,mednafen-server,mitsuba,nexuiz,nexuiz-data,noip,openssh-knock,python-pygame-hg,supermodel,systemd-knock,tupi,xcftools,yafaray,zoneminder to ssh://git@projects.parabola.nu/~git/pcr.git
Diffstat (limited to 'pcr/systemd-knock/0001-shutdown-fix-arguments-to-run-initramfs-shutdown.patch')
-rw-r--r--pcr/systemd-knock/0001-shutdown-fix-arguments-to-run-initramfs-shutdown.patch68
1 files changed, 0 insertions, 68 deletions
diff --git a/pcr/systemd-knock/0001-shutdown-fix-arguments-to-run-initramfs-shutdown.patch b/pcr/systemd-knock/0001-shutdown-fix-arguments-to-run-initramfs-shutdown.patch
deleted file mode 100644
index 5d48d17bc..000000000
--- a/pcr/systemd-knock/0001-shutdown-fix-arguments-to-run-initramfs-shutdown.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From 4b5d8d0f22ae61ceb45a25391354ba53b43ee992 Mon Sep 17 00:00:00 2001
-From: Michal Schmidt <mschmidt@redhat.com>
-Date: Thu, 6 Nov 2014 22:24:13 +0100
-Subject: [PATCH] shutdown: fix arguments to /run/initramfs/shutdown
-
-Our initrd interface specifies that the verb is in argv[1].
-This is where systemd passes it to systemd-shutdown, but getopt
-permutes argv[]. This confuses dracut's shutdown script:
- Shutdown called with argument '--log-level'. Rebooting!
-
-getopt can be convinced to not permute argv[] by having '-' as the first
-character of optstring. Let's use it. This requires changing the way
-non-option arguments (in our case, the verb) are processed.
-
-This fixes a bug where the system would reboot instead of powering off.
----
- src/core/shutdown.c | 17 +++++++++++------
- 1 file changed, 11 insertions(+), 6 deletions(-)
-
-diff --git a/src/core/shutdown.c b/src/core/shutdown.c
-index dd11ae3..48ed7fa 100644
---- a/src/core/shutdown.c
-+++ b/src/core/shutdown.c
-@@ -75,7 +75,9 @@ static int parse_argv(int argc, char *argv[]) {
- assert(argc >= 1);
- assert(argv);
-
-- while ((c = getopt_long(argc, argv, "", options, NULL)) >= 0)
-+ /* "-" prevents getopt from permuting argv[] and moving the verb away
-+ * from argv[1]. Our interface to initrd promises it'll be there. */
-+ while ((c = getopt_long(argc, argv, "-", options, NULL)) >= 0)
- switch (c) {
-
- case ARG_LOG_LEVEL:
-@@ -113,6 +115,13 @@ static int parse_argv(int argc, char *argv[]) {
-
- break;
-
-+ case '\001':
-+ if (!arg_verb)
-+ arg_verb = optarg;
-+ else
-+ log_error("Excess arguments, ignoring");
-+ break;
-+
- case '?':
- return -EINVAL;
-
-@@ -120,15 +129,11 @@ static int parse_argv(int argc, char *argv[]) {
- assert_not_reached("Unhandled option code.");
- }
-
-- if (optind >= argc) {
-+ if (!arg_verb) {
- log_error("Verb argument missing.");
- return -EINVAL;
- }
-
-- arg_verb = argv[optind];
--
-- if (optind + 1 < argc)
-- log_error("Excess arguments, ignoring");
- return 0;
- }
-
---
-2.1.3
-