prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  AMD graphics driver selection unclear
  For AMD, the options are by no means obvious in what they actually do.
  
  The recommended choice should in my opinion be mesa (packages mesa and radeon-vulkan).
  If you want to go by vendor in the first table, then mesa should be moved into the secondary table, i.e. when selecting AMD you get the choice between AMDVLK and mesa. The current situation is just confusing.
  
  </issue>
  <code>
  [start of archinstall/lib/hardware.py]
  1 import os, subprocess, json
  2 from .general import sys_command
  3 from .networking import list_interfaces, enrichIfaceTypes
  4 from typing import Optional
  5 
  6 __packages__ = ['xf86-video-amdgpu', 'xf86-video-ati', 'xf86-video-intel', 'xf86-video-nouveau', 'xf86-video-fbdev', 'xf86-video-vesa', 'xf86-video-vmware', 'nvidia', 'mesa']
  7 
  8 AVAILABLE_GFX_DRIVERS = {
  9 	# Sub-dicts are layer-2 options to be selected
  10 	# and lists are a list of packages to be installed
  11 	'AMD / ATI' : {
  12 		'amd' : ['xf86-video-amdgpu'],
  13 		'ati' : ['xf86-video-ati']
  14 	},
  15 	'intel' : ['xf86-video-intel'],
  16 	'nvidia' : {
  17 		'open-source' : ['xf86-video-nouveau'],
  18 		'proprietary' : ['nvidia']
  19 	},
  20 	'mesa' : ['mesa'],
  21 	'fbdev' : ['xf86-video-fbdev'],
  22 	'vesa' : ['xf86-video-vesa'],
  23 	'vmware / virtualbox' : ['xf86-video-vmware']
  24 }
  25 
  26 def hasWifi()->bool:
  27 	return 'WIRELESS' in enrichIfaceTypes(list_interfaces().values()).values()
  28 
  29 def hasAMDCPU()->bool:
  30 	if subprocess.check_output("lscpu | grep AMD", shell=True).strip().decode():
  31 		return True
  32 	return False
  33 def hasIntelCPU()->bool:
  34 	if subprocess.check_output("lscpu | grep Intel", shell=True).strip().decode():
  35 		return True
  36 	return False
  37 
  38 def hasUEFI()->bool:
  39 	return os.path.isdir('/sys/firmware/efi')
  40 
  41 def graphicsDevices()->dict:
  42 	cards = {}
  43 	for line in sys_command(f"lspci"):
  44 		if b' VGA ' in line:
  45 			_, identifier = line.split(b': ',1)
  46 			cards[identifier.strip().lower().decode('UTF-8')] = line
  47 	return cards
  48 
  49 def hasNvidiaGraphics()->bool:
  50 	return any('nvidia' in x for x in graphicsDevices())
  51 
  52 def hasAmdGraphics()->bool:
  53 	return any('amd' in x for x in graphicsDevices())
  54 
  55 def hasIntelGraphics()->bool:
  56 	return any('intel' in x for x in graphicsDevices())
  57 
  58 
  59 def cpuVendor()-> Optional[str]:
  60 	cpu_info = json.loads(subprocess.check_output("lscpu -J", shell=True).decode('utf-8'))['lscpu']
  61 	for info in cpu_info:
  62 		if info.get('field',None):
  63 			if info.get('field',None) == "Vendor ID:":
  64 				return info.get('data',None)
  65 
  66 def isVM() -> bool:
  67 	try:
  68 		subprocess.check_call(["systemd-detect-virt"]) # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine
  69 		return True
  70 	except:
  71 		return False
  72 
  73 # TODO: Add more identifiers
  74
  [end of archinstall/lib/hardware.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
  --- a/archinstall/lib/hardware.py
  +++ b/archinstall/lib/hardware.py
  @@ -3,24 +3,53 @@
   from .networking import list_interfaces, enrichIfaceTypes
   from typing import Optional
   
  -__packages__ = ['xf86-video-amdgpu', 'xf86-video-ati', 'xf86-video-intel', 'xf86-video-nouveau', 'xf86-video-fbdev', 'xf86-video-vesa', 'xf86-video-vmware', 'nvidia', 'mesa']
  +__packages__ = [
  +		"mesa",
  +		"xf86-video-amdgpu",
  +		"xf86-video-ati",
  +		"xf86-video-nouveau",
  +		"xf86-video-vmware",
  +		"libva-mesa-driver",
  +		"libva-intel-driver",
  +		"intel-media-driver",
  +		"vulkan-radeon",
  +		"vulkan-intel",
  +		"nvidia",
  +]
   
   AVAILABLE_GFX_DRIVERS = {
   	# Sub-dicts are layer-2 options to be selected
   	# and lists are a list of packages to be installed
  -	'AMD / ATI' : {
  -		'amd' : ['xf86-video-amdgpu'],
  -		'ati' : ['xf86-video-ati']
  +	"All open-source (default)": [
  +		"mesa",
  +		"xf86-video-amdgpu",
  +		"xf86-video-ati",
  +		"xf86-video-nouveau",
  +		"xf86-video-vmware",
  +		"libva-mesa-driver",
  +		"libva-intel-driver",
  +		"intel-media-driver",
  +		"vulkan-radeon",
  +		"vulkan-intel",
  +	],
  +	"AMD / ATI (open-source)": [
  +		"mesa",
  +		"xf86-video-amdgpu",
  +		"xf86-video-ati",
  +		"libva-mesa-driver",
  +		"vulkan-radeon",
  +	],
  +	"Intel (open-source)": [
  +		"mesa",
  +		"libva-intel-driver",
  +		"intel-media-driver",
  +		"vulkan-intel",
  +	],
  +	"Nvidia": {
  +		"open-source": ["mesa", "xf86-video-nouveau", "libva-mesa-driver"],
  +		"proprietary": ["nvidia"],
   	},
  -	'intel' : ['xf86-video-intel'],
  -	'nvidia' : {
  -		'open-source' : ['xf86-video-nouveau'],
  -		'proprietary' : ['nvidia']
  -	},
  -	'mesa' : ['mesa'],
  -	'fbdev' : ['xf86-video-fbdev'],
  -	'vesa' : ['xf86-video-vesa'],
  -	'vmware / virtualbox' : ['xf86-video-vmware']
  +	"VMware / VirtualBox (open-source)": ["mesa", "xf86-video-vmware"],
   }
   
   def hasWifi()->bool:
  
verification_info: {"golden_diff": "diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py\n--- a/archinstall/lib/hardware.py\n+++ b/archinstall/lib/hardware.py\n@@ -3,24 +3,53 @@\n from .networking import list_interfaces, enrichIfaceTypes\n from typing import Optional\n \n-__packages__ = ['xf86-video-amdgpu', 'xf86-video-ati', 'xf86-video-intel', 'xf86-video-nouveau', 'xf86-video-fbdev', 'xf86-video-vesa', 'xf86-video-vmware', 'nvidia', 'mesa']\n+__packages__ = [\n+\t\t\"mesa\",\n+\t\t\"xf86-video-amdgpu\",\n+\t\t\"xf86-video-ati\",\n+\t\t\"xf86-video-nouveau\",\n+\t\t\"xf86-video-vmware\",\n+\t\t\"libva-mesa-driver\",\n+\t\t\"libva-intel-driver\",\n+\t\t\"intel-media-driver\",\n+\t\t\"vulkan-radeon\",\n+\t\t\"vulkan-intel\",\n+\t\t\"nvidia\",\n+]\n \n AVAILABLE_GFX_DRIVERS = {\n \t# Sub-dicts are layer-2 options to be selected\n \t# and lists are a list of packages to be installed\n-\t'AMD / ATI' : {\n-\t\t'amd' : ['xf86-video-amdgpu'],\n-\t\t'ati' : ['xf86-video-ati']\n+\t\"All open-source (default)\": [\n+\t\t\"mesa\",\n+\t\t\"xf86-video-amdgpu\",\n+\t\t\"xf86-video-ati\",\n+\t\t\"xf86-video-nouveau\",\n+\t\t\"xf86-video-vmware\",\n+\t\t\"libva-mesa-driver\",\n+\t\t\"libva-intel-driver\",\n+\t\t\"intel-media-driver\",\n+\t\t\"vulkan-radeon\",\n+\t\t\"vulkan-intel\",\n+\t],\n+\t\"AMD / ATI (open-source)\": [\n+\t\t\"mesa\",\n+\t\t\"xf86-video-amdgpu\",\n+\t\t\"xf86-video-ati\",\n+\t\t\"libva-mesa-driver\",\n+\t\t\"vulkan-radeon\",\n+\t],\n+\t\"Intel (open-source)\": [\n+\t\t\"mesa\",\n+\t\t\"libva-intel-driver\",\n+\t\t\"intel-media-driver\",\n+\t\t\"vulkan-intel\",\n+\t],\n+\t\"Nvidia\": {\n+\t\t\"open-source\": [\"mesa\", \"xf86-video-nouveau\", \"libva-mesa-driver\"],\n+\t\t\"proprietary\": [\"nvidia\"],\n \t},\n-\t'intel' : ['xf86-video-intel'],\n-\t'nvidia' : {\n-\t\t'open-source' : ['xf86-video-nouveau'],\n-\t\t'proprietary' : ['nvidia']\n-\t},\n-\t'mesa' : ['mesa'],\n-\t'fbdev' : ['xf86-video-fbdev'],\n-\t'vesa' : ['xf86-video-vesa'],\n-\t'vmware / virtualbox' : ['xf86-video-vmware']\n+\t\"VMware / VirtualBox (open-source)\": [\"mesa\", \"xf86-video-vmware\"],\n }\n \n def hasWifi()->bool:\n", "issue": "AMD graphics driver selection unclear\nFor AMD, the options are by no means obvious in what they actually do.\r\n\r\nThe recommended choice should in my opinion be mesa (packages mesa and radeon-vulkan).\r\nIf you want to go by vendor in the first table, then mesa should be moved into the secondary table, i.e. when selecting AMD you get the choice between AMDVLK and mesa. The current situation is just confusing.\n", "before_files": [{"content": "import os, subprocess, json\nfrom .general import sys_command\nfrom .networking import list_interfaces, enrichIfaceTypes\nfrom typing import Optional\n\n__packages__ = ['xf86-video-amdgpu', 'xf86-video-ati', 'xf86-video-intel', 'xf86-video-nouveau', 'xf86-video-fbdev', 'xf86-video-vesa', 'xf86-video-vmware', 'nvidia', 'mesa']\n\nAVAILABLE_GFX_DRIVERS = {\n\t# Sub-dicts are layer-2 options to be selected\n\t# and lists are a list of packages to be installed\n\t'AMD / ATI' : {\n\t\t'amd' : ['xf86-video-amdgpu'],\n\t\t'ati' : ['xf86-video-ati']\n\t},\n\t'intel' : ['xf86-video-intel'],\n\t'nvidia' : {\n\t\t'open-source' : ['xf86-video-nouveau'],\n\t\t'proprietary' : ['nvidia']\n\t},\n\t'mesa' : ['mesa'],\n\t'fbdev' : ['xf86-video-fbdev'],\n\t'vesa' : ['xf86-video-vesa'],\n\t'vmware / virtualbox' : ['xf86-video-vmware']\n}\n\ndef hasWifi()->bool:\n\treturn 'WIRELESS' in enrichIfaceTypes(list_interfaces().values()).values()\n\ndef hasAMDCPU()->bool:\n\tif subprocess.check_output(\"lscpu | grep AMD\", shell=True).strip().decode():\n\t\treturn True\n\treturn False\ndef hasIntelCPU()->bool:\n\tif subprocess.check_output(\"lscpu | grep Intel\", shell=True).strip().decode():\n\t\treturn True\n\treturn False\n\ndef hasUEFI()->bool:\n\treturn os.path.isdir('/sys/firmware/efi')\n\ndef graphicsDevices()->dict:\n\tcards = {}\n\tfor line in sys_command(f\"lspci\"):\n\t\tif b' VGA ' in line:\n\t\t\t_, identifier = line.split(b': ',1)\n\t\t\tcards[identifier.strip().lower().decode('UTF-8')] = line\n\treturn cards\n\ndef hasNvidiaGraphics()->bool:\n\treturn any('nvidia' in x for x in graphicsDevices())\n\ndef hasAmdGraphics()->bool:\n\treturn any('amd' in x for x in graphicsDevices())\n\ndef hasIntelGraphics()->bool:\n\treturn any('intel' in x for x in graphicsDevices())\n\n\ndef cpuVendor()-> Optional[str]:\n\tcpu_info = json.loads(subprocess.check_output(\"lscpu -J\", shell=True).decode('utf-8'))['lscpu']\n\tfor info in cpu_info:\n\t\tif info.get('field',None):\n\t\t\tif info.get('field',None) == \"Vendor ID:\":\n\t\t\t\treturn info.get('data',None)\n\ndef isVM() -> bool:\n\ttry:\n\t\tsubprocess.check_call([\"systemd-detect-virt\"]) # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine\n\t\treturn True\n\texcept:\n\t\treturn False\n\n# TODO: Add more identifiers\n", "path": "archinstall/lib/hardware.py"}]}