summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2013-11-04 13:44:39 +0100
committerDaniel Baumann <mail@daniel-baumann.ch>2013-11-04 14:02:40 +0100
commit5603355e1d2db03c53bcfa370bba5f9220b2a19e (patch)
tree2fcb82ba3c34ffc39c54523f306b819cfb76df7e /components
parent83dacd9b39fdfd3053fcbc2c80fc3151525ed42d (diff)
downloadvyos-live-build-5603355e1d2db03c53bcfa370bba5f9220b2a19e.tar.gz
vyos-live-build-5603355e1d2db03c53bcfa370bba5f9220b2a19e.zip
Handling bootstrap cache inside the bootstrap stubs itself.
Diffstat (limited to 'components')
-rwxr-xr-xcomponents/bootstrap_cdebootstrap23
-rwxr-xr-xcomponents/bootstrap_debootstrap23
2 files changed, 46 insertions, 0 deletions
diff --git a/components/bootstrap_cdebootstrap b/components/bootstrap_cdebootstrap
index fc0b663d6..3ac2b95d6 100755
--- a/components/bootstrap_cdebootstrap
+++ b/components/bootstrap_cdebootstrap
@@ -106,6 +106,20 @@ def main():
sys.exit(1)
+ # stage cache
+ if os.path.exists('cache/bootstrap'):
+ if verbose:
+ print('I: Copying cache/bootstrap to chroot')
+
+ # Notes:
+ # * there's no Python equivalent to 'cp -a' that handels both symlinks and device nodes properly.
+ cache = subprocess.call('cp -a cache/bootstrap chroot', shell=True)
+
+ os.makedirs('.build', exist_ok=True)
+ open('.build/bootstrap', 'w').close()
+
+ sys.exit(0)
+
# packages cache
if glob.glob('cache/packages.bootstrap/*.deb'):
if verbose:
@@ -151,6 +165,15 @@ def main():
cdebootstrap = subprocess.call('/usr/bin/cdebootstrap ' + cdebootstrap_options, shell=True)
+ # stage cache
+ if not os.path.exists('cache/bootstrap'):
+ if verbose:
+ print('I: Copying chroot to cache/bootstrap')
+
+ # Notes:
+ # * there's no Python equivalent to 'cp -a' that handels both symlinks and device nodes properly.
+ cache = subprocess.call('cp -a chroot cache/bootstrap', shell=True)
+
## stagefile
os.makedirs('.build', exist_ok=True)
open('.build/bootstrap', 'w').close()
diff --git a/components/bootstrap_debootstrap b/components/bootstrap_debootstrap
index 2f5c128e7..0d76d627d 100755
--- a/components/bootstrap_debootstrap
+++ b/components/bootstrap_debootstrap
@@ -111,6 +111,20 @@ def main():
sys.exit(1)
+ # stage cache
+ if os.path.exists('cache/bootstrap'):
+ if verbose:
+ print('I: Copying cache/bootstrap to chroot')
+
+ # Notes:
+ # * there's no Python equivalent to 'cp -a' that handels both symlinks and device nodes properly.
+ cache = subprocess.call('cp -a cache/bootstrap chroot', shell=True)
+
+ os.makedirs('.build', exist_ok=True)
+ open('.build/bootstrap', 'w').close()
+
+ sys.exit(0)
+
# packages cache
if glob.glob('cache/packages.bootstrap/*.deb'):
if verbose:
@@ -148,6 +162,15 @@ def main():
for package in glob.glob('chroot/var/cache/apt/archives/*.deb'):
shutil.move(package, 'cache/packages.bootstrap')
+ # stage cache
+ if not os.path.exists('cache/bootstrap'):
+ if verbose:
+ print('I: Copying chroot to cache/bootstrap')
+
+ # Notes:
+ # * there's no Python equivalent to 'cp -a' that handels both symlinks and device nodes properly.
+ cache = subprocess.call('cp -a chroot cache/bootstrap', shell=True)
+
## stagefile
os.makedirs('.build', exist_ok=True)
open('.build/bootstrap', 'w').close()