Repository: archlinux/archinstall

Issue:
KeyError: 'children' trying to create VM uefi systemboot and xfs
Attached files with a zip because it does not support json files.
[otherfiles.zip](https://github.com/archlinux/archinstall/files/8496385/otherfiles.zip)
[cmd_history.txt](https://github.com/archlinux/archinstall/files/8496378/cmd_history.txt)
[install.log](https://github.com/archlinux/archinstall/files/8496379/install.log)

Below is also the log from the terminal. I was trying to create a VM in UEFI mode and XFS with systemboot and no vram.
It looks like the fail is in the second partition creation. Error is KeyError: 'children'.

This is your chosen configuration:
```
{
    "audio": null,
    "bootloader": "systemd-bootctl",
    "config": null,
    "creds": null,
    "debug": false,
    "desktop-environment": "gnome",
    "disk_layouts": null,
    "dry_run": false,
    "gfx_driver": "All open-source (default)",
    "harddrives": [
        "/dev/vda"
    ],
    "hostname": "arch9002",
    "kernels": [
        "linux"
    ],
    "keyboard-layout": "pt-latin1",
    "mirror-region": {
        "Portugal": {
            "http://ftp.rnl.tecnico.ulisboa.pt/pub/archlinux/$repo/os/$arch": true,
            "http://glua.ua.pt/pub/archlinux/$repo/os/$arch": true,
            "https://ftp.rnl.tecnico.ulisboa.pt/pub/archlinux/$repo/os/$arch": true,
            "https://glua.ua.pt/pub/archlinux/$repo/os/$arch": true
        }
    },
    "mount_point": null,
    "nic": {
        "NetworkManager": true,
        "nic": "Use NetworkManager (necessary to configure internet graphically in GNOME and KDE)"
    },
    "ntp": true,
    "packages": [],
    "plugin": null,
    "profile": {
        "path": "/usr/lib/python3.10/site-packages/archinstall/profiles/desktop.py"
    },
    "script": "guided",
    "silent": false,
    "swap": false,
    "sys-encoding": "utf-8",
    "sys-language": "en_US",
    "timezone": "Europe/Lisbon",
    "version": "2.3.3"
}

Press Enter to continue.
 ! Formatting [BlockDevice(/dev/vda, size=20.0GB, free_space=, bus_type=None)] in 5....4....3....2....1....
Creating a new partition label on /dev/vda
Adding partition to BlockDevice(/dev/vda, size=20.0GB, free_space=21.5GB, bus_type=None), 5MB->513MB
Formatting /dev/vda1 -> vfat
Marking partition Partition(path=/dev/vda1, size=0.5, PARTUUID=80964b82-9472-4327-b908-edc3f83f510e, fs=vfat) as bootable.
Traceback (most recent call last):
  File "/usr/bin/archinstall", line 33, in <module>
    sys.exit(load_entry_point('archinstall==2.3.3', 'console_scripts', 'archinstall')())
  File "/usr/lib/python3.10/site-packages/archinstall/__init__.py", line 198, in run_as_a_module
    script.execute()
  File "/usr/lib/python3.10/site-packages/archinstall/lib/profiles.py", line 180, 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 385, in <module>
    perform_filesystem_operations()
  File "/usr/lib/python3.10/site-packages/archinstall/examples/guided.py", line 254, in perform_filesystem_operations
    with archinstall.Filesystem(drive, mode) as fs:
  File "/usr/lib/python3.10/site-packages/archinstall/lib/disk/filesystem.py", line 33, in __exit__
    raise args[1]
  File "/usr/lib/python3.10/site-packages/archinstall/examples/guided.py", line 255, in perform_filesystem_operations
    fs.load_layout(archinstall.storage['disk_layouts'][drive.path])
  File "/usr/lib/python3.10/site-packages/archinstall/lib/disk/filesystem.py", line 139, in load_layout
    self.set(self.partuuid_to_index(partition['device_instance'].uuid), 'boot on')
  File "/usr/lib/python3.10/site-packages/archinstall/lib/disk/filesystem.py", line 46, in partuuid_to_index
    for index, partition in enumerate(device['children']):
KeyError: 'children'
```
lsblk output:
```
1 root@archiso ~ # lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0    7:0    0 666.3M  1 loop /run/archiso/airootfs
sr0     11:0    1 824.3M  0 rom  /run/archiso/bootmnt
vda    254:0    0    20G  0 disk 
└─vda1 254:1    0   484M  0 part 
root@archiso ~ #
```


Discussion:
I haven't tested installing to a `virtio` para-virtualized device, but I suspect they will behave differently in some regard and we have to take that into account. I suspect that this is similar to the issue in #671 although that error message will be different because it was reported on a much older archinstall version. But I suspect the underlying causes are the same.

The backlog is pretty steep, but I will have a look at it in due time! :)

Resolving patch:
diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py
--- a/archinstall/lib/disk/filesystem.py
+++ b/archinstall/lib/disk/filesystem.py
@@ -55,7 +55,7 @@ def partuuid_to_index(self, uuid :str) -> Optional[int]:
 			output = json.loads(SysCommand(f"lsblk --json {self.blockdevice.device}").decode('UTF-8'))
 
 			for device in output['blockdevices']:
-				for index, partition in enumerate(device['children']):
+				for index, partition in enumerate(device.get('children', [])):
 					# But we'll use blkid to reliably grab the PARTUUID for that child device (partition)
 					partition_uuid = SysCommand(f"blkid -s PARTUUID -o value /dev/{partition.get('name')}").decode().strip()
 					if partition_uuid.lower() == uuid.lower():


Test patch: