From 6ffef43c84f3216b42239fc3b3f72aa8c2bb6914 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Sat, 29 Sep 2012 15:52:07 +0000 Subject: Create build_shared directory early Promote the shared directory to a core directory and create it early, meaning that it can be used from all stages, including prepare. --- diff --git a/lib/shlib.sh b/lib/shlib.sh index 11324c2..870eaf6 100644 --- a/lib/shlib.sh +++ b/lib/shlib.sh @@ -9,6 +9,7 @@ builddir=$OOB__builddir cachedir=$OOB__cachedir cacheonly=$OOB__cacheonly intermediatesdir=$OOB__intermediatesdir +shareddir=$OOB__shareddir outputdir=$OOB__outputdir statedir=$OOB__statedir fsmount=$OOB__fsmount diff --git a/modules/base/kspost.05.mount_shared.nochroot.sh b/modules/base/kspost.05.mount_shared.nochroot.sh index cad30f4..012b86e 100644 --- a/modules/base/kspost.05.mount_shared.nochroot.sh +++ b/modules/base/kspost.05.mount_shared.nochroot.sh @@ -3,9 +3,7 @@ . $OOB__shlib -# create a "shared" intermediates directory which is also available at -# /build_shared from inside the image -mkdir -p $intermediatesdir/shared +# share the intermediates/shared directory at /build_shared inside the +# image build environment. echo "mkdir -p \$INSTALL_ROOT/build_shared" -echo "mount --bind $intermediatesdir/shared \$INSTALL_ROOT/build_shared" - +echo "mount --bind $shareddir \$INSTALL_ROOT/build_shared" diff --git a/osbuilder.py b/osbuilder.py index ce8e723..2550665 100755 --- a/osbuilder.py +++ b/osbuilder.py @@ -65,6 +65,7 @@ class Stage(object): env['OOB__builddir'] = self.osb.builddir env['OOB__cachedir'] = self.osb.cachedir env['OOB__intermediatesdir'] = self.osb.intermediatesdir + env['OOB__shareddir'] = self.osb.shareddir env['OOB__outputdir'] = self.osb.outputdir env['OOB__statedir'] = self.osb.statedir env['OOB__fsmount'] = self.osb.fsmount @@ -277,6 +278,7 @@ class OsBuilder(object): self.cachedir = os.path.join(self.builddir, 'cache') self.intermediatesdir = os.path.join(self.builddir, 'intermediates') + self.shareddir = os.path.join(self.intermediatesdir, 'shared') self.outputdir = os.path.join(self.builddir, 'output') self.statedir = os.path.join(self.builddir, 'state') self.fsmount = os.path.join(self.builddir, 'mnt-fs') @@ -381,7 +383,8 @@ class OsBuilder(object): raise OsBuilderException("Missing cache, cannot use --cache-only") for dir in (self.builddir, self.cachedir, self.intermediatesdir, - self.outputdir, self.statedir, self.fsmount): + self.outputdir, self.statedir, self.fsmount, + self.shareddir): if not os.path.exists(dir): os.makedirs(dir) -- cgit v0.9.1