Merging in latest changes from master.
This commit is contained in:
commit
9bd829c0e2
|
|
@ -0,0 +1,13 @@
|
||||||
|
# http://editorconfig.org
|
||||||
|
# See coding conventions in CONTRIBUTING.md
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.py]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
# As per https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#example-of-a-codeowners-file
|
||||||
|
|
||||||
|
* @Torxed @grazzolini
|
||||||
|
|
@ -79,10 +79,15 @@ class BlockDevice():
|
||||||
return drive['back-file']
|
return drive['back-file']
|
||||||
elif self.info['type'] == 'disk':
|
elif self.info['type'] == 'disk':
|
||||||
return self.path
|
return self.path
|
||||||
|
elif self.info['type'][:4] == 'raid':
|
||||||
|
# This should catch /dev/md## raid devices
|
||||||
|
return self.path
|
||||||
elif self.info['type'] == 'crypt':
|
elif self.info['type'] == 'crypt':
|
||||||
if 'pkname' not in self.info:
|
if 'pkname' not in self.info:
|
||||||
raise DiskError(f'A crypt device ({self.path}) without a parent kernel device name.')
|
raise DiskError(f'A crypt device ({self.path}) without a parent kernel device name.')
|
||||||
return f"/dev/{self.info['pkname']}"
|
return f"/dev/{self.info['pkname']}"
|
||||||
|
else:
|
||||||
|
log(f"Unknown blockdevice type for {self.path}: {self.info['type']}", level=LOG_LEVELS.Debug)
|
||||||
|
|
||||||
# if not stat.S_ISBLK(os.stat(full_path).st_mode):
|
# if not stat.S_ISBLK(os.stat(full_path).st_mode):
|
||||||
# raise DiskError(f'Selected disk "{full_path}" is not a block device.')
|
# raise DiskError(f'Selected disk "{full_path}" is not a block device.')
|
||||||
|
|
@ -186,6 +191,17 @@ class Partition():
|
||||||
else:
|
else:
|
||||||
return f'Partition(path={self.path}, fs={self.filesystem}{mount_repr})'
|
return f'Partition(path={self.path}, fs={self.filesystem}{mount_repr})'
|
||||||
|
|
||||||
|
@property
|
||||||
|
def uuid(self) -> str:
|
||||||
|
"""
|
||||||
|
Returns the PARTUUID as returned by lsblk.
|
||||||
|
This is more reliable than relying on /dev/disk/by-partuuid as
|
||||||
|
it doesn't seam to be able to detect md raid partitions.
|
||||||
|
"""
|
||||||
|
lsblk = b''.join(sys_command(f'lsblk -J {self.path}'))
|
||||||
|
for partition in json.loads(lsblk.decode('UTF-8'))['blockdevices']:
|
||||||
|
return partition['partuuid']
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def encrypted(self):
|
def encrypted(self):
|
||||||
return self._encrypted
|
return self._encrypted
|
||||||
|
|
@ -241,9 +257,15 @@ class Partition():
|
||||||
if self.allow_formatting is False:
|
if self.allow_formatting is False:
|
||||||
log(f"Partition {self} is not marked for formatting.", level=LOG_LEVELS.Debug)
|
log(f"Partition {self} is not marked for formatting.", level=LOG_LEVELS.Debug)
|
||||||
return False
|
return False
|
||||||
elif self.target_mountpoint == '/boot' and self.has_content():
|
elif self.target_mountpoint == '/boot':
|
||||||
log(f"Partition {self} is a boot partition and has content inside.", level=LOG_LEVELS.Debug)
|
try:
|
||||||
return False
|
if self.has_content():
|
||||||
|
log(f"Partition {self} is a boot partition and has content inside.", level=LOG_LEVELS.Debug)
|
||||||
|
return False
|
||||||
|
except SysCallError as err:
|
||||||
|
log(err.message, LOG_LEVELS.Debug)
|
||||||
|
log(f"Partition {self} was identified as /boot but we could not mount to check for content, continuing!", level=LOG_LEVELS.Debug)
|
||||||
|
pass
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -392,18 +392,10 @@ class Installer():
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
log(f"Identifying root partition by PART-UUID on {self.partition}, looking for '{os.path.basename(self.partition.path)}'.", level=LOG_LEVELS.Debug)
|
log(f"Identifying root partition by PART-UUID on {self.partition}, looking for '{os.path.basename(self.partition.path)}'.", level=LOG_LEVELS.Debug)
|
||||||
for root, folders, uids in os.walk('/dev/disk/by-partuuid'):
|
entry.write(f'options root=PARTUUID={self.partition.uuid} rw intel_pstate=no_hwp\n')
|
||||||
for uid in uids:
|
|
||||||
real_path = os.path.realpath(os.path.join(root, uid))
|
|
||||||
|
|
||||||
log(f"Checking root partition match {os.path.basename(real_path)} against {os.path.basename(self.partition.path)}: {os.path.basename(real_path) == os.path.basename(self.partition.path)}", level=LOG_LEVELS.Debug)
|
self.helper_flags['bootloader'] = bootloader
|
||||||
if not os.path.basename(real_path) == os.path.basename(self.partition.path): continue
|
return True
|
||||||
|
|
||||||
entry.write(f'options root=PARTUUID={uid} rw intel_pstate=no_hwp\n')
|
|
||||||
|
|
||||||
self.helper_flags['bootloader'] = bootloader
|
|
||||||
return True
|
|
||||||
break
|
|
||||||
|
|
||||||
raise RequirementError(f"Could not identify the UUID of {self.partition}, there for {self.mountpoint}/boot/loader/entries/arch.conf will be broken until fixed.")
|
raise RequirementError(f"Could not identify the UUID of {self.partition}, there for {self.mountpoint}/boot/loader/entries/arch.conf will be broken until fixed.")
|
||||||
elif bootloader == "grub-install":
|
elif bootloader == "grub-install":
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ class luks2():
|
||||||
else:
|
else:
|
||||||
raise err
|
raise err
|
||||||
|
|
||||||
if b'Command successful.' not in (cmd_output := b''.join(cmd_handle)):
|
if cmd_handle.exit_code != 0:
|
||||||
raise DiskError(f'Could not encrypt volume "{partition.path}": {cmd_output}')
|
raise DiskError(f'Could not encrypt volume "{partition.path}": {cmd_output}')
|
||||||
|
|
||||||
return key_file
|
return key_file
|
||||||
|
|
|
||||||
|
|
@ -272,9 +272,16 @@ def select_language(options, show_only_country_codes=True):
|
||||||
print(' -- You can enter ? or help to search for more languages --')
|
print(' -- You can enter ? or help to search for more languages --')
|
||||||
selected_language = input('Select one of the above keyboard languages (by number or full name): ')
|
selected_language = input('Select one of the above keyboard languages (by number or full name): ')
|
||||||
if selected_language.lower() in ('?', 'help'):
|
if selected_language.lower() in ('?', 'help'):
|
||||||
filter_string = input('Search for layout containing (example: "sv-"): ')
|
while True:
|
||||||
new_options = search_keyboard_layout(filter_string)
|
filter_string = input('Search for layout containing (example: "sv-"): ')
|
||||||
return select_language(new_options, show_only_country_codes=False)
|
new_options = list(search_keyboard_layout(filter_string))
|
||||||
|
|
||||||
|
if len(new_options) <= 0:
|
||||||
|
log(f"Search string '{filter_string}' yielded no results, please try another search or Ctrl+D to abort.", fg='yellow')
|
||||||
|
continue
|
||||||
|
|
||||||
|
return select_language(new_options, show_only_country_codes=False)
|
||||||
|
|
||||||
elif selected_language.isdigit() and (pos := int(selected_language)) <= len(languages)-1:
|
elif selected_language.isdigit() and (pos := int(selected_language)) <= len(languages)-1:
|
||||||
selected_language = languages[pos]
|
selected_language = languages[pos]
|
||||||
# I'm leaving "options" on purpose here.
|
# I'm leaving "options" on purpose here.
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,9 @@ def sig_handler(sig, frame):
|
||||||
original_sigint_handler = signal.getsignal(signal.SIGINT)
|
original_sigint_handler = signal.getsignal(signal.SIGINT)
|
||||||
signal.signal(signal.SIGINT, sig_handler)
|
signal.signal(signal.SIGINT, sig_handler)
|
||||||
|
|
||||||
|
if archinstall.arguments.get('help'):
|
||||||
|
print("See `man archinstall` for help.")
|
||||||
|
exit(0)
|
||||||
|
|
||||||
def ask_user_questions():
|
def ask_user_questions():
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue