2015-04-30 16:38:23 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# encoding: utf-8
|
|
|
|
# === openmamba-postinstall module for Calamares - <http://github.com/calamares> ===
|
|
|
|
#
|
2022-07-09 13:34:46 +02:00
|
|
|
# Copyright 2015-2022, Silvan Calarco <silvan.calarco@mambasoft.it>
|
2015-04-30 16:38:23 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
import libcalamares
|
|
|
|
|
|
|
|
|
|
|
|
def run():
|
|
|
|
""" Complete setup after openmamba installation """
|
|
|
|
|
|
|
|
# fix root path ('/') permissions
|
2018-01-01 02:40:48 +01:00
|
|
|
libcalamares.utils.target_env_call(['chmod', '0755', '/'])
|
2015-04-30 16:38:23 +02:00
|
|
|
|
2015-08-17 20:49:30 +02:00
|
|
|
# remove bluetooth config with livecd hostname
|
2018-01-01 02:40:48 +01:00
|
|
|
libcalamares.utils.target_env_call(['rm', '-f', '/var/lib/bluetooth/*/config'])
|
2015-08-17 20:49:30 +02:00
|
|
|
|
2018-02-11 18:07:17 +01:00
|
|
|
# remove ssh host keys
|
|
|
|
libcalamares.utils.target_env_call(['rm', '-f', '/etc/ssh/ssh_host_*'])
|
|
|
|
|
2015-04-30 16:38:23 +02:00
|
|
|
# create user home
|
|
|
|
username = libcalamares.globalstorage.value("username")
|
|
|
|
|
2018-01-01 02:40:48 +01:00
|
|
|
libcalamares.utils.target_env_call(['cp', '-r', '/etc/skel/.', '/home/%s' % username ])
|
|
|
|
libcalamares.utils.target_env_call(['chmod', '0711', '/home/%s' % username ])
|
|
|
|
libcalamares.utils.target_env_call(['mkdir', '-p', '/home/%s/.config/autostart' % username ])
|
2022-07-09 13:34:46 +02:00
|
|
|
libcalamares.utils.target_env_call(['ln', '-s', '/usr/share/mambabase/mambabase-autostart.desktop',
|
2015-08-21 14:17:53 +02:00
|
|
|
'/home/%s/.config/autostart/mambabase.desktop' % username ])
|
2018-01-01 02:40:48 +01:00
|
|
|
libcalamares.utils.target_env_call(['chown', '-R', '%s:users' % username, '/home/%s' % username ])
|
|
|
|
libcalamares.utils.target_env_call(['chown', '-R', '%s:users' % username, '/home/%s/.config' % username ])
|
2015-04-30 16:38:23 +02:00
|
|
|
|
|
|
|
return None
|