blob: 93e25230061255d4b822c895c7c5788ecf004746 (
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
|
#!/bin/bash
. config/bootstrap
bit=32
[ "$LH_ARCHITECTURE" = "amd64" ] && bit=64
# Update kanotix-version (32/64-bit and timestamp)
perl -pi -e "s%(Kanotix|Excalibur|Hellfire)(32|64)%\${1}$bit%i; s%(32|64)(bit)%$bit\${2}%i; s|[0-9]+-[0-9]+:[0-9]+|$(date +%Y%m%d-%H:%M)|" config/chroot_local-includes/etc/kanotix-version
prebuild()
{
# Include nvidia-driver into chroot
if [ -f config/chroot_local-includes/usr/local/bin/install-nvidia-debian.sh ]; then
mkdir -p config/chroot_local-includes/usr/src
VER="$(grep -o ^VER=.* config/chroot_local-includes/usr/local/bin/install-nvidia-debian.sh|sed s/VER=//)"
ARCH=; [ "$LH_ARCHITECTURE" = "amd64" ] && ARCH="_64"
URL="http://download.nvidia.com/XFree86/Linux-x86$ARCH/$VER/NVIDIA-Linux-x86$ARCH-$VER.run"
CACHEURL="cache/$(basename "$URL")"
[ "$LH_CACHE" = "false" ] && CACHEURL="config/chroot_local-includes/usr/src/$(basename "$URL")"
mkdir -p "$(dirname "$CACHEURL")"
[ ! -e "$CACHEURL" ] && wget -O"$CACHEURL" "$URL"
cp "$CACHEURL" "config/chroot_local-includes/usr/src/$(basename "$URL")" 2>/dev/null
fi
}
if [ -d tmpfs ]; then
# build using tmpfs
if [ -z "$(stat --printf "%d\n" . tmpfs | uniq -u)" ]; then
# tmpfs not mounted yet
options=defaults
[ -f tmpfs/options ] && options="$(<tmpfs/options)"
mount -t tmpfs -o "$options" tmpfs tmpfs
fi
cd tmpfs
# delete everything except cache
find . -maxdepth 1 ! -name cache -exec rm -r '{}' \; 2>/dev/null
# copy everything to tmpfs
rsync -a .. . --exclude=tmpfs
# build
prebuild
lh build noauto ${@} 2>&1 | tee binary.log
cd ..
# prevent parent lh build (the "auto" one) from building again
exit 1
else
prebuild
lh build noauto ${@} 2>&1 | tee binary.log
fi
|