-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathuboot_update.sh
More file actions
executable file
·42 lines (33 loc) · 1.23 KB
/
uboot_update.sh
File metadata and controls
executable file
·42 lines (33 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
UBOOT_PATH=
UBOOT=${ROOT}/output/u-boot.rda
function Notice()
{
whiptail --title "OrangePi Build System" \
--msgbox "Warning!! Please check the device node of UDisk! It's very necessary to check before writing data into SDcard! If not, you will write data into dangerous area, and it's very terrible for your system! So, please check device node of UDisk" 10 80 0 --ok-button Continue
whiptail --title "OrangePi Build System" \
--msgbox "`df -l`" 20 80 0 --ok-button Continue
}
function GetPath()
{
for ((i = 0; i < 5; i++)); do
UBOOT_PATH=$(whiptail --title "OrangePi Build System" \
--inputbox "Pls input device node of SDcard.(/dev/sdc)" \
10 60 3>&1 1>&2 2>&3)
if [ $i = "4" ]; then
whiptail --title "OrangePi Build System" --msgbox "Error, Invalid Path" 10 40 0
exit 0
fi
if [ ! -b "$UBOOT_PATH" ]; then
whiptail --title "OrangePi Build System" --msgbox \
"The input path invalid! Pls input correct path!" \
--ok-button Continue 10 40 0
else
i=200
fi
done
}
Notice
GetPath
sudo dd bs=512 seek=256 if=${UBOOT} of=${UBOOT_PATH} && sync
clear