#!/bin/bash . config/bootstrap . config/common . config/kanotix 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 [ "$LH_KANOTIX_NVIDIA" = "true" -a -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" if [ "$LH_CACHE" = "false" ]; then wget -N -c -P config/chroot_local-includes/usr/src "$URL" else mkdir -p cache wget -N -c -P cache "$URL" cp "cache/$(basename "$URL")" "config/chroot_local-includes/usr/src/$(basename "$URL")" fi fi } if [ "$LH_KANOTIX_TMPFS" = "true" ]; then mkdir -p tmpfs # build using tmpfs [ -z "$(stat --printf "%d\n" . tmpfs | uniq -u)" ] && mount -t tmpfs -o "$LH_KANOTIX_TMPFS_OPTIONS" tmpfs tmpfs 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 .. else prebuild lh build noauto ${@} 2>&1 | tee binary.log fi exit 1