summaryrefslogtreecommitdiffhomepage
path: root/once/install.sh
blob: b5973c527fd89bb5bb004b717c9bb7424d7a7603 (plain)
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
#!/bin/sh

set -eu

if [ $# = 1 ]; then
	case "$1" in
		--output=*)
			exec 1>${1#*=}
			exec 2>&1
			;;
	esac
fi

export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
export HOME=/home/midipix

if [ -z "$SYSROOT" ]; then
	echo '$SYSROOT is not set!'
	exit 2
else
	mkdir -p "$SYSROOT"
fi

rm -f /etc/tarballs.sha256.tmp

for tarball in /tarballs/*.tar.gz; do
	echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
	echo extracting files from $tarball
	echo ..................................................

	if [ "${tarball##*/}" != 'updater.tar.gz' ]; then
		tar -xpv --no-same-owner -f $tarball -C "$SYSROOT"
	fi

	sha256sum $tarball >> /etc/tarballs.sha256.tmp
	echo ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	echo
done

rm -f /etc/tarballs.sha256
sed 's@/tarballs/@@g' /etc/tarballs.sha256.tmp > /etc/tarballs.sha256

/custom.sh

echo
echo
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo Congrats! All tarballs were successfully extracted.
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!