mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
rockchip64: check whether the terminal is interactive during write_uboot_platform_mtd process
This commit is contained in:
@@ -59,8 +59,8 @@ function post_family_config__orangepi5_use_mainline_uboot() {
|
||||
((i++))
|
||||
done <<< "$FILES"
|
||||
|
||||
# If there is only one image, we can skip the dialog
|
||||
if [[ $i -eq 2 ]]; then
|
||||
# If there is only one image or the terminal is not interactive, we can skip the dialog
|
||||
if [[ ! -t 1 || $i -eq 2 ]]; then
|
||||
flashcp -v -p "$1/${MENU_ITEMS[1]}" /dev/mtd0
|
||||
return
|
||||
fi
|
||||
@@ -76,7 +76,8 @@ function post_family_config__orangepi5_use_mainline_uboot() {
|
||||
3>&1 1>&2 2>&3)
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
flashcp -v -p "$1/${MENU_ITEMS[($CHOICE*3)-2]}" /dev/mtd0
|
||||
idx=$((CHOICE*3-2))
|
||||
flashcp -v -p "$1/${MENU_ITEMS[$idx]}" /dev/mtd0
|
||||
else
|
||||
echo "No SPI image chosen."
|
||||
exit 1
|
||||
|
||||
@@ -315,8 +315,8 @@ write_uboot_platform_mtd() {
|
||||
((i++))
|
||||
done <<< "$FILES"
|
||||
|
||||
# If there is only one image, we can skip the dialog
|
||||
if [[ $i -eq 2 ]]; then
|
||||
# If there is only one image or the terminal is not interactive, we can skip the dialog
|
||||
if [[ ! -t 1 || $i -eq 2 ]]; then
|
||||
dd if=$1/${MENU_ITEMS[1]} of=$2 conv=notrunc status=none > /dev/null 2>&1
|
||||
return
|
||||
fi
|
||||
@@ -332,7 +332,8 @@ write_uboot_platform_mtd() {
|
||||
3>&1 1>&2 2>&3)
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
dd if=$1/${MENU_ITEMS[($CHOICE*3)-2]} of=$2 conv=notrunc status=none > /dev/null 2>&1
|
||||
idx=$((CHOICE*3-2))
|
||||
dd if=$1/${MENU_ITEMS[$idx]} of=$2 conv=notrunc status=none > /dev/null 2>&1
|
||||
else
|
||||
echo "No SPI image chosen."
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user