Support 64bit systems
authorRalf Jung <post@ralfj.de>
Wed, 19 Feb 2014 18:37:18 +0000 (19:37 +0100)
committerRalf Jung <post@ralfj.de>
Wed, 19 Feb 2014 18:37:18 +0000 (19:37 +0100)
Makefile
makeschsh

index 5700d338b4cfebaf4f961ee17e9f7cfbb14b6feb..83397e764a4e069c48f599c06d50917eda4ec685 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,3 +5,4 @@ install:
        install -o root -g root schsh makeschsh $(TARGET)/bin/
        install -o root -g root -d $(SCHROOT)/schsh/
        install -o root -g root -m 644 schroot/schsh/* $(SCHROOT)/schsh/
        install -o root -g root schsh makeschsh $(TARGET)/bin/
        install -o root -g root -d $(SCHROOT)/schsh/
        install -o root -g root -m 644 schroot/schsh/* $(SCHROOT)/schsh/
+       install -o root -g root -d /var/lib/schsh/
index 61b37f63d3045846437d19d3aee9907d4e2049bf..dc31830eedf68f1de5d8277281e4f6435965c64b 100755 (executable)
--- a/makeschsh
+++ b/makeschsh
@@ -32,13 +32,14 @@ profile=schsh
 setup.fstab=schsh/{0}.fstab
 """.format(name, chroot)
        with open("/etc/schroot/schsh/"+name+".fstab", "w") as f:
 setup.fstab=schsh/{0}.fstab
 """.format(name, chroot)
        with open("/etc/schroot/schsh/"+name+".fstab", "w") as f:
-               print >>f, """# <file system> <mount point>   <type>  <options>       <dump>  <pass>
-/bin          \t/bin          \tnone  \trw,bind       \t0     \t0
-/lib          \t/lib          \tnone  \trw,bind       \t0     \t0
-/usr/bin      \t/usr/bin      \tnone  \trw,bind       \t0     \t0
-/usr/lib      \t/usr/lib      \tnone  \trw,bind       \t0     \t0
-/home/{0}/data\t/data         \tnone  \trw,bind       \t0     \t0
-""".replace(' ', '').format(name) # need to remove spaces so schroot does not complain
+               # no spaces, schroot does not like them
+               print >>f, "# <file system> <mount point>   <type>  <options>       <dump>  <pass>"
+               # system folders
+               for folder in ("/bin", "/lib", "/lib64", "/usr/bin", "/usr/lib", "/usr/lib64"):
+                       if os.path.exists(folder):
+                               print >>f, "{0}\t{0}\tnone\trw,bind\t0\t0".format(folder)
+               # user folder
+               print >>f, "/home/{0}/data\t/data\tnone\trw,bind\t0\t0".format(name)
        
        # setup the schroot directory
        os.mkdir(chroot)
        
        # setup the schroot directory
        os.mkdir(chroot)