Files
iconograph/server/modules/persistent.py

38 lines
669 B
Python
Raw Normal View History

2016-03-31 16:25:41 -07:00
#!/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
2016-04-07 01:00:40 +00:00
task
emits persistent-ready
2016-03-31 16:25:41 -07:00
script
mount LABEL=PERSISTENT /persistent
2016-04-07 01:00:40 +00:00
initctl emit --no-wait persistent-ready
2016-03-31 16:25:41 -07:00
end script
""")
if __name__ == '__main__':
main()