79
79
print >>sys.stderr, "(I need to chroot)."
82
if not rebuildjail and not os.path.exists('jail'):
83
print >> sys.stderr, "No jail exists -- please rerun with -j."
86
82
# Find out the revison number
87
83
revnum = get_svn_revision()
88
84
print "Building Revision %s"%str(revnum)
108
104
# Note: Other subdirs will be made by copying files
109
105
if apt_mirror != None:
110
106
os.environ['MIRROR'] = apt_mirror
111
action_runprog('./bin/buildjail.sh', [], dry)
107
action_runprog('./buildjail.sh', [], dry)
113
109
# Copy all console and operating system files into the jail
114
action_copylist(install_list.list_services, 'jail/opt/ivle', dry)
110
action_copylist(install_list.list_scripts, 'jail/opt/ivle', dry)
116
112
# Chmod the python console
117
action_chmod_x('jail/opt/ivle/services/python-console', dry)
118
action_chmod_x('jail/opt/ivle/services/fileservice', dry)
119
action_chmod_x('jail/opt/ivle/services/serveservice', dry)
113
action_chmod_x('jail/opt/ivle/scripts/python-console', dry)
114
action_chmod_x('jail/opt/ivle/scripts/fileservice', dry)
115
action_chmod_x('jail/opt/ivle/scripts/serveservice', dry)
121
117
# Also copy the IVLE lib directory into the jail
122
# This is necessary for running certain services
118
# This is necessary for running certain scripts
123
119
action_copylist(install_list.list_lib, 'jail/opt/ivle', dry)
124
120
# IMPORTANT: The file jail/opt/ivle/lib/conf/conf.py contains details
125
121
# which could compromise security if left in the jail (such as the DB
132
128
# Compile .py files into .pyc or .pyo files
133
129
compileall.compile_dir('www', quiet=True)
134
130
compileall.compile_dir('lib', quiet=True)
135
compileall.compile_dir('services', quiet=True)
131
compileall.compile_dir('scripts', quiet=True)
136
132
compileall.compile_dir('jail/opt/ivle/lib', quiet=True)
138
134
# Set up ivle.pth inside the jail