-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcreate-images.sh
executable file
·89 lines (72 loc) · 1.78 KB
/
create-images.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
#!/bin/bash
set -e
# defaults
VERSION=testing
DEVICES="h8216 h8266 h8314 h8324 h8416 h9436"
ISMIC="no"
RELEASE=""
while :; do
case $1 in
--mic)
ISMIC=yes
;;
--release)
RELEASE=$2
shift
;;
--version)
VERSION=$2
shift
;;
--device)
DEVICES=$2
shift
;;
*)
break
esac
shift
done
EXTRA_NAME=
source ~/.hadk.env
# check if all is specified
[ -z "$RELEASE" ] && (echo "Release has to be specified with --release option" && exit -1)
case $VERSION in
testing)
URL=https://repo.sailfishos.org/obs/nemo:/testing:/hw:/sony:/tama:/aosp10:/${RELEASE}/sailfishos_${RELEASE}_${PORT_ARCH}/$PORT_ARCH/
;;
devel)
URL=https://repo.sailfishos.org/obs/nemo:/devel:/hw:/sony:/tama:/aosp10/sailfish_latest_$PORT_ARCH/$PORT_ARCH/
;;
*)
echo "Version (devel or testing) is not specified using --testing option"
exit -2
;;
esac
if [ "$ISMIC" == "no" ]; then
scriptdir=`dirname "$(readlink -f "$0")"`
RELEASE_DIR=$ANDROID_ROOT/releases/$RELEASE
mkdir -p $RELEASE_DIR
cd $RELEASE_DIR
for device in $DEVICES
do
rm Jolla-@RELEASE@-$device-@[email protected] || echo No old KS file, continuing
"$scriptdir/get_ks.sh" $URL $device
sudo $PLATFORM_SDK_ROOT/sdks/sfossdk/mer-sdk-chroot \
"$scriptdir/create-images.sh" \
--mic \
--release $RELEASE --version $VERSION --device $device
done
exit
fi
device=$DEVICES
echo
echo Building for $RELEASE $device
source ~/.hadk.pre-$device
source ~/.hadk.post
RELEASE_DIR=$ANDROID_ROOT/releases/$RELEASE
cd $RELEASE_DIR
sudo mic create loop --arch=$PORT_ARCH \
--tokenmap=ARCH:$PORT_ARCH,RELEASE:$RELEASE,EXTRA_NAME:$EXTRA_NAME,DEVICEMODEL:$DEVICE \
--record-pkgs=name,url --outdir=sfe-$DEVICE-$RELEASE$EXTRA_NAME \
Jolla-@RELEASE@-$device-@[email protected]