-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_podman.sh
56 lines (49 loc) · 1.07 KB
/
build_podman.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
#!/bin/bash
set -xe
TARGET=""
if [ -n "$1" ]
then
TARGET="$1"
else
TARGET="herolte"
fi
cd "$(realpath $(dirname $0))"
if ! sudo podman image exists ut_builder
then
sudo podman image build -t ut_builder -f Dockerfile
fi
build_mount=""
if [ "$BUILD_DEBUG" == "true" ]
then
mkdir -p build_dir
build_mount="-v ./build_dir:/workdir/build_dir"
fi
mkdir -p out
sudo podman run \
--rm -it \
--security-opt label=disable \
-v ./:/template:ro \
--tmpfs /workdir \
-v ./out:/workdir/out \
$build_mount \
-w /workdir \
--privileged \
ut_builder \
/bin/bash -c \
"
export ROOTFS_URL=\"https://ci.ubports.com/job/focal-hybris-rootfs-arm64/job/master/lastSuccessfulBuild/artifact/ubuntu-touch-android9plus-rootfs-arm64.tar.gz\"
export OTA_CHANNEL=\"20.04/arm64/android9plus/devel\"
export DEV_TARBALL_VARIANT=_usrmerge
ls /template | while read -r f
do
if [ \"\$f\" != \"out\" ] && [ \"\$f\" != \"build_dir\" ]
then
echo \$f
cp -a /template/\"\$f\" ./
fi
done
ln -sf python2.7 /usr/bin/python
bash ./prepare_overlays.sh $TARGET
bash ./build.sh -b build_dir
bash ./deploy.sh $TARGET
"