mirror of
https://github.com/systemd/systemd.git
synced 2024-11-27 12:13:33 +08:00
build-sys: discover the path to kexec during build time
https://bugs.freedesktop.org/show_bug.cgi?id=55248
This commit is contained in:
parent
3a83211689
commit
7801356442
@ -165,6 +165,7 @@ AM_CPPFLAGS = \
|
||||
-DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
|
||||
-DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
|
||||
-DQUOTACHECK=\"$(QUOTACHECK)\" \
|
||||
-DKEXEC=\"$(KEXEC)\" \
|
||||
-I $(top_srcdir)/src \
|
||||
-I $(top_srcdir)/src/shared \
|
||||
-I $(top_srcdir)/src/login \
|
||||
|
@ -76,6 +76,8 @@ AC_PATH_PROG([KILL], [kill], [/usr/bin/kill])
|
||||
|
||||
AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod])
|
||||
|
||||
AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec])
|
||||
|
||||
# gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
|
||||
m4_ifdef([GTK_DOC_CHECK], [
|
||||
GTK_DOC_CHECK([1.18],[--flavour no-tmpl])],
|
||||
|
@ -318,7 +318,7 @@ int main(int argc, char *argv[]) {
|
||||
log_warning("kexec failed. Falling back to normal reboot.");
|
||||
} else {
|
||||
/* Child */
|
||||
const char *args[3] = { "/sbin/kexec", "-e", NULL };
|
||||
const char *args[3] = { KEXEC, "-e", NULL };
|
||||
execv(args[0], (char * const *) args);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ int manager_handle_action(
|
||||
else if (handle == HANDLE_HYBRID_SLEEP)
|
||||
supported = can_sleep("hybrid-sleep") > 0;
|
||||
else if (handle == HANDLE_KEXEC)
|
||||
supported = access("/sbin/kexec", X_OK) >= 0;
|
||||
supported = access(KEXEC, X_OK) >= 0;
|
||||
else
|
||||
supported = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user