Skip to content
Snippets Groups Projects
Commit a0ad1fcf authored by Florent Thiery's avatar Florent Thiery
Browse files

further auto-configure netcapture, refs #26945

parent 4ca8ffc5
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
import utils
import json
def write_conf():
with open('/etc/miris/netcapture.json.example', 'r') as f:
default_conf = json.load(f)
default_conf['docker_registry_login'] = utils.get_conf('NETCAPTURE_DOCKER_LOGIN', '')
default_conf['docker_registry_password'] = utils.get_conf('NETCAPTURE_DOCKER_PWD', '')
default_conf['campusmanager_url'] = 'https://%s' % utils.get_conf('CM_SERVER_NAME', '')
with open('/etc/miris/netcapture.json', 'w') as f:
json.dump(default_conf, f, indent=2, sort_keys=True)
return default_conf
def setup(interactive=True):
......@@ -14,5 +26,14 @@ def setup(interactive=True):
try:
utils.run_commands(cmds)
conf = write_conf()
cmds_post = list()
for f in ['media', 'logs', 'conf']:
cmds_post.extend([
'mkdir -p %s' % conf['netcapture_%s_folder' % f],
'chgrp -R video %s' % conf['netcapture_%s_folder' % f],
'chmod -R 774 %s' % conf['netcapture_%s_folder' % f],
])
utils.run_commands(cmds_post)
except Exception:
raise
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import utils
import json
CONTENT = [
"https://www.ubicast.eu/media/downloads/TradeshowDemoKit/medical_education.zip",
......@@ -19,4 +20,13 @@ def setup(interactive=True):
cmd = cmd_template % c
cmds.append(cmd)
cmds.append('netcapturectl add')
# hw acceleration requires boot-time module options so a reboot will be needed
with open('/etc/miris/netcapture.json.example', 'w') as f:
c = json.load(f)
c['enable_hw_acceleration'] = True
json.dump(c, f)
cmds.append('echo "options i915 enable_guc_loading=1 enable_guc_submission=1" > /etc/modprobe.d/netcapture.conf')
cmds.append('update-initramfs')
utils.run_commands(cmds)
print('A reboot is required')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment