diff options
Diffstat (limited to 'auto')
-rwxr-xr-x | auto/build | 22 | ||||
-rwxr-xr-x | auto/clean | 10 |
2 files changed, 31 insertions, 1 deletions
@@ -7,4 +7,24 @@ bit=32 # 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 -lh build noauto ${@} 2>&1 | tee binary.log +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 + lh build noauto ${@} 2>&1 | tee binary.log + cd .. + # prevent parent lh build (the "auto" one) from building again + exit 1 +else + lh build noauto ${@} 2>&1 | tee binary.log +fi @@ -19,3 +19,13 @@ then rmdir --ignore-fail-on-non-empty config fi +# umount tmpfs +if [ -e tmpfs ]; then + case "$1" in + --tmpfs|--all) + [ "$(stat --printf "%d\n" . tmpfs | uniq -u)" ] && umount tmpfs;; + esac + [ "$1" = "--tmpfs" ] && exit 1 +fi + +exit 0 |