File tree Expand file tree Collapse file tree 2 files changed +20
-8
lines changed
dev-ayufan/root/usr/local/sbin Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,14 @@ if [[ "$(id -u)" -ne "0" ]]; then
77 exit 1
88fi
99
10- BOARD=
11- if grep -qi rockpro64 /proc/device-tree/compatible || grep -qi rockpro64 /etc/flash-kernel/machine; then
10+ if dpkg -s " u-boot-rockchip-rockpro64" & > /dev/null; then
1211 BOARD=rockpro64
1312 LOADER_NAME=rksd_loader
14- elif grep -qi rock64 /proc/device-tree/compatible || grep -qi rock64 /etc/flash-kernel/machine ; then
13+ elif dpkg -s " u-boot-rockchip- rock64" & > /dev/null ; then
1514 BOARD=rock64
1615 LOADER_NAME=rksd_loader
1716else
18- exit " Unknown board ."
17+ exit " Unknown package installed ."
1918 exit 1
2019fi
2120
@@ -30,6 +29,13 @@ echo "If this happens you will have to manually fix that outside of your Rock64.
3029echo " If you are booting from SPI. You have to use 'rock64_write_spi_flash.sh'."
3130echo " "
3231
32+ if ! ( grep -qi " $BOARD " /proc/device-tree/compatible || grep -qi " $BOARD " /etc/flash-kernel/machine ); then
33+ echo " You are currently running on different board ($( cat /proc/device-tree/model) )."
34+ echo " It may brick your device or the system unless"
35+ echo " you know what are you doing."
36+ echo " "
37+ fi
38+
3339while true ; do
3440 echo " Type YES to continue or Ctrl-C to abort."
3541 read CONFIRM
Original file line number Diff line number Diff line change @@ -12,15 +12,14 @@ if ! which nandwrite &>/dev/null; then
1212 exit 1
1313fi
1414
15- BOARD=
16- if grep -qi rockpro64 /proc/device-tree/compatible || grep -qi rockpro64 /etc/flash-kernel/machine; then
15+ if dpkg -s " u-boot-rockchip-rockpro64" & > /dev/null; then
1716 BOARD=rockpro64
1817 LOADER_NAME=rkspi_loader
19- elif grep -qi rock64 /proc/device-tree/compatible || grep -qi rock64 /etc/flash-kernel/machine ; then
18+ elif dpkg -s " u-boot-rockchip- rock64" & > /dev/null ; then
2019 BOARD=rock64
2120 LOADER_NAME=rksd_loader
2221else
23- exit " Unknown board ."
22+ exit " Unknown package installed ."
2423 exit 1
2524fi
2625
@@ -35,6 +34,13 @@ echo " and it will require that you use eMMC or SD"
3534echo " as your boot device."
3635echo " "
3736
37+ if ! ( grep -qi " $BOARD " /proc/device-tree/compatible || grep -qi " $BOARD " /etc/flash-kernel/machine ); then
38+ echo " You are currently running on different board ($( cat /proc/device-tree/model) )."
39+ echo " It may brick your device or the system unless"
40+ echo " you know what are you doing."
41+ echo " "
42+ fi
43+
3844while true ; do
3945 echo " Type YES to continue or Ctrl-C to abort."
4046 read CONFIRM
You can’t perform that action at this time.
0 commit comments