More manual fixes

This commit is contained in:
Dylan Taylor 2021-05-15 12:07:46 -04:00
parent d93ef24e8e
commit 37e818b3d1
5 changed files with 29 additions and 29 deletions

View File

@ -10,6 +10,7 @@ if archinstall.arguments.get('help'):
# For support reasons, we'll log the disk layout pre installation to match against post-installation layout # For support reasons, we'll log the disk layout pre installation to match against post-installation layout
archinstall.log(f"Disk states before installing: {archinstall.disk_layouts()}", level=archinstall.LOG_LEVELS.Debug) archinstall.log(f"Disk states before installing: {archinstall.disk_layouts()}", level=archinstall.LOG_LEVELS.Debug)
def ask_user_questions(): def ask_user_questions():
""" """
First, we'll ask the user for a bunch of user input. First, we'll ask the user for a bunch of user input.
@ -41,7 +42,6 @@ def ask_user_questions():
selected_region = archinstall.arguments['mirror-region'] selected_region = archinstall.arguments['mirror-region']
archinstall.arguments['mirror-region'] = {selected_region : archinstall.list_mirrors()[selected_region]} archinstall.arguments['mirror-region'] = {selected_region : archinstall.list_mirrors()[selected_region]}
# Ask which harddrive/block-device we will install to # Ask which harddrive/block-device we will install to
if archinstall.arguments.get('harddrive', None): if archinstall.arguments.get('harddrive', None):
archinstall.arguments['harddrive'] = archinstall.BlockDevice(archinstall.arguments['harddrive']) archinstall.arguments['harddrive'] = archinstall.BlockDevice(archinstall.arguments['harddrive'])
@ -68,7 +68,6 @@ def ask_user_questions():
except archinstall.UnknownFilesystemFormat as err: except archinstall.UnknownFilesystemFormat as err:
archinstall.log(f" {partition} (Filesystem not supported)", fg='red') archinstall.log(f" {partition} (Filesystem not supported)", fg='red')
# We then ask what to do with the partitions. # We then ask what to do with the partitions.
if (option := archinstall.ask_for_disk_layout()) == 'abort': if (option := archinstall.ask_for_disk_layout()) == 'abort':
archinstall.log(f"Safely aborting the installation. No changes to the disk or system has been made.") archinstall.log(f"Safely aborting the installation. No changes to the disk or system has been made.")
@ -122,8 +121,7 @@ def ask_user_questions():
archinstall.log(f"Until then, please enter another supported filesystem.") archinstall.log(f"Until then, please enter another supported filesystem.")
continue continue
except archinstall.SysCallError: except archinstall.SysCallError:
pass # Expected exception since mkfs.<format> can not format /dev/null. pass # Expected exception since mkfs.<format> can not format /dev/null. But that means our .format() function supported it.
# But that means our .format() function supported it.
break break
# When we've selected all three criteria, # When we've selected all three criteria,
@ -151,7 +149,7 @@ def ask_user_questions():
# Get disk encryption password (or skip if blank) # Get disk encryption password (or skip if blank)
if archinstall.arguments['harddrive'] and archinstall.arguments.get('!encryption-password', None) is None: if archinstall.arguments['harddrive'] and archinstall.arguments.get('!encryption-password', None) is None:
if (passwd := archinstall.get_password(prompt='Enter disk encryption password (leave blank for no encryption): ')): if passwd := archinstall.get_password(prompt='Enter disk encryption password (leave blank for no encryption): '):
archinstall.arguments['!encryption-password'] = passwd archinstall.arguments['!encryption-password'] = passwd
archinstall.arguments['harddrive'].encryption_password = archinstall.arguments['!encryption-password'] archinstall.arguments['harddrive'].encryption_password = archinstall.arguments['!encryption-password']
archinstall.arguments["bootloader"] = archinstall.ask_for_bootloader() archinstall.arguments["bootloader"] = archinstall.ask_for_bootloader()
@ -307,7 +305,7 @@ def perform_installation(mountpoint):
formatted and setup prior to entering this function. formatted and setup prior to entering this function.
""" """
with archinstall.Installer(mountpoint, kernels=archinstall.arguments.get('kernels', 'linux')) as installation: with archinstall.Installer(mountpoint, kernels=archinstall.arguments.get('kernels', 'linux')) as installation:
## if len(mirrors): # if len(mirrors):
# Certain services might be running that affects the system during installation. # Certain services might be running that affects the system during installation.
# Currently, only one such service is "reflector.service" which updates /etc/pacman.d/mirrorlist # Currently, only one such service is "reflector.service" which updates /etc/pacman.d/mirrorlist
# We need to wait for it before we continue since we opted in to use a custom mirror/region. # We need to wait for it before we continue since we opted in to use a custom mirror/region.
@ -319,7 +317,7 @@ def perform_installation(mountpoint):
archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium
if installation.minimal_installation(): if installation.minimal_installation():
installation.set_hostname(archinstall.arguments['hostname']) installation.set_hostname(archinstall.arguments['hostname'])
if archinstall.arguments['mirror-region'].get("mirrors",{})!= None: if archinstall.arguments['mirror-region'].get("mirrors", {}) is not None:
installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium
if archinstall.arguments["bootloader"]=="grub-install" and hasUEFI()==True: if archinstall.arguments["bootloader"]=="grub-install" and hasUEFI()==True:
installation.add_additional_packages("grub") installation.add_additional_packages("grub")
@ -339,7 +337,7 @@ def perform_installation(mountpoint):
installation.enable_service('systemd-networkd') installation.enable_service('systemd-networkd')
installation.enable_service('systemd-resolved') installation.enable_service('systemd-resolved')
if archinstall.arguments.get('audio', None) != None: if archinstall.arguments.get('audio', None) is not None:
installation.log(f"This audio server will be used: {archinstall.arguments.get('audio', None)}", level=logging.INFO) installation.log(f"This audio server will be used: {archinstall.arguments.get('audio', None)}", level=logging.INFO)
if archinstall.arguments.get('audio', None) == 'pipewire': if archinstall.arguments.get('audio', None) == 'pipewire':
print('Installing pipewire ...') print('Installing pipewire ...')
@ -363,7 +361,7 @@ def perform_installation(mountpoint):
for superuser, user_info in archinstall.arguments.get('superusers', {}).items(): for superuser, user_info in archinstall.arguments.get('superusers', {}).items():
installation.user_create(superuser, user_info["!password"], sudo=True) installation.user_create(superuser, user_info["!password"], sudo=True)
if (timezone := archinstall.arguments.get('timezone', None)): if timezone := archinstall.arguments.get('timezone', None):
installation.set_timezone(timezone) installation.set_timezone(timezone)
if (root_pw := archinstall.arguments.get('!root-password', None)) and len(root_pw): if (root_pw := archinstall.arguments.get('!root-password', None)) and len(root_pw):

