This repository has been archived by the owner on Nov 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.sh
112 lines (99 loc) · 2.68 KB
/
setup.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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
URL_IMG_FILE="urls.txt"
echo -e "\n Setting up environment in Ubuntu"
sudo apt-get -y update
sudo apt-get -y install \
build-essential \
git \
mercurial \
cmake \
curl \
screen \
unzip \
device-tree-compiler \
libncurses-dev \
ppp \
cu \
linux-image-extra-virtual \
u-boot-tools \
android-tools-fastboot \
android-tools-fsutils \
python-dev \
python-pip \
libusb-1.0-0-dev \
g++-arm-linux-gnueabihf \
pkg-config \
libacl1-dev \
zlib1g-dev \
liblzo2-dev \
uuid-dev \
sunxi-tools
if uname -a |grep -q 64;
then
echo -e "\n Installing 32bit compatibility libraries"
sudo apt-get -y install libc6-i386 lib32stdc++6 lib32z1
fi
echo -e "\n Adding current user to dialout group"
sudo usermod -a -G dialout $(logname)
echo -e "\n Adding current user to plugdev group"
sudo usermod -a -G plugdev $(logname)
echo -e "\n Adding udev rule for Allwinner device"
echo -e 'SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="efe8", GROUP="plugdev", MODE="0660" SYMLINK+="usb-chip"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="1010", GROUP="plugdev", MODE="0660" SYMLINK+="usb-chip-fastboot"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="1010", GROUP="plugdev", MODE="0660" SYMLINK+="usb-chip-fastboot"
SUBSYSTEM=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", GROUP="plugdev", MODE="0660" SYMLINK+="usb-serial-adapter"
' | sudo tee /etc/udev/rules.d/99-allwinner.rules
sudo udevadm control --reload-rules
echo -e "\n Downloading server images"
if [ ! -d stable-server-b149 ]; then
mkdir stable-server-b149
cd stable-server-b149
wget -i ../$URL_IMG_FILE
cd ..
fi
#echo -e "\n Installing sunxi-tools"
#if [ -d sunxi-tools ]; then
# rm -rf sunxi-tools
#fi
#git clone http://github.com/linux-sunxi/sunxi-tools
#pushd sunxi-tools
#make
#make misc
#SUNXI_TOOLS=(sunxi-bootinfo
#sunxi-fel
#sunxi-fexc
#sunxi-nand-part
#sunxi-pio
#pheonix_info
#sunxi-nand-image-builder)
#for BIN in ${SUNXI_TOOLS[@]};do
# if [[ -L /usr/local/bin/${BIN} ]]; then
# sudo rm /usr/local/bin/${BIN}
# fi
# sudo ln -s $PWD/${BIN} /usr/local/bin/${BIN}
#done
#popd
#git clone http://github.com/nextthingco/chip-mtd-utils
#pushd chip-mtd-utils
#git checkout by/1.5.2/next-mlc-debian
#make
#sudo make install
#popd
#echo -e "\n Installing CHIP-tools"
#if [ -d CHIP-tools ]; then
# pushd CHIP-tools
# git pull
# popd
#fi
#git clone [email protected]:NextThingCo/CHIP-tools-backup.git chip-tools
#echo -e "\n Installing CHIP-buildroot"
#if [ ! -d CHIP-buildroot ]; then
# git clone http://github.com/NextThingCo/CHIP-buildroot
#else
# pushd CHIP-buildroot
# git pull
# popd
#fi
#if [ $(echo $PWD | grep vagrant) ];then
# sudo chown -R vagrant:vagrant *
#fi