archinstall
archinstall copied to clipboard
Silent unattended CLI installation fails with HSM key error
Installation fails when performing silent install using working configuration. The below configuration was installed first using the guided menu (successfully), configuration was saved, and then attempted to install using the command line. This was tested on both 2.5.0 and 5c3c131. Tested in QEMU virtual machine with a live cd.
Installation did not use encryption, so not sure if the HSM key is supposed to be empty? The code seems to indicate that it is checking a key that would not have anything in it.
Terminal output
$ archinstall --silent --config /home/liveuser/user_configuration.json --creds /home/liveuser/user_credentials.json --disk_layouts /home/liveuser/user_disk_layout.json
Testing connectivity to the Arch Linux mirrors ...
! Formatting [BlockDevice(/dev/vda, size=64.0GB, free_space=1031kB+1049kB+1032kB, bus_type=None)] in 5....4....3....2....1....
Creating a new partition label on /dev/vda
Adding partition to BlockDevice(/dev/vda, size=64.0GB, free_space=1031kB+1049kB+1032kB, bus_type=None), 1MiB->512MiB
Formatting /dev/vda1 -> vfat
Marking partition Partition(path=/dev/vda1, size=0.5, PARTUUID=F636-3A57, fs=vfat) as bootable.
Setting boot on on (parted) partition index 1
Adding partition to BlockDevice(/dev/vda, size=64.0GB, free_space=1031kB+1049kB+1032kB, bus_type=None), 513MiB->100%
Formatting /dev/vda2 -> ext4
Mounting / to /mnt/archinstall/ using Partition(path=/dev/vda2, size=63.5, PARTUUID=0c054349-563f-46b8-baa3-720ca9abefb6, fs=ext4)
Mounting /boot to /mnt/archinstall/boot using Partition(path=/dev/vda1, size=0.5, PARTUUID=F636-3A57, fs=vfat)
Using mount order: [('/', <function Installer.mount_ordered_layout.<locals>.<lambda> at 0x7fa5cb2cb6d0>), ('/boot', <function Installer.mount_ordered_layout.<locals>.<lambda> at 0x7fa5cb2cb640>)]
Mounting Partition(path=/dev/vda2, size=63.5, PARTUUID=0c054349-563f-46b8-baa3-720ca9abefb6, fs=ext4) to /mnt/archinstall/
Mounting Partition(path=/dev/vda1, size=0.5, PARTUUID=F636-3A57, fs=vfat) to /mnt/archinstall/boot
Waiting for automatic mirror selection (reflector) to complete.
A new package mirror-list has been created: /etc/pacman.d/mirrorlist
Installing packages: ['base', 'base-devel', 'linux-firmware', 'linux']
==> Creating install root at /mnt/archinstall
==> Installing packages to /mnt/archinstall
:: Synchronizing package databases...
... <output trimmed>
==> Creating zstd-compressed initcpio image: /boot/initramfs-linux-fallback.img
==> Image generation successful
(12/14) Reloading system bus configuration...
Skipped: Running in chroot.
(13/14) Warn about old perl modules
(14/14) Updating the info directory file...
Enabling service fstrim.timer
'HSM'
[!] A log file has been created here: /var/log/archinstall/install.log
Please submit this issue (and file) to https://github.com/archlinux/archinstall/issues
Traceback (most recent call last):
File "/usr/bin/archinstall", line 8, in <module>
sys.exit(run_as_a_module())
File "/usr/lib/python3.10/site-packages/archinstall/__init__.py", line 281, in run_as_a_module
script.execute()
File "/usr/lib/python3.10/site-packages/archinstall/lib/profiles.py", line 195, in execute
self.spec.loader.exec_module(sys.modules[self.namespace])
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/lib/python3.10/site-packages/archinstall/examples/guided.py", line 307, in <module>
perform_installation(archinstall.storage.get('MOUNT_POINT', '/mnt'))
File "/usr/lib/python3.10/site-packages/archinstall/examples/guided.py", line 137, in perform_installation
with archinstall.Installer(mountpoint, kernels=archinstall.arguments.get('kernels', ['linux'])) as installation:
File "/usr/lib/python3.10/site-packages/archinstall/lib/installer.py", line 159, in __exit__
raise args[1]
File "/usr/lib/python3.10/site-packages/archinstall/examples/guided.py", line 187, in perform_installation
if installation.minimal_installation(testing=enable_testing, multilib=enable_multilib):
File "/usr/lib/python3.10/site-packages/archinstall/lib/installer.py", line 761, in minimal_installation
if storage['arguments']['HSM']:
KeyError: 'HSM'
Generated config saved by archinstall (used for above command)
Relevant config generated by archinstall. user_configuration.json
{
"additional-repositories": [
"multilib"
],
"bootloader": "grub-install",
"config_version": "2.5.0",
"debug": false,
"harddrives": [
"/dev/vda"
],
"mirror-region": {
"United States": {
"https://mirrors.kernel.org/archlinux/$repo/os/$arch": true,
}
},
"mount_point": null,
"nic": {
"dhcp": true,
"dns": null,
"gateway": null,
"iface": null,
"ip": null,
"type": "nm"
},
"ntp": true,
"packages": [
"nano",
"git",
"python",
"avahi",
"openssh"
],
"plugin": null,
"profile": {
"path": "/usr/lib/python3.10/site-packages/archinstall/profiles/server.py"
},
"script": "guided",
"silent": false,
"swap": false,
"timezone": "US/Eastern",
"version": "2.5.0"
}
user_credentials.json
{
"!encryption-password": null,
"!users": [
{
"!password": "asdf",
"sudo": true,
"username": "user"
}
]
}
user_disk_layout.json
{
"/dev/vda": {
"partitions": [
{
"boot": true,
"encrypted": false,
"filesystem": {
"format": "fat32"
},
"mountpoint": "/boot",
"size": "512MiB",
"start": "1MiB",
"type": "primary",
"wipe": true
},
{
"encrypted": false,
"filesystem": {
"format": "ext4",
"mount_options": []
},
"mountpoint": "/",
"size": "100%",
"start": "513MiB",
"type": "primary",
"wipe": true
}
],
"wipe": true
}
}
Relevant logs from installs
See my comment here: https://github.com/archlinux/archinstall/issues/1386#issuecomment-1192017092. That error is because "HSM": null is expected when disk encryption is not being used, which is the case in this issue, and the argument is not being found since it is not in user_configuration.json.
This should be resolved by now and available in the latest release