View File

@ -11,6 +11,7 @@ if archinstall.arguments.get('help', None):
archinstall.arguments['harddrive'] = archinstall.select_disk(archinstall.all_disks()) archinstall.arguments['harddrive'] = archinstall.select_disk(archinstall.all_disks())
def install_on(mountpoint): def install_on(mountpoint):
# We kick off the installer by telling it where the # We kick off the installer by telling it where the
with archinstall.Installer(mountpoint) as installation: with archinstall.Installer(mountpoint) as installation:
@ -36,6 +37,7 @@ def install_on(mountpoint):
archinstall.log(f" * root (password: airoot)") archinstall.log(f" * root (password: airoot)")
archinstall.log(f" * devel (password: devel)") archinstall.log(f" * devel (password: devel)")
if archinstall.arguments['harddrive']: if archinstall.arguments['harddrive']:
archinstall.arguments['harddrive'].keep_partitions = False archinstall.arguments['harddrive'].keep_partitions = False

View File

@ -1,6 +1,6 @@
import archinstall import archinstall
import json # import json
import urllib.request # import urllib.request
__packages__ = ['nano', 'wget', 'git'] __packages__ = ['nano', 'wget', 'git']

View File

@ -40,14 +40,14 @@ if __name__ == 'awesome':
with open(f"{archinstall.storage['installation_session'].target}/etc/xdg/awesome/rc.lua", 'r') as fh: with open(f"{archinstall.storage['installation_session'].target}/etc/xdg/awesome/rc.lua", 'r') as fh:
awesome_lua = fh.read() awesome_lua = fh.read()
## Replace xterm with alacritty for a smoother experience. # Replace xterm with alacritty for a smoother experience.
awesome_lua = awesome_lua.replace('"xterm"', '"alacritty"') awesome_lua = awesome_lua.replace('"xterm"', '"alacritty"')
with open(f"{archinstall.storage['installation_session'].target}/etc/xdg/awesome/rc.lua", 'w') as fh: with open(f"{archinstall.storage['installation_session'].target}/etc/xdg/awesome/rc.lua", 'w') as fh:
fh.write(awesome_lua) fh.write(awesome_lua)
## TODO: Configure the right-click-menu to contain the above packages that were installed. (as a user config) # TODO: Configure the right-click-menu to contain the above packages that were installed. (as a user config)
## Remove some interfering nemo settings # Remove some interfering nemo settings
archinstall.storage['installation_session'].arch_chroot("gsettings set org.nemo.desktop show-desktop-icons false") archinstall.storage['installation_session'].arch_chroot("gsettings set org.nemo.desktop show-desktop-icons false")
archinstall.storage['installation_session'].arch_chroot("xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search") archinstall.storage['installation_session'].arch_chroot("xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search")