From 2b3046e3ab89f746de7ed58e5bf7ed9156afb2b2 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 28 Feb 2012 18:02:17 +0000 Subject: Add comment explaining PATH trickery when running ldconfig --- morphlib/builder.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'morphlib/builder.py') diff --git a/morphlib/builder.py b/morphlib/builder.py index a29157ae..d7d3d97a 100644 --- a/morphlib/builder.py +++ b/morphlib/builder.py @@ -46,6 +46,13 @@ def ldconfig(ex, rootdir): if os.path.exists(conf): logging.debug('Running ldconfig for %s' % rootdir) cache = os.path.join(rootdir, 'etc', 'ld.so.cache') + + # The following trickery with $PATH is necessary during the Baserock + # bootstrap build: we are not guaranteed that PATH contains the + # directory (/sbin conventionally) that ldconfig is in. Then again, + # it might, and if so, we don't want to hardware a particular + # location. So we add the possible locations to the end of $PATH + # and restore that aftewards. old_path = ex.env['PATH'] ex.env['PATH'] = '%s:/sbin:/usr/sbin:/usr/local/sbin' % old_path ex.runv(['ldconfig', '-r', rootdir]) -- cgit v1.2.1