-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-qt-image.sh
More file actions
executable file
·43 lines (32 loc) · 1.12 KB
/
create-qt-image.sh
File metadata and controls
executable file
·43 lines (32 loc) · 1.12 KB
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
#!/usr/bin/bash
if [ "$1" == "" -o "$1" == "-h" ]; then
echo -e "create-qt-image.sh [-h] output version base overlay1 overlay2 ..."
echo -e "\tcreate an ostree image for qt-ota https://code.qt.io/cgit/qt/qtotaupdate.git/"
echo -e ""
echo -e "positional arguments:"
echo -e "\toutput: The output tar.zst image"
echo -e "\tversion: The version of the image which is used by qt-ostree"
exit 0
fi
if [ "$(id -u)" != "0" ]; then
echo "Run as root or fakeroot"
exit 1
fi
OUTPUT=$1
shift
VERSION=$1
shift
rm -rf merge
mkdir merge
for directory in $@; do cp -f -P -r --link $directory/* merge/; done
# Remove unneeded files
rm -f merge/home/weston/.bashrc
rm -f merge/home/weston/.profile
rm -rf merge/opt/*
sed -i "s/\"version\": .*/\"version\": \"$VERSION\"/" version.json
echo "Convert merge dir to qtota"
test -d ostree-repo && FLAGS=--create-self-contained-package
./qt-ostree $FLAGS --sysroot-image-path merge/ --create-ota-sysroot --ota-json version.json --uboot-script boot.script
echo "Create zstd image"
# Ignore error regarding too many levels of symbolic links
tar -cC sysroot --zstd -f $OUTPUT . 2>/dev/null || true