Commit 7f3605a3 authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

DTB selector for SolidRun boards.

parent 310ba226
......@@ -982,6 +982,19 @@ function jobs ()
fi
;;
# Switch to alternative kernels
#
"DTB" )
aval_cubox
if [[ $exitstatus = 0 ]]; then
BOX_LENGHT=$((${#TARGET_BOARD}+24));
dialog --title "Switching board config" --backtitle "$BACKTITLE" --yes-label "Reboot" --no-label "Cancel" --yesno "\nReboot to $TARGET_BOARD settings?" 7 $BOX_LENGHT
if [[ $? = 0 ]]; then
sed -i "s/^fdt_file=.*/fdt_file=$TARGET_BOARD/" /boot/armbianEnv.txt && grep -q "fdt_file=$TARGET_BOARD" /boot/armbianEnv.txt || echo "fdt_file=$TARGET_BOARD" >> /boot/armbianEnv.txt
reboot;
fi
fi
;;
# Switch to alternative kernels
#
......
......@@ -339,6 +339,31 @@ function aval_kernel ()
}
#-----------------------------------------------------------------------------------------------------------------------------------------#
# check if board has alternative kernels
#
function aval_cubox ()
{
LIST=("imx6dl-hummingboard.dtb" "HB Solo/DualLite" "imx6dl-hummingboard-emmc-som-v15.dtb" "HB Solo/DualLite v1.5 with eMMC" "imx6dl-hummingboard-som-v15.dtb" "HB Solo/DualLite v1.5" \
"imx6dl-hummingboard2.dtb" "HB2 Solo/DualLite" "imx6dl-hummingboard2-emmc-som-v15.dtb" "HB2 Solo/DualLite v1.5 with eMMC" "imx6dl-hummingboard2-som-v15.dtb" "HB2 Solo/DualLite v1.5" \
"imx6q-hummingboard.dtb" "HB Dual/Quad" "imx6q-hummingboard-emmc-som-v15.dtb" "HB Dual/Quad v1.5 with eMMC" "imx6q-hummingboard-som-v15.dtb" "HB Dual/Quad v1.5" \
"imx6q-hummingboard2.dtb" "HB2 Dual/Quad" "imx6q-hummingboard2-emmc-som-v15.dtb" "HB2 Dual/Quad v1.5 with eMMC" "imx6q-hummingboard2-som-v15.dtb" "HB2 Dual/Quad v1.5" \
"imx6dl-cubox-i.dtb" "Cubox-i Solo/DualLite" "imx6dl-cubox-i-emmc-som-v15.dtb" "Cubox-i Solo/DualLite v1.5 with eMMC" "imx6dl-cubox-i-som-v15.dtb" "Cubox-i Solo/DualLite v1.5" \
"imx6q-cubox-i.dtb" "Cubox-i Dual/Quad" "imx6q-cubox-i-emmc-som-v15.dtb" "Cubox-i Dual/Quad v1.5 with eMMC" "imx6q-cubox-i-som-v15.dtb" "Cubox-i Dual/Quad v1.5")
LIST_LENGHT=$((${#LIST[@]}/2));
if [ "$LIST_LENGHT" -eq 1 ]; then
TARGET_BOARD=${AVAL_KERNEL[0]}
else
exec 3>&1
TARGET_BOARD=$(dialog --cancel-label "Cancel" --backtitle "$BACKTITLE" --no-collapse \
--title "Select board configuration" --clear --menu "" $((6+${LIST_LENGHT})) 80 25 "${LIST[@]}" 2>&1 1>&3)
exitstatus=$?;
exec 3>&-
fi
}
#-----------------------------------------------------------------------------------------------------------------------------------------#
# select video modes for a10 and a20
#
......@@ -527,6 +552,7 @@ while true; do
[[ -d ${OVERLAYDIR} ]] && \
LIST+=( "Hardware" "Toggle hardware configuration: UART, I2C, etc." )
[[ "$LINUXFAMILY" = cubox && "$BRANCH" = "next" ]] && LIST+=( "DTB" "Switch board .dtb configuration" )
[[ -f /usr/bin/bin2fex && "$LINUXFAMILY" = sun*i && "$BRANCH" = "default" ]] && LIST+=( "Fexedit" "Board (fex) settings editor" )
[[ $(apt-cache search --names-only '^linux-'$(lsb_release -cs)'-root.*.'$BOARD'' | sed 's/.*(\(.*\))/\1/' | awk '{print $1}' \
| wc -l) -gt 1 ]] && LIST+=( "Switch" "Switch to alternative kernels" )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment