Skip to content

Commit b3a3bd5

Browse files
committed
ayufan: dev: require to confirm if different board
1 parent fb9e886 commit b3a3bd5

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

dev-ayufan/root/usr/local/lib/u-boot-rockchip/loader-common

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,6 @@ case "$PACKAGE_NAME" in
7575
;;
7676
esac
7777

78-
if ! grep -qi "$BOARD" /proc/device-tree/compatible; then
79-
error "You are currently running on different board:"
80-
error "$(cat /proc/device-tree/model || true)"
81-
error "It may brick your device or the system unless"
82-
error "you know what are you doing."
83-
error ""
84-
fi
85-
86-
if [[ -f "$SPI_LOADER" ]]; then
87-
SPI_SIZE=$(stat -c%s "$SPI_LOADER")
88-
elif [[ -n "$SPI_LOADER" ]]; then
89-
error "The '$SPI_LOADER' is missing."
90-
SPI_SIZE=0
91-
fi
92-
9378
confirm() {
9479
while true; do
9580
echo "Type YES to continue or Ctrl-C to abort."
@@ -157,3 +142,19 @@ find_mtd() {
157142
error "Could not find MTD device to wrote $SPI_SIZE bytes at $SPI_OFFSET."
158143
return 1
159144
}
145+
146+
if ! grep -qi "$BOARD" /proc/device-tree/compatible; then
147+
error "You are currently running on different board:"
148+
error "$(cat /proc/device-tree/model || true)"
149+
error "It may brick your device or the system unless"
150+
error "you know what are you doing."
151+
error ""
152+
confirm
153+
fi
154+
155+
if [[ -f "$SPI_LOADER" ]]; then
156+
SPI_SIZE=$(stat -c%s "$SPI_LOADER")
157+
elif [[ -n "$SPI_LOADER" ]]; then
158+
error "The '$SPI_LOADER' is missing."
159+
SPI_SIZE=0
160+
fi

0 commit comments

Comments
 (0)