diff options
author | Carlos Santos <casantos@datacom.com.br> | 2018-11-07 22:16:34 -0200 |
---|---|---|
committer | Peter Korsgaard <peter@korsgaard.com> | 2018-11-10 09:41:39 +0100 |
commit | dbb68d79732d59a5c3687b20a86602ce0987aaf9 (patch) | |
tree | d712bf01150a3169918326b47e3919daa4904c9f /package/util-linux/0001-rtcwake-use-poweroff-if-shutdown-is-not-found.patch | |
parent | 419fc6abca3911ee58ff5d092aa5e912ae65db93 (diff) | |
download | buildroot-dbb68d79732d59a5c3687b20a86602ce0987aaf9.tar.gz buildroot-dbb68d79732d59a5c3687b20a86602ce0987aaf9.zip |
util-linux: bump to version 2.33
- Update "basic set" help to include the new "choom" utility.
- Re-generate checksums for license files, whose names now follow the
SPDX License List.
- Pull a patch already applied upstream that make rtcwake use poweroff
if shutdown is not found (e.g. Busybox, which the default init system
on Buldroot).
- Pull a patch already submitted upstream to fix the output of escaped
characters by agetty.
Signed-off-by: Carlos Santos <casantos@datacom.com.br>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/util-linux/0001-rtcwake-use-poweroff-if-shutdown-is-not-found.patch')
-rw-r--r-- | package/util-linux/0001-rtcwake-use-poweroff-if-shutdown-is-not-found.patch | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/package/util-linux/0001-rtcwake-use-poweroff-if-shutdown-is-not-found.patch b/package/util-linux/0001-rtcwake-use-poweroff-if-shutdown-is-not-found.patch new file mode 100644 index 0000000000..b97be2ef07 --- /dev/null +++ b/package/util-linux/0001-rtcwake-use-poweroff-if-shutdown-is-not-found.patch @@ -0,0 +1,86 @@ +From e1686b25acdedb34cc357f08f0dd3ca01c559dfd Mon Sep 17 00:00:00 2001 +From: Justin Chen <justinpopo6@gmail.com> +Date: Thu, 1 Nov 2018 11:10:38 -0700 +Subject: [PATCH] rtcwake: use poweroff if shutdown is not found + +Some systems do not have the shutdown command. Use poweroff as an +alternative. + +Signed-off-by: Justin Chen <justinpopo6@gmail.com> +--- + include/pathnames.h | 1 + + sys-utils/rtcwake.c | 39 +++++++++++++++++++++++++++------------ + 2 files changed, 28 insertions(+), 12 deletions(-) + +diff --git a/include/pathnames.h b/include/pathnames.h +index 3d5052e6f..ed8ea330d 100644 +--- a/include/pathnames.h ++++ b/include/pathnames.h +@@ -53,6 +53,7 @@ + # define _PATH_LOGIN "/bin/login" + #endif + #define _PATH_SHUTDOWN "/sbin/shutdown" ++#define _PATH_POWEROFF "/sbin/poweroff" + + #define _PATH_TERMCOLORS_DIRNAME "terminal-colors.d" + #define _PATH_TERMCOLORS_DIR "/etc/" _PATH_TERMCOLORS_DIRNAME +diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c +index b63c64627..029f00f9b 100644 +--- a/sys-utils/rtcwake.c ++++ b/sys-utils/rtcwake.c +@@ -28,6 +28,7 @@ + #include <stdlib.h> + #include <string.h> + #include <sys/ioctl.h> ++#include <sys/stat.h> + #include <sys/time.h> + #include <sys/types.h> + #include <termios.h> +@@ -582,18 +583,32 @@ int main(int argc, char **argv) + char *arg[5]; + int i = 0; + +- if (ctl.verbose) +- printf(_("suspend mode: off; executing %s\n"), +- _PATH_SHUTDOWN); +- arg[i++] = _PATH_SHUTDOWN; +- arg[i++] = "-h"; +- arg[i++] = "-P"; +- arg[i++] = "now"; +- arg[i] = NULL; +- if (!ctl.dryrun) { +- execv(arg[0], arg); +- warn(_("failed to execute %s"), _PATH_SHUTDOWN); +- rc = EXIT_FAILURE; ++ if (!access(_PATH_SHUTDOWN, X_OK)) { ++ arg[i++] = _PATH_SHUTDOWN; ++ arg[i++] = "-h"; ++ arg[i++] = "-P"; ++ arg[i++] = "now"; ++ arg[i] = NULL; ++ } else if (!access(_PATH_POWEROFF, X_OK)) { ++ arg[i++] = _PATH_POWEROFF; ++ arg[i] = NULL; ++ } else { ++ arg[i] = NULL; ++ } ++ ++ if (arg[0]) { ++ if (ctl.verbose) ++ printf(_("suspend mode: off; executing %s\n"), ++ arg[0]); ++ if (!ctl.dryrun) { ++ execv(arg[0], arg); ++ warn(_("failed to execute %s"), arg[0]); ++ rc = EX_EXEC_ENOENT; ++ } ++ } else { ++ /* Failed to find shutdown command */ ++ warn(_("failed to find shutdown command")); ++ rc = EX_EXEC_ENOENT; + } + break; + } +-- +2.17.1 + |