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]
|
||||
; please refer to README.md for help
|
||||
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
|
||||
else:
|
||||
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')
|
||||
content = ''.join('# --- for %s ---\n%s\n' % kv for kv in requirements.items())
|
||||
if write_when_new(filename, content, True):
|
||||
@ -533,25 +533,11 @@ def handle_config():
|
||||
os.system('apt-get install isc-dhcp-server')
|
||||
exit()
|
||||
elif doit:
|
||||
check_service('isc-dhcp-server', False)
|
||||
content = []
|
||||
dirty = False
|
||||
for section, section_dict in config.items():
|
||||
# if COMMENT not in section_dict:
|
||||
# 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))
|
||||
unix_cmd('systemctl stop isc-dhcp-server')
|
||||
unix_cmd('systemctl disable isc-dhcp-server')
|
||||
displaycfg = config.get('DISPLAY')
|
||||
if displaycfg and display_update(displaycfg):
|
||||
to_start['display'] = 'restart'
|
||||
except Exception as e:
|
||||
print('ERROR: can not handle %s %s: %r' % (box.hostname, ifname, e))
|
||||
raise
|
||||
@ -597,7 +583,7 @@ def handle_config():
|
||||
print('interface name system has to be changed from enp*s0 to eth*')
|
||||
if replace_in_file('/etc/default/grub',
|
||||
r'GRUB_CMDLINE_LINUX_DEFAULT="quiet(.*)"',
|
||||
' net.ifnames=0"'):
|
||||
' net.ifnames=0'):
|
||||
do_cmd('update-grub')
|
||||
|
||||
result = [f'config file:\n {cfgfile}']
|
||||
|
Reference in New Issue
Block a user