summaryrefslogtreecommitdiff
path: root/kexec/arch/arm/kexec-arm.c
diff options
context:
space:
mode:
authorDave Young <dyoung@redhat.com>2015-11-23 15:04:23 +0800
committerSimon Horman <horms@verge.net.au>2015-11-24 16:04:10 +0900
commit4bad06c3cd2a989459458eadd78c703ac5a3b8b6 (patch)
tree751d05ca599529d1c4eb1174777e5d5725812b3d /kexec/arch/arm/kexec-arm.c
parent4580c372000b469c4292e548c806dfe5922e97d1 (diff)
arm: use /sys/firmware/fdt in case without --atags and --dtb
Latest linux kernel will create /sys/firmware/fdt file. It will be convenient to use it in case one does not specify --atags and --dtb options. Signed-off-by: Dave Young <dyoung@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/arm/kexec-arm.c')
-rw-r--r--kexec/arch/arm/kexec-arm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kexec/arch/arm/kexec-arm.c b/kexec/arch/arm/kexec-arm.c
index 10035f2..4e90e69 100644
--- a/kexec/arch/arm/kexec-arm.c
+++ b/kexec/arch/arm/kexec-arm.c
@@ -12,6 +12,7 @@
#include <stdint.h>
#include <string.h>
#include <getopt.h>
+#include <unistd.h>
#include "../../kexec.h"
#include "../../kexec-syscall.h"
#include "kexec-arm.h"
@@ -137,3 +138,9 @@ int arch_compat_trampoline(struct kexec_info *UNUSED(info))
void arch_update_purgatory(struct kexec_info *UNUSED(info))
{
}
+
+/* return 1 if /sys/firmware/fdt exists, otherwise return 0 */
+int have_sysfs_fdt(void)
+{
+ return !access(SYSFS_FDT, F_OK);
+}