]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
naoki: Create symlinks to tools that are needed in chroot.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 10 Jan 2010 14:52:24 +0000 (15:52 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 10 Jan 2010 14:52:24 +0000 (15:52 +0100)
If they are not already there, we need to symlink them
to the toolchain tools.

naoki/chroot.py

index 4a4023ded2b46f0fcbe39974d7dadc6c1ec31f4d..7a92798344cacb42263221a0efca1bf57a035ed5 100644 (file)
@@ -243,15 +243,28 @@ class Environment(object):
 
        def _setupToolchain(self):
                symlinks = (
-                       "bin/bash",
-                       "bin/sh",
-                       "bin/pwd",
+                       ("bin/bash", "bin/bash"),
+                       ("bin/cat", "bin/cat"),
+                       ("bin/echo", "bin/echo"),
+                       ("bin/stty", "bin/stty"),
+                       ("bin/pwd", "bin/pwd"),
+                       ("bin/sh", "bin/sh"),
+                       #
+                       ("bin/perl", "usr/bin/perl"),
+                       #
+                       ("lib/libgcc_s.so", "usr/lib/libgcc_s.so"),
+                       ("lib/libgcc_s.so.1", "usr/lib/libgcc_s.so.1"),
+                       ("lib/libstdc++.so", "usr/lib/libstdc++.so"),
+                       ("lib/libstdc++.so.6", "usr/lib/libstdc++.so.6"),
                )
-               for symlink in symlinks:
-                       if os.path.exists(self.chrootPath(symlink)):
+               for src, dst in symlinks:
+                       if os.path.exists(self.chrootPath(dst)):
                                continue
-                       self.log.debug("Creating symlink /%s" % symlink)
-                       os.symlink("/tools_i686/%s" % symlink, self.chrootPath(symlink))
+                       dir = os.path.dirname(self.chrootPath(dst))
+                       if not os.path.exists(dir):
+                               util.mkdir(dir)
+                       self.log.debug("Creating symlink /%s" % dst)
+                       os.symlink("/tools_i686/%s" % src, self.chrootPath(dst))
 
        def _mountall(self):
                """mount 'normal' fs like /dev/ /proc/ /sys"""