-
Notifications
You must be signed in to change notification settings - Fork 1
/
propagate_env.sh
executable file
·54 lines (45 loc) · 1.04 KB
/
propagate_env.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
#!/bin/sh
set -e
SRC=$(dirname $(readlink -f $0))
sudo chown me:me "$SRC"
sudo chown me:me "$HOME/E"
[ -d "$SRC/home" ] || mkdir "$SRC/home"
[ -d "$SRC/dl" ] || mkdir "$SRC/dl"
for i in $(ls -A1 "$SRC/home"); do
rm -fr "$HOME/$i"
ln -sf "$SRC/home/$i" "$HOME/$i"
done
if [ ! "$(ls -A ${HOME}/E)" ]; then
git clone https://github.com/Entware/Entware.git "$HOME/E"
ln -sf "$SRC/dl" "$HOME/E/dl"
cd "$HOME/E"
git fetch
case $ENTWARE_ARCH in
armv5-3.2)
git switch armv5-3.2
;;
armv7-2.6|x86-2.6)
git switch k2.6
;;
esac
make package/symlinks
if [ ! -z "$ENTWARE_ARCH" ]; then
cp -vf configs/${ENTWARE_ARCH}.config .config
cat <<EOF
You may start from...
make -j12 tools/install
make -j12 toolchain/install
make -j12 target/compile
make -j12 package/compile
EOF
else
echo 'No arch specified for this container.'
fi
else
echo 'Buildroot already deployed.'
fi
export EDITOR='/usr/bin/mcedit'
cd "$HOME/E"
echo 'Have a nice coding!'
echo 'PS1="🐳${ENTWARE_ARCH}:\w$ "' > ${HOME}/.bashrc
bash