-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathprepare
executable file
·33 lines (31 loc) · 1.05 KB
/
prepare
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
#!/bin/bash
set -euf
IMAGEBUILDER_URL="http://downloads.openwrt.org/attitude_adjustment/12.09-beta2/ar71xx/generic/OpenWrt-ImageBuilder-ar71xx_generic-for-linux-i486.tar.bz2"
cd $(dirname $(readlink -f $0))
if [ x"${1:-}" == x ];then
echo "usage: $0 PROFILE"
echo
HIDE_TRAITS="true" sh $(dirname $(readlink -f $0))/bin/available_profiles
exit 1
fi
PROFILE=$1
if [ ! -e builder/Makefile ]; then
wget -O- $IMAGEBUILDER_URL | tar xj OpenWrt-ImageBuilder-ar71xx_generic-for-linux-i486
mv -f OpenWrt-ImageBuilder-ar71xx_generic-for-linux-i486 builder
echo "Builder successfully downloaded"
else
echo "Builder already installed, skipping download"
fi
echo
echo "copying generic init:"
cp --remove-destination lib/init builder/init
echo " profile/init -> builder/init"
[ -e builder/overlay ] && echo "removing old overlay" && rm -rf builder/overlay
echo
echo "copying profile:"
./copy_profile "$PROFILE"
if [ -e builder/overlay ];then
echo
echo "This profile also contains overlay data,"
echo 'run `builder/init_overlay` to copy'
fi