-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathselect-devices
executable file
·90 lines (84 loc) · 2.17 KB
/
select-devices
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
# Licensed under MIT License
# See: https://opensource.org/license/mit
#
# Copyright (c) 2024 BobbyUnkown
# Script to build firmware for ulo builder
# BobbyUnkown https://github.com/bobbyunknown
CONFIG_FILE="config"
select_kernel() {
local device=$1
case $device in
h5-*|h616-*|h618-*|h6-*)
echo "6.6.6-AW64-DBAI"
;;
rk*)
echo "5.10.160-rk35v-dbai"
;;
s905*)
echo "6.1.66-DBAI"
;;
*)
echo "Kernel not found for device: $device" >&2
return 1
;;
esac
}
echo "Select Device:"
PS3="Enter choice number: "
devices=(
"h5-orangepi-pc2"
"h5-orangepi-prime"
"h5-orangepi-zeroplus"
"h5-orangepi-zeroplus2"
"h616-orangepi-zero2"
"h618-orangepi-zero2w"
"h618-orangepi-zero3"
"h6-orangepi-1plus"
"h6-orangepi-3"
"h6-orangepi-3lts"
"h6-orangepi-lite2"
"rk3566-orangepi-3b"
"rk3588-orangepi-5plus"
"rk3588s-orangepi-5"
"s905x"
"s905x2"
"s905x3"
"s905x4"
"Exit"
)
select device in "${devices[@]}"; do
if [ "$device" = "Exit" ]; then
exit 0
elif [ -n "$device" ]; then
kernel=$(select_kernel "$device")
if [ $? -ne 0 ]; then
echo "ERROR: Invalid kernel for device $device"
continue
fi
echo -e "\nSelect OpenWrt Version:"
versions=(
"23.05.5"
"23.05.4"
"23.05.3"
"23.05.2"
"23.05.1"
"23.05.0"
)
select version in "${versions[@]}"; do
if [ -n "$version" ]; then
echo "DEVICE=$device" > $CONFIG_FILE
echo "KERNEL=$kernel" >> $CONFIG_FILE
echo "ROOTFS_SIZE=1024" >> $CONFIG_FILE
echo "VERSION=$version" >> $CONFIG_FILE
echo -e "\nSelected Configuration:"
echo "Device: $device"
echo "Kernel: $kernel"
echo "Rootfs Size: 1024M"
echo "OpenWrt Version: $version"
exit 0
fi
done
break
fi
done