new matrix-rootfs script replaces the "rootfs" action of matrix
[matrix.git] / bin / matrix-rootfs
1 #!/usr/bin/env python
2
3 moduledir = '@MODULEDIR@'
4
5 import sys
6 from os.path import dirname, abspath
7
8 if moduledir.startswith('@'):
9         moduledir = dirname(dirname(abspath(sys.argv[0])))
10
11 sys.path.insert(0, moduledir)
12
13 from matrix import rootfs, log
14
15 try:
16         rootfs.main()
17
18 except RuntimeError, e:
19         msg = str(e)
20         if msg:
21                 log.error(msg)
22
23 except KeyboardInterrupt:
24         log.message('Interrupted')
25
26 if log.dump():
27         sys.exit(1)