Skip to content

Commit 09d108f

Browse files
committed
dietpi-display: add support for Odroid C1/XU4 (boot.init)
1 parent dcbbd76 commit 09d108f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

dietpi/dietpi-display

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ Read_Settings()
2929
then
3030
read -ra cmdline < /boot/firmware/cmdline.txt
3131

32+
# Odroid C1/XU4
33+
elif (( $G_HW_MODEL == 10 || $G_HW_MODEL == 11 ))
34+
then
35+
read -ra cmdline < <(sed -En '/^[[:blank:]]*setenv[[:blank:]]+bootargs[[:blank:]]/{s/^[[:blank:]]*setenv[[:blank:]]+bootargs[[:blank:]]+"(.*)"/\1/p;q}' /boot/boot.ini)
36+
3237
# U-Boot environment file
3338
elif [[ $uenv ]]
3439
then
@@ -180,6 +185,20 @@ Apply_Settings()
180185
done
181186
[[ ${cmdline[i]} == "video=$DISPLAY:"* ]] || cmdline+=("$arg")
182187
G_EXEC eval "echo '${cmdline[*]}' > /boot/firmware/cmdline.txt"
188+
189+
# Odroid C1/XU4
190+
elif (( $G_HW_MODEL == 10 || $G_HW_MODEL == 11 ))
191+
then
192+
local cmdline=() i
193+
read -ra cmdline < <(sed -En '/^[[:blank:]]*setenv[[:blank:]]+bootargs[[:blank:]]/{s/^[[:blank:]]*setenv[[:blank:]]+bootargs[[:blank:]]+"(.*)"/\1/p;q}' /boot/boot.ini)
194+
for i in "${!cmdline[@]}"
195+
do
196+
[[ ${cmdline[i]} == "video=$DISPLAY:"* ]] || continue
197+
cmdline[i]=$arg
198+
break
199+
done
200+
[[ ${cmdline[i]} == "video=$DISPLAY:"* ]] || cmdline+=("$arg")
201+
G_CONFIG_INJECT 'setenv[[:blank:]]+bootargs[[:blank:]]' "setenv bootargs \"${cmdline[*]}\"" /boot/boot.ini
183202
fi
184203

185204
# U-Boot environment file

0 commit comments

Comments
 (0)