]> git.ozlabs.org Git - petitboot/commitdiff
hooks/set-stdout: move hook to after automatic stdout settings v1.2.2
authorJeremy Kerr <jk@ozlabs.org>
Fri, 5 Aug 2016 07:05:12 +0000 (15:05 +0800)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Mon, 8 Aug 2016 06:39:40 +0000 (16:39 +1000)
If a console is defined in NVRAM, we want it to take precedence over
anything that 30-add-offb calculates automatically. This change shifts
the 20-set-stdout script to later in the hook processing, so that it
will override any automatic settings.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
utils/Makefile.am
utils/hooks/20-set-stdout [deleted file]
utils/hooks/80-set-stdout [new file with mode: 0755]

index f1b852e2fe865743532632e4ac7ce501b80789aa..2bbfb9c19b9988ff62f88b03bcc1330414d2eaaa 100644 (file)
@@ -34,5 +34,5 @@ dist_pkgdata_DATA = \
        utils/logrotate.conf \
        utils/hooks/01-create-default-dtb \
        utils/hooks/20-update-dtb-sample \
-       utils/hooks/20-set-stdout \
-       utils/hooks/90-sort-dtb
+       utils/hooks/90-sort-dtb \
+       utils/hooks/80-set-stdout
diff --git a/utils/hooks/20-set-stdout b/utils/hooks/20-set-stdout
deleted file mode 100755 (executable)
index 92ff030..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# Hook to set the linux,stdout-path property from an nvram property
-# (named $nvram_prop).
-
-nvram_prop=petitboot,console
-
-# we need to be using a dtb
-[ -n "$boot_dtb" ] || exit
-
-console=$(nvram --print-config="$nvram_prop")
-
-[ $? = 0 -a -n "$console" ] || exit
-
-dtb_in=$boot_dtb
-dtb_out=$(mktemp)
-
-(
-       dtc -I dtb -O dts $dtb_in
-       echo '/ { chosen { linux,stdout-path = "'$console'"; }; }; '
-) | dtc -I dts -O dtb -o $dtb_out
-
-[ $? = 0 ] && mv $dtb_out $dtb_in
diff --git a/utils/hooks/80-set-stdout b/utils/hooks/80-set-stdout
new file mode 100755 (executable)
index 0000000..92ff030
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Hook to set the linux,stdout-path property from an nvram property
+# (named $nvram_prop).
+
+nvram_prop=petitboot,console
+
+# we need to be using a dtb
+[ -n "$boot_dtb" ] || exit
+
+console=$(nvram --print-config="$nvram_prop")
+
+[ $? = 0 -a -n "$console" ] || exit
+
+dtb_in=$boot_dtb
+dtb_out=$(mktemp)
+
+(
+       dtc -I dtb -O dts $dtb_in
+       echo '/ { chosen { linux,stdout-path = "'$console'"; }; }; '
+) | dtc -I dts -O dtb -o $dtb_out
+
+[ $? = 0 ] && mv $dtb_out $dtb_in