diff options
author | Riku Voipio <riku.voipio@linaro.org> | 2017-10-10 11:40:08 +0300 |
---|---|---|
committer | Riku Voipio <riku.voipio@linaro.org> | 2017-10-10 11:43:42 +0300 |
commit | 57c0a84c5c33cb09feb0e18c406c770958e61b14 (patch) | |
tree | 7ffb8ed01aad5d140893e7c224441d6a41bfbb88 | |
parent | 2619bbcd6a4cbed5194e304c0360a19bc664ec88 (diff) |
Add basefile saving
Save a distro basefile for faster turnaround time. This use used
by adding "SAVECACHE" class to the fai-diskimage command line. To
use the once generated basefile, SAVECACHE class is not needed.
hooked to debconf task, since it's the first one to run after
debootstrap.
A basefile speeds image builds from 7min to 1.5min.
Change-Id: I0c2e6e868d35994cb204da56b9b27cc0cea49ab2
-rwxr-xr-x | hooks/debconf.SAVECACHE | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/hooks/debconf.SAVECACHE b/hooks/debconf.SAVECACHE new file mode 100755 index 0000000..5419ba6 --- /dev/null +++ b/hooks/debconf.SAVECACHE @@ -0,0 +1,14 @@ +#!/bin/bash +# store a basefile for faster rebuild +ifclass SID && BASENAME=SID +ifclass STRETCH && BASENAME=STRETCH + +[ "x$BASENAME" != "x" ]||exit 0 + +mkdir -p $FAI/basefiles +if [ ! -r $FAI/basefiles/$BASENAME.tar.gz ] +then + echo making cache for faster reruns + tar caf $FAI/basefiles/$BASENAME.tar.gz -C $target . +fi + |