Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2012-09-29 15:52:07 (GMT)
committer Daniel Drake <dsd@laptop.org>2012-09-29 15:52:07 (GMT)
commit6ffef43c84f3216b42239fc3b3f72aa8c2bb6914 (patch)
treea33cc8df84a1230e2dc794a2ce19ddf827d6da75
parente41aaec60d874cbd32ab4a4f39891ae4c18b37b7 (diff)
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.
-rw-r--r--lib/shlib.sh1
-rw-r--r--modules/base/kspost.05.mount_shared.nochroot.sh8
-rwxr-xr-xosbuilder.py5
3 files changed, 8 insertions, 6 deletions
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)