Commit 06b0b6b7d831b698aeb467ec1cb5ec57541c1175

Authored by Silvan Calarco
1 parent 71a465cdd7
Exists in master

calamares: syntax fixes to openmamba-postinstall module

Showing 1 changed file with 6 additions and 6 deletions Inline Diff

calamares/openmamba-postinstall/main.py
1 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2 # encoding: utf-8 2 # encoding: utf-8
3 # === openmamba-postinstall module for Calamares - <http://github.com/calamares> === 3 # === openmamba-postinstall module for Calamares - <http://github.com/calamares> ===
4 # 4 #
5 # Copyright 2015, Silvan Calarco <silvan.calarco@mambasoft.it> 5 # Copyright 2015, Silvan Calarco <silvan.calarco@mambasoft.it>
6 # 6 #
7 7
8 import libcalamares 8 import libcalamares
9 9
10 10
11 def run(): 11 def run():
12 """ Complete setup after openmamba installation """ 12 """ Complete setup after openmamba installation """
13 13
14 # fix root path ('/') permissions 14 # fix root path ('/') permissions
15 libcalamares.utils.chroot_call(['chmod', '0755', '/']) 15 libcalamares.utils.chroot_call(['chmod', '0755', '/'])
16 16
17 # remove bluetooth config with livecd hostname 17 # remove bluetooth config with livecd hostname
18 libcalamares.utils.chroot_call(['rm', '-f', '/var/lib/bluetooth/*/config']) 18 libcalamares.utils.chroot_call(['rm', '-f', '/var/lib/bluetooth/*/config'])
19 19
20 # create user home 20 # create user home
21 username = libcalamares.globalstorage.value("username") 21 username = libcalamares.globalstorage.value("username")
22 22
23 libcalamares.utils.chroot_call(['cp', '-a', '/etc/skel', '/home/' . username ]) 23 libcalamares.utils.chroot_call(['cp', '-r', '/etc/skel/.', '/home/%s' % username ])
24 libcalamares.utils.chroot_call(['chmod', '0711', '/home/' . username ]) 24 libcalamares.utils.chroot_call(['chmod', '0711', '/home/%s' % username ])
25 libcalamares.utils.chroot_call(['mkdir', '-p', '/home/' . username . '/.config/autostart' ]) 25 libcalamares.utils.chroot_call(['mkdir', '-p', '/home/%s/.config/autostart' % username ])
26 libcalamares.utils.chroot_call(['ln', '-s', '/usr/share/openmamba/mambabase/mambabase-autostart.desktop', 26 libcalamares.utils.chroot_call(['ln', '-s', '/usr/share/openmamba/mambabase/mambabase-autostart.desktop',
27 '/home/' . username . '/.config/autostart/mambabase.desktop' ]) 27 '/home/%s/.config/autostart/mambabase.desktop' % username ])
28 libcalamares.utils.chroot_call(['chown', '-R ', username . '.users', '/home/' . username ]) 28 libcalamares.utils.chroot_call(['chown', '-R ', '%s:users' % username, '/home/%s' % username ])
29 libcalamares.utils.chroot_call(['chown', '-R ', username . '.users', '/home/' . username . '/.config' ]) 29 libcalamares.utils.chroot_call(['chown', '-R ', '%s:users' % username, '/home/%s/.config' % username ])
30 30
31 return None 31 return None
32 32