From 8f0e069fc43ed6f6a230329839f970415147d1aa Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Fri, 5 Aug 2016 15:05:12 +0800 Subject: hooks/set-stdout: move hook to after automatic stdout settings 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 Signed-off-by: Samuel Mendoza-Jonas --- utils/hooks/80-set-stdout | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 utils/hooks/80-set-stdout (limited to 'utils/hooks/80-set-stdout') diff --git a/utils/hooks/80-set-stdout b/utils/hooks/80-set-stdout new file mode 100755 index 0000000..92ff030 --- /dev/null +++ b/utils/hooks/80-set-stdout @@ -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 -- cgit v1.2.1