Added a unattended installer. Fixed list_profiles() to not include .py ending in the profile name, it's already in the ['path'] defintion. Renamed desktop.py to awesome.py as it more accurately describes what's being installed. desktop should be reserved to a default desktop environment that's more new-user-friendly.
This commit is contained in:
parent
056b800c8e
commit
f6f5875892
|
|
@ -26,7 +26,7 @@ def list_profiles(base='./profiles/', filter_irrelevant_macs=True):
|
||||||
tailored = False
|
tailored = False
|
||||||
if os.path.splitext(file)[1] == '.py':
|
if os.path.splitext(file)[1] == '.py':
|
||||||
if len(mac := re.findall('(([a-zA-z0-9]{2}[-:]){5}([a-zA-z0-9]{2}))', file)):
|
if len(mac := re.findall('(([a-zA-z0-9]{2}[-:]){5}([a-zA-z0-9]{2}))', file)):
|
||||||
if filter_irrelevant_macs and mac[0][0] not in local_macs::
|
if filter_irrelevant_macs and mac[0][0] not in local_macs:
|
||||||
continue
|
continue
|
||||||
tailored = True
|
tailored = True
|
||||||
|
|
||||||
|
|
@ -36,7 +36,7 @@ def list_profiles(base='./profiles/', filter_irrelevant_macs=True):
|
||||||
if first_line[0] == '#':
|
if first_line[0] == '#':
|
||||||
description = first_line[1:].strip()
|
description = first_line[1:].strip()
|
||||||
|
|
||||||
cache[file] = {'path' : os.path.join(root, file), 'description' : description, 'tailored' : tailored}
|
cache[file[:-2]] = {'path' : os.path.join(root, file), 'description' : description, 'tailored' : tailored}
|
||||||
break
|
break
|
||||||
return cache
|
return cache
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ with archinstall.Filesystem(harddrive, archinstall.GPT) as fs:
|
||||||
installation.add_bootloader()
|
installation.add_bootloader()
|
||||||
|
|
||||||
installation.add_additional_packages(['nano', 'wget', 'git'])
|
installation.add_additional_packages(['nano', 'wget', 'git'])
|
||||||
installation.install_profile('workstation')
|
installation.install_profile('awesome')
|
||||||
|
|
||||||
installation.user_create('anton', 'test')
|
installation.user_create('anton', 'test')
|
||||||
installation.user_set_pw('root', 'toor')
|
installation.user_set_pw('root', 'toor')
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,17 @@
|
||||||
import archinstall
|
import archinstall
|
||||||
|
import time
|
||||||
|
|
||||||
for profile in archinstall.list_profiles():
|
for name, info in archinstall.list_profiles().items():
|
||||||
# Tailored means it's a match for this machine.
|
# Tailored means it's a match for this machine
|
||||||
if profile['tailored']:
|
# based on it's MAC address (or some other criteria
|
||||||
print('Selecting profile to be installed:', profile)
|
# that fits the requirements for this machine specifically).
|
||||||
|
if info['tailored']:
|
||||||
|
print(f'Found a tailored profile for this machine called: "{name}".')
|
||||||
|
print(f'Starting install in:')
|
||||||
|
for i in range(10, 0, -1):
|
||||||
|
print(f'{i}...')
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
profile = archinstall.Profile(None, info['path'])
|
||||||
|
profile.install()
|
||||||
|
break
|
||||||
|
|
@ -24,7 +24,7 @@ with archinstall.Filesystem(harddrive, archinstall.GPT) as fs:
|
||||||
installation.add_bootloader()
|
installation.add_bootloader()
|
||||||
|
|
||||||
installation.add_additional_packages(['nano', 'wget', 'git'])
|
installation.add_additional_packages(['nano', 'wget', 'git'])
|
||||||
installation.install_profile('workstation')
|
installation.install_profile('awesome')
|
||||||
|
|
||||||
installation.user_create('anton', 'test')
|
installation.user_create('anton', 'test')
|
||||||
installation.user_set_pw('root', 'toor')
|
installation.user_set_pw('root', 'toor')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue