improve install.py after problems with linse-gas10ka
- use --break-system-packages for pip - rename box - remove some unused stuff about display
This commit is contained in:
@ -11,3 +11,7 @@ eth3=192.168.3.3
|
|||||||
[DISPLAY]
|
[DISPLAY]
|
||||||
; please refer to README.md for help
|
; please refer to README.md for help
|
||||||
startup_text=startup...|HOST|ADDR
|
startup_text=startup...|HOST|ADDR
|
||||||
|
|
||||||
|
[FRAPPY]
|
||||||
|
cfg = kapillarheizung
|
||||||
|
port= 5010
|
28
install.py
28
install.py
@ -206,7 +206,7 @@ def pip():
|
|||||||
pipcmd = 'pip3 install -r %s' % tmpname
|
pipcmd = 'pip3 install -r %s' % tmpname
|
||||||
else:
|
else:
|
||||||
tmpname = join('/home', user, 'pip_requirements.tmp')
|
tmpname = join('/home', user, 'pip_requirements.tmp')
|
||||||
pipcmd = 'sudo --user %s pip3 install --user -r %s' % (user, tmpname)
|
pipcmd = 'sudo --user %s pip3 install --user --break-system-packages -r %s' % (user, tmpname)
|
||||||
filename = tmpname.replace('.tmp', '.txt')
|
filename = tmpname.replace('.tmp', '.txt')
|
||||||
content = ''.join('# --- for %s ---\n%s\n' % kv for kv in requirements.items())
|
content = ''.join('# --- for %s ---\n%s\n' % kv for kv in requirements.items())
|
||||||
if write_when_new(filename, content, True):
|
if write_when_new(filename, content, True):
|
||||||
@ -533,25 +533,11 @@ def handle_config():
|
|||||||
os.system('apt-get install isc-dhcp-server')
|
os.system('apt-get install isc-dhcp-server')
|
||||||
exit()
|
exit()
|
||||||
elif doit:
|
elif doit:
|
||||||
check_service('isc-dhcp-server', False)
|
unix_cmd('systemctl stop isc-dhcp-server')
|
||||||
content = []
|
unix_cmd('systemctl disable isc-dhcp-server')
|
||||||
dirty = False
|
displaycfg = config.get('DISPLAY')
|
||||||
for section, section_dict in config.items():
|
if displaycfg and display_update(displaycfg):
|
||||||
# if COMMENT not in section_dict:
|
to_start['display'] = 'restart'
|
||||||
# dirty = True
|
|
||||||
# content.append('[%s]' % section)
|
|
||||||
# content.append(COMMENT)
|
|
||||||
if section == 'DISPLAY':
|
|
||||||
if display_update(section_dict):
|
|
||||||
to_start['display'] = 'restart'
|
|
||||||
# for key, value in section_dict.items():
|
|
||||||
# content.append('%s=%s' % (key, value))
|
|
||||||
# content.append('')
|
|
||||||
if dirty:
|
|
||||||
print(cfgfile)
|
|
||||||
print('\n'.join(content))
|
|
||||||
#with open(cfgfile, 'w') as f:
|
|
||||||
# f.write('\n'.join(content))
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('ERROR: can not handle %s %s: %r' % (box.hostname, ifname, e))
|
print('ERROR: can not handle %s %s: %r' % (box.hostname, ifname, e))
|
||||||
raise
|
raise
|
||||||
@ -597,7 +583,7 @@ def handle_config():
|
|||||||
print('interface name system has to be changed from enp*s0 to eth*')
|
print('interface name system has to be changed from enp*s0 to eth*')
|
||||||
if replace_in_file('/etc/default/grub',
|
if replace_in_file('/etc/default/grub',
|
||||||
r'GRUB_CMDLINE_LINUX_DEFAULT="quiet(.*)"',
|
r'GRUB_CMDLINE_LINUX_DEFAULT="quiet(.*)"',
|
||||||
' net.ifnames=0"'):
|
' net.ifnames=0'):
|
||||||
do_cmd('update-grub')
|
do_cmd('update-grub')
|
||||||
|
|
||||||
result = [f'config file:\n {cfgfile}']
|
result = [f'config file:\n {cfgfile}']
|
||||||
|
Reference in New Issue
Block a user