Persistent module working.

This commit is contained in:
Ian Gulliver
2016-03-31 16:25:41 -07:00
parent b76e0433a7
commit 571b1a990c
4 changed files with 53 additions and 26 deletions

33
server/modules/persistent.py Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/python3
import argparse
import os
parser = argparse.ArgumentParser(description='iconograph persistent')
parser.add_argument(
'--chroot-path',
dest='chroot_path',
action='store',
required=True)
FLAGS = parser.parse_args()
def main():
os.mkdir(os.path.join(FLAGS.chroot_path, 'persistent'))
init = os.path.join(FLAGS.chroot_path, 'etc', 'init', 'persistent.conf')
with open(init, 'w') as fh:
fh.write("""
description "Mount /persistent"
start on filesystem
script
mount LABEL=PERSISTENT /persistent
end script
""")
if __name__ == '__main__':
main()