summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--utils/Makefile.am3
-rw-r--r--utils/hooks/01-create-default-dtb11
2 files changed, 13 insertions, 1 deletions
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 2d7fe2d..c1ff586 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -30,6 +30,7 @@ pb_event_SOURCES = pb-event.c
dist_pkgdata_DATA = \
kboot.conf.sample \
bb-kexec-reboot \
- logrotate.conf
+ logrotate.conf \
+ hooks/01-create-default-dtb
MAINTAINERCLEANFILES = Makefile.in
diff --git a/utils/hooks/01-create-default-dtb b/utils/hooks/01-create-default-dtb
new file mode 100644
index 0000000..82c25a2
--- /dev/null
+++ b/utils/hooks/01-create-default-dtb
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+[ -n "$boot_dtb" ] && exit;
+[ ! -e /proc/device-tree ] && exit
+
+dtb=$(mktemp)
+
+dtc -I fs -O dtb -o $dtb /proc/device-tree
+
+echo "boot_dtb=$dtb"
+exit 2
OpenPOWER on IntegriCloud