aboutsummaryrefslogtreecommitdiffstats
path: root/freedom-maker/freedombox-customize
diff options
context:
space:
mode:
authorficus <ficus@robocracy.org>2012-09-11 01:16:38 +0200
committerficus <ficus@robocracy.org>2012-09-12 01:25:30 +0200
commite55744bb195f0d665332ceb48acb57b4a4e186b5 (patch)
tree70824873c9dad07bf55c9e8101a97321f78fc6f5 /freedom-maker/freedombox-customize
parente109d94422d0687fc84d8aa1804c2b209785d0aa (diff)
downloadtorouter-e55744bb195f0d665332ceb48acb57b4a4e186b5.tar.gz
torouter-e55744bb195f0d665332ceb48acb57b4a4e186b5.zip
update to FBx public-0.1 freedom-maker
Snapshot commit with no torouter-specific changes re-applied. Updated freedom-maker image to a significantly more recent version, used by the FreedomBox project. This includes a shift from debian "stable" to "testing" (wheezy), which has a Linux 3.2 kernel. date Fri, 24 Aug 2012 03:50:41 +0000 repo git://anonscm.debian.org/freedombox/freedom-maker.git commit de1f66f0651a3a7c306331eeda1db93535b1470a (public-0.1)
Diffstat (limited to 'freedom-maker/freedombox-customize')
-rwxr-xr-xfreedom-maker/freedombox-customize49
1 files changed, 49 insertions, 0 deletions
diff --git a/freedom-maker/freedombox-customize b/freedom-maker/freedombox-customize
new file mode 100755
index 0000000..1f3ee69
--- /dev/null
+++ b/freedom-maker/freedombox-customize
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+
+import crypt
+import os
+import subprocess
+import sys
+
+
+user = "fbx"
+password = "frdm"
+rootdir = sys.argv[1]
+home = "/home/{0}/".format(user)
+
+
+def runchroot(argv):
+ return runcmd(["chroot", rootdir] + argv)
+
+def runcmd(argv, stdin='', ignore_fail=False, **kwargs):
+ p = subprocess.Popen(argv, stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ **kwargs)
+ out, err = p.communicate(stdin)
+ if p.returncode != 0:
+ msg = 'command failed: %s\n%s\n%s' % (argv, out, err)
+ if not ignore_fail:
+ print (msg)
+ raise Exception(msg)
+ return out
+
+if __name__ == "__main__":
+ print 'Customizing freedombox'
+
+ # Create a fboxlite account.
+ runchroot(['adduser', '--gecos', user, '--disabled-password', user])
+ encrypted = crypt.crypt(password, '..')
+ runchroot(['usermod', '-p', encrypted, user])
+
+ # Create all projects
+ runchroot(['git', 'clone', 'git://github.com/NickDaly/Plinth.git',
+ home + 'plinth'])
+ runchroot(['git', 'clone', 'git://github.com/jvasile/freedombox-privoxy',
+ home + 'freedombox-privoxy'])
+ runchroot(['git', 'clone', 'git://github.com/jvasile/withsqlite.git',
+ home + 'withsqlite'])
+ runchroot(['hg', 'clone', 'https://hg@bitbucket.org/nickdaly/plugserver',
+ home + 'plugserver'])
+
+ # change home directory ownership appropriately
+ runchroot(['chown', '-R', '1000:1000', home])