-
Notifications
You must be signed in to change notification settings - Fork 23
/
build_fsroot.sh
executable file
·56 lines (41 loc) · 1.12 KB
/
build_fsroot.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 -eux
# Build virtual file system
#
# The files minetest needs to function correctly.
#
# Shaders, fonts, games, etc
source common.sh
pushd "$BUILD_DIR"
rm -rf fsroot
mkdir fsroot
cp -a "minetest-install" fsroot/minetest
#############################################
pushd fsroot/minetest
rm -rf bin unix
# Emscripten strips empty directories. But bin/ needs to be present so that
# realpath() works on relative paths starting with bin/../
mkdir bin
echo "This is here to ensure bin exists" > bin/readme.txt
# Copy the irrlicht shaders
cp -r "$IRRLICHT_REPO/media/Shaders" client/shaders/Irrlicht
rm -rf games/minetest_game
mkdir -p games
cp -a "$SOURCES_DIR"/minetest_game games
cd games/minetest_game
rm -rf ".git" ".github"
popd
#############################################
# Copy root certificates for OpenSSL
pushd fsroot
mkdir -p etc/ssl/certs
# May be a symlink, use cat to copy contents
cat /etc/ssl/certs/ca-certificates.crt > etc/ssl/certs/ca-certificates.crt
popd
# Make fsroot.tar
rm -f fsroot.tar
pushd fsroot
tar cf ../fsroot.tar .
popd
# Compress with ZSTD
rm -f fsroot.tar.zst
zstd --ultra -22 fsroot.tar