summaryrefslogtreecommitdiff
path: root/auto/build
diff options
context:
space:
mode:
authorAndreas Loibl <andreas@andreas-loibl.de>2010-09-04 17:02:53 +0200
committerAndreas Loibl <andreas@andreas-loibl.de>2010-09-04 17:02:53 +0200
commita2905105a3c3324686ed565ec833b5cca609fdd3 (patch)
treeac21e173ee4e9fc4ffc979407ac650efb267f6bc /auto/build
parent137be42247099389e9c0881b8d77316c8540f3a7 (diff)
downloadkanotix-a2905105a3c3324686ed565ec833b5cca609fdd3.zip
kanotix-a2905105a3c3324686ed565ec833b5cca609fdd3.tar.gz
added methods to build on tmpfs
Diffstat (limited to 'auto/build')
-rwxr-xr-xauto/build22
1 files changed, 21 insertions, 1 deletions
diff --git a/auto/build b/auto/build
index e55b879..306af81 100755
--- a/auto/build
+++ b/auto/build
@@ -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