dtc,petitboot: Sort device tree properties by unit number

Currently, dtc will output nodes unordered, which may cause issues when
assigning CPU numbers to NUMA nodes.

This change incorporates a pre-kexec hook to sort the device tree, and
a fix for dtc to order nodes by their unit number, to get a proper
sort ordering.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
diff --git a/openpower/package/petitboot/petitboot.mk b/openpower/package/petitboot/petitboot.mk
index eec280d..d26f564 100644
--- a/openpower/package/petitboot/petitboot.mk
+++ b/openpower/package/petitboot/petitboot.mk
@@ -37,6 +37,8 @@
 		$(TARGET_DIR)/etc/petitboot/boot.d/
 	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/20-set-stdout \
 		$(TARGET_DIR)/etc/petitboot/boot.d/
+	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/90-sort-dtb \
+		$(TARGET_DIR)/etc/petitboot/boot.d/
 
 	$(INSTALL) -D -m 0755 $(BR2_EXTERNAL)/package/petitboot/S14silence-console \
 		$(TARGET_DIR)/etc/init.d/