-
Notifications
You must be signed in to change notification settings - Fork 87
/
preconfigure.sh
executable file
·64 lines (59 loc) · 1.68 KB
/
preconfigure.sh
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
# This script is used to configure all rootfs image template before uploading them here: https://github.com/nongiach/arm_now_templates
cd ../
rm -rf preconfig
mkdir preconfig
cd preconfig
for arch in $(arm_now list)
do
echo arch ARCH="$arch"
arm_now install "$arch" --clean --real-source
arm_now resize 100M
# read
# mkdir cacert
# cd cacert
# curl https://curl.haxx.se/ca/cacert.pem | awk 'split_after==1{n++;split_after=0} /-----END CERTIFICATE-----/ {split_after=1} {print > "cert" n ".pem"}'
# cd -
cat <<EOF>>config_ssl_and_pkg_manager.sh
cd /root
if [[ -e ./install_pkg_manager.sh ]]
then
./install_pkg_manager.sh
env
source /etc/profile.d/opkg_path.sh
echo 'export SSL_CERT_DIR=/etc/ssl/certs' >> /etc/profile
source /etc/profile
opkg install ca-certificates
rm /etc/ssl/certs/ -rf
mkdir /etc/ssl
ln -s /opt/etc/ssl/certs/ /etc/ssl/certs
opkg install wget
rm /usr/bin/wget
sed 's/http:/https:/g' /opt/etc/opkg.conf > /opt/etc/opkg.conf.bak
mv /opt/etc/opkg.conf.bak /opt/etc/opkg.conf
opkg install gdb
opkg install gdb_server
opkg install gdb_legacy # for mips32el
opkg install gdbserver_legacy # for mips32el
opkg install strace
########
# opkg install git
# opkg install git-http
# opkg install python3
# pip3 install requests
# pip3 install urllib3
# pip3 install chardet
# pip3 install certifi
fi
rm wget-log*
sync
poweroff
EOF
echo armv5-eabi armv7-eabihf mips32el x86-64-core-i7 x86-core2 x86-i686 | grep -- "$arch"
RET="$?"
echo "Preconfig.."
if [[ "$RET" == "0" ]]; then
arm_now start --autostart config_ssl_and_pkg_manager.sh --real-source
fi
echo "Compress.."
tar -Jcf "$(cat arm_now/arch).tar.xz" arm_now/
done