diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e4b0710 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "packages/pve-manager/pve-manager"] + path = packages/pve-manager/pve-manager + url = https://git.proxmox.com/git/pve-manager.git +[submodule "packages/qemu-server/qemu-server"] + path = packages/qemu-server/qemu-server + url = https://git.proxmox.com/git/qemu-server.git diff --git a/Patchs/QemuServer/.DS_Store b/Patchs/QemuServer/.DS_Store deleted file mode 100644 index 5008ddf..0000000 Binary files a/Patchs/QemuServer/.DS_Store and /dev/null differ diff --git a/Patchs/QemuServer/qemu-server-6_4_2.patch b/Patchs/QemuServer/qemu-server-6_4_2.patch deleted file mode 100644 index 5903917..0000000 --- a/Patchs/QemuServer/qemu-server-6_4_2.patch +++ /dev/null @@ -1,377 +0,0 @@ -diff -Nur -x .git a/Makefile b/Makefile ---- a/Makefile 2023-07-21 18:58:16.574930367 +0800 -+++ b/Makefile 2023-07-21 18:56:39.570811493 +0800 -@@ -98,18 +98,12 @@ - cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d - lintian ${DSC} - --.PHONY: test --test: -- PVE_GENERATING_DOCS=1 perl -I. ./qm verifyapi -- $(MAKE) -C test -- - .PHONY: upload - upload: ${DEB} - tar cf - ${DEBS} | ssh -X repoman@repo.proxmox.com upload --product pve --dist buster - - .PHONY: clean - clean: -- $(MAKE) -C test $@ - rm -rf $(PACKAGE)-*/ *.deb *.buildinfo *.changes *.dsc $(PACKAGE)_*.tar.gz - $(MAKE) cleanup-docgen - find . -name '*~' -exec rm {} ';' -diff -Nur -x .git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm ---- a/PVE/CLI/qm.pm 2023-07-21 18:58:16.578930372 +0800 -+++ b/PVE/CLI/qm.pm 2023-07-21 18:56:39.594811522 +0800 -@@ -217,7 +217,7 @@ - my $vnc_socket = PVE::QemuServer::Helpers::vnc_socket($vmid); - - if (my $ticket = $ENV{LC_PVE_TICKET}) { # NOTE: ssh on debian only pass LC_* variables -- mon_cmd($vmid, "change", device => 'vnc', target => "unix:$vnc_socket,password"); -+#no need this mon_cmd($vmid, "change", device => 'vnc', target => "unix:$vnc_socket,password"); - mon_cmd($vmid, "set_password", protocol => 'vnc', password => $ticket); - mon_cmd($vmid, "expire_password", protocol => 'vnc', time => "+30"); - } else { -diff -Nur -x .git a/PVE/QemuServer/CPUConfig.pm b/PVE/QemuServer/CPUConfig.pm ---- a/PVE/QemuServer/CPUConfig.pm 2023-07-21 18:58:16.578930372 +0800 -+++ b/PVE/QemuServer/CPUConfig.pm 2023-07-21 18:56:39.598811527 +0800 -@@ -456,9 +456,12 @@ - - my $cputype = $kvm ? "kvm64" : "qemu64"; - if ($arch eq 'aarch64') { -- $cputype = 'cortex-a57'; -+ $cputype = 'host'; -+ } elsif ($arch eq 'riscv64') { -+ $cputype = 'rv64'; -+ } elsif ($arch eq 'loongarch64'){ -+ $cputype = 'la464-loongarch-cpu'; - } -- - my $cpu = {}; - my $custom_cpu; - my $hv_vendor_id; -@@ -519,7 +522,7 @@ - $pve_forced_flags->{'vendor'} = { - value => $cpu_vendor, - } if $cpu_vendor ne 'default'; -- } elsif ($arch ne 'aarch64') { -+ } elsif ($arch eq 'x86_64') { - die "internal error"; # should not happen - } - -diff -Nur -x .git a/PVE/QemuServer/PCI.pm b/PVE/QemuServer/PCI.pm ---- a/PVE/QemuServer/PCI.pm 2023-07-21 18:58:16.582930377 +0800 -+++ b/PVE/QemuServer/PCI.pm 2023-07-21 18:56:39.598811527 +0800 -@@ -240,8 +240,8 @@ - - # using same bus slots on all HW, so we need to check special cases here: - my $busname = 'pci'; -- if ($arch eq 'aarch64' && $machine =~ /^virt/) { -- die "aarch64/virt cannot use IDE devices\n" if $id =~ /^ide/; -+ if ($arch ne 'x86_64' && $machine =~ /^virt/) { -+ die "virt cannot use IDE devices\n" if $id =~ /^ide/; - $busname = 'pcie'; - } - -diff -Nur -x .git a/PVE/QemuServer/USB.pm b/PVE/QemuServer/USB.pm ---- a/PVE/QemuServer/USB.pm 2023-07-21 18:58:16.582930377 +0800 -+++ b/PVE/QemuServer/USB.pm 2023-07-21 18:56:39.598811527 +0800 -@@ -39,9 +39,9 @@ - my $devices = []; - my $pciaddr = ""; - -- if ($arch eq 'aarch64') { -- $pciaddr = print_pci_addr('ehci', $bridges, $arch, $machine); -- push @$devices, '-device', "usb-ehci,id=ehci$pciaddr"; -+ if ($arch ne 'x86_64') { -+ $pciaddr = print_pci_addr('qemu-xhci', $bridges, $arch, $machine); -+ push @$devices, '-device', "qemu-xhci,id=qemu-xhci"; - } elsif ($machine !~ /q35/) { # FIXME: combine this and machine_type_is_q35 - $pciaddr = print_pci_addr("piix3", $bridges, $arch, $machine); - push @$devices, '-device', "piix3-usb-uhci,id=uhci$pciaddr.0x2"; -diff -Nur -x .git a/PVE/QemuServer.pm b/PVE/QemuServer.pm ---- a/PVE/QemuServer.pm 2023-07-21 18:58:16.578930372 +0800 -+++ b/PVE/QemuServer.pm 2023-07-21 18:56:39.594811522 +0800 -@@ -71,6 +71,14 @@ - "$EDK2_FW_BASE/AAVMF_CODE.fd", - "$EDK2_FW_BASE/AAVMF_VARS.fd" - ], -+ loongarch64 => [ -+ "$EDK2_FW_BASE/LOONGARCH_CODE.fd", -+ "$EDK2_FW_BASE/LOONGARCH_VARS.fd", -+ ], -+ riscv64 => [ -+ "$EDK2_FW_BASE/RISCV_CODE.fd", -+ "$EDK2_FW_BASE/RISCV_VARS.fd", -+ ], - }; - - my $cpuinfo = PVE::ProcFSTools::read_cpuinfo(); -@@ -607,7 +615,7 @@ - description => "Virtual processor architecture. Defaults to the host.", - optional => 1, - type => 'string', -- enum => [qw(x86_64 aarch64)], -+ enum => [qw(x86_64 aarch64 riscv64 loongarch64)], - }, - smbios1 => { - description => "Specify SMBIOS type 1 fields.", -@@ -1388,8 +1396,8 @@ - - # we use uhci for old VMs because tablet driver was buggy in older qemu - my $usbbus; -- if (PVE::QemuServer::Machine::machine_type_is_q35($conf) || $arch eq 'aarch64') { -- $usbbus = 'ehci'; -+ if (PVE::QemuServer::Machine::machine_type_is_q35($conf) || $arch ne 'x86_64') { -+ $usbbus = 'qemu-xhci'; - } else { - $usbbus = 'uhci'; - } -@@ -1400,9 +1408,9 @@ - sub print_keyboarddevice_full { - my ($conf, $arch, $machine) = @_; - -- return if $arch ne 'aarch64'; -+ return if $arch eq 'x86_64'; - -- return "usb-kbd,id=keyboard,bus=ehci.0,port=2"; -+ return "usb-kbd,id=keyboard,bus=qemu-xhci.0,port=2"; - } - - my sub get_drive_id { -@@ -1753,7 +1761,7 @@ - my ($conf, $vga, $arch, $machine_version, $machine, $id, $qxlnum, $bridges) = @_; - - my $type = $vga_map->{$vga->{type}}; -- if ($arch eq 'aarch64' && defined($type) && $type eq 'virtio-vga') { -+ if ($arch ne 'x86_64' && defined($type) && $type eq 'virtio-vga') { - $type = 'virtio-gpu'; - } - my $vgamem_mb = $vga->{memory}; -@@ -2934,6 +2942,8 @@ - my $default_machines = { - x86_64 => 'pc', - aarch64 => 'virt', -+ loongarch64 => 'virt', -+ riscv64 => 'virt', - }; - - sub get_installed_machine_version { -@@ -3012,6 +3022,8 @@ - my $Arch2Qemu = { - aarch64 => '/usr/bin/qemu-system-aarch64', - x86_64 => '/usr/bin/qemu-system-x86_64', -+ riscv64 => '/usr/bin/qemu-system-riscv64', -+ loongarch64 => '/usr/bin/qemu-system-loongarch64', - }; - sub get_command_for_arch($) { - my ($arch) = @_; -@@ -3052,8 +3064,8 @@ - - # FIXME: Once this is merged, the code below should work for ARM as well: - # https://lists.nongnu.org/archive/html/qemu-devel/2019-06/msg04947.html -- die "QEMU/KVM cannot detect CPU flags on ARM (aarch64)\n" if -- $arch eq "aarch64"; -+ die "QEMU/KVM only can detect CPU flags on x86_64\n" if -+ $arch ne "x86_64"; - - my $kvm_supported = defined(kvm_version()); - my $qemu_cmd = get_command_for_arch($arch); -@@ -3069,7 +3081,7 @@ - $qemu_cmd, - '-machine', $default_machine, - '-display', 'none', -- '-chardev', "socket,id=qmp,path=/var/run/qemu-server/$fakevmid.qmp,server,nowait", -+ '-chardev', "socket,id=qmp,path=/var/run/qemu-server/$fakevmid.qmp,server=on,wait=off", - '-mon', 'chardev=qmp,mode=control', - '-pidfile', $pidfile, - '-S', '-daemonize' -@@ -3226,7 +3238,7 @@ - my $use_virtio = 0; - - my $qmpsocket = PVE::QemuServer::Helpers::qmp_socket($vmid); -- push @$cmd, '-chardev', "socket,id=qmp,path=$qmpsocket,server,nowait"; -+ push @$cmd, '-chardev', "socket,id=qmp,path=$qmpsocket,server=on,wait=off"; - push @$cmd, '-mon', "chardev=qmp,mode=control"; - - if (min_version($machine_version, 2, 12)) { -@@ -3240,6 +3252,8 @@ - - if ($conf->{smbios1}) { - my $smbios_conf = parse_smbios1($conf->{smbios1}); -+ # other not need smbios -+ if ( $arch eq 'x86_64' ||$arch eq 'aarch64' ){ - if ($smbios_conf->{base64}) { - # Do not pass base64 flag to qemu - delete $smbios_conf->{base64}; -@@ -3260,6 +3274,7 @@ - push @$cmd, '-smbios', "type=1,$conf->{smbios1}"; - } - } -+ } - - if ($conf->{bios} && $conf->{bios} eq 'ovmf') { - my ($ovmf_code, $ovmf_vars) = get_ovmf_files($arch); -@@ -3293,12 +3308,20 @@ - if ($format eq 'raw' && $version_guard->(4, 1, 2)) { - $size_str = ",size=" . (-s $ovmf_vars); - } -- -- push @$cmd, '-drive', "if=pflash,unit=0,format=raw,readonly,file=$ovmf_code"; -- push @$cmd, '-drive', "if=pflash,unit=1,format=$format,id=drive-efidisk0$size_str,file=$path"; -+ if ($arch eq 'loongarch64') { -+ push @$cmd, '-bios','/usr/share/pve-edk2-firmware//LOONGARCH_CODE.fd'; -+ } elsif ($arch eq 'riscv64') { -+ push @$cmd, '-bios','/usr/share/pve-edk2-firmware//fw_dynamic.bin'; -+ push @$cmd, '-drive', "if=pflash,unit=0,format=raw,readonly,file=$ovmf_code"; -+ push @$cmd, '-drive', "if=pflash,unit=1,format=$format,id=drive-efidisk0$size_str,file=$path"; -+ }else { -+ push @$cmd, '-drive', "if=pflash,unit=0,format=raw,readonly,file=$ovmf_code"; -+ push @$cmd, '-drive', "if=pflash,unit=1,format=$format,id=drive-efidisk0$size_str,file=$path"; - } -+ } - - # load q35 config -+ if ($arch eq 'x86_64'){ - if ($q35) { - # we use different pcie-port hardware for qemu >= 4.0 for passthrough - if (min_version($machine_version, 4, 0)) { -@@ -3307,10 +3330,16 @@ - push @$devices, '-readconfig', '/usr/share/qemu-server/pve-q35.cfg'; - } - } -+ } else { -+ push @$devices, '-readconfig', '/usr/share/qemu-server/pve-port.cfg'; -+ } - -- if ($conf->{vmgenid}) { -- push @$devices, '-device', 'vmgenid,guid='.$conf->{vmgenid}; -- } -+ # only x86_64 need vmgenid -+ if ($arch eq 'x86_64'){ -+ if ($conf->{vmgenid}) { -+ push @$devices, '-device', 'vmgenid,guid='.$conf->{vmgenid}; -+ } -+ } - - # add usb controllers - my @usbcontrollers = PVE::QemuServer::USB::get_usb_controllers( -@@ -3322,7 +3351,7 @@ - $vga->{type} = 'qxl' if $qxlnum; - - if (!$vga->{type}) { -- if ($arch eq 'aarch64') { -+ if ($arch ne 'x86_64') { - $vga->{type} = 'virtio'; - } elsif (min_version($machine_version, 2, 9)) { - $vga->{type} = (!$winversion || $winversion >= 6) ? 'std' : 'cirrus'; -@@ -3366,11 +3395,11 @@ - if (my $path = $conf->{"serial$i"}) { - if ($path eq 'socket') { - my $socket = "/var/run/qemu-server/${vmid}.serial$i"; -- push @$devices, '-chardev', "socket,id=serial$i,path=$socket,server,nowait"; -+ push @$devices, '-chardev', "socket,id=serial$i,path=$socket,server=on,wait=off"; - # On aarch64, serial0 is the UART device. Qemu only allows - # connecting UART devices via the '-serial' command line, as - # the device has a fixed slot on the hardware... -- if ($arch eq 'aarch64' && $i == 0) { -+ if ($arch ne 'x86_64' && $i == 0) { - push @$devices, '-serial', "chardev:serial$i"; - } else { - push @$devices, '-device', "isa-serial,chardev=serial$i"; -@@ -3438,7 +3467,7 @@ - push @$devices, '-device', print_vga_device( - $conf, $vga, $arch, $machine_version, $machine_type, undef, $qxlnum, $bridges); - my $socket = PVE::QemuServer::Helpers::vnc_socket($vmid); -- push @$cmd, '-vnc', "unix:$socket,password"; -+ push @$cmd, '-vnc', "unix:$socket,password=on"; - } else { - push @$cmd, '-vga', 'none' if $vga->{type} eq 'none'; - push @$cmd, '-nographic'; -@@ -3486,7 +3515,7 @@ - - if ($guest_agent->{enabled}) { - my $qgasocket = PVE::QemuServer::Helpers::qmp_socket($vmid, 1); -- push @$devices, '-chardev', "socket,path=$qgasocket,server,nowait,id=qga0"; -+ push @$devices, '-chardev', "socket,path=$qgasocket,server=on,wait=off,id=qga0"; - - if (!$guest_agent->{type} || $guest_agent->{type} eq 'virtio') { - my $pciaddr = print_pci_addr("qga0", $bridges, $arch, $machine_type); -@@ -4545,10 +4574,10 @@ - if ($defaults->{tablet}) { - vm_deviceplug($storecfg, $conf, $vmid, 'tablet', $arch, $machine_type); - vm_deviceplug($storecfg, $conf, $vmid, 'keyboard', $arch, $machine_type) -- if $arch eq 'aarch64'; -+ if $arch ne 'x86_x64'; - } else { - vm_deviceunplug($vmid, $conf, 'tablet'); -- vm_deviceunplug($vmid, $conf, 'keyboard') if $arch eq 'aarch64'; -+ vm_deviceunplug($vmid, $conf, 'keyboard') if $arch ne 'x86_x64'; - } - } elsif ($opt =~ m/^usb\d+/) { - die "skip\n"; -@@ -4628,10 +4657,10 @@ - if ($value == 1) { - vm_deviceplug($storecfg, $conf, $vmid, 'tablet', $arch, $machine_type); - vm_deviceplug($storecfg, $conf, $vmid, 'keyboard', $arch, $machine_type) -- if $arch eq 'aarch64'; -+ if $arch ne 'x86_64'; - } elsif ($value == 0) { - vm_deviceunplug($vmid, $conf, 'tablet'); -- vm_deviceunplug($vmid, $conf, 'keyboard') if $arch eq 'aarch64'; -+ vm_deviceunplug($vmid, $conf, 'keyboard') if $arch ne 'x86_64'; - } - } elsif ($opt =~ m/^usb\d+$/) { - die "skip\n"; -diff -Nur -x .git a/qemu-configs/Makefile b/qemu-configs/Makefile ---- a/qemu-configs/Makefile 2023-07-21 18:58:04.294915319 +0800 -+++ b/qemu-configs/Makefile 2023-07-21 18:56:39.598811527 +0800 -@@ -2,11 +2,12 @@ - USRSHAREDIR=$(DESTDIR)/usr/share/qemu-server - - .PHONY: install --install: pve-usb.cfg pve-q35.cfg pve-q35-4.0.cfg -+install: pve-usb.cfg pve-q35.cfg pve-q35-4.0.cfg pve-port.cfg - install -d $(USRSHAREDIR) - install -m 0644 pve-usb.cfg $(USRSHAREDIR) - install -m 0644 pve-q35.cfg $(USRSHAREDIR) - install -m 0644 pve-q35-4.0.cfg $(USRSHAREDIR) -+ install -m 0644 pve-port.cfg $(USRSHAREDIR) - - .PHONY: clean - clean: -diff -Nur -x .git a/qemu-configs/pve-port.cfg b/qemu-configs/pve-port.cfg ---- a/qemu-configs/pve-port.cfg 1970-01-01 08:00:00.000000000 +0800 -+++ b/qemu-configs/pve-port.cfg 2023-07-21 18:56:39.598811527 +0800 -@@ -0,0 +1,30 @@ -+[device "pcie.1"] -+ driver = "pci-bridge" -+ bus = "pcie.0" -+ addr = "0xa" -+ chassis_nr = "1" -+ -+#[device "pciroot"] -+# driver = "pci-bridge" -+# bus = "pci.1" -+# addr = "1.0" -+# chassis_nr = "1" -+ -+[device "pcie.2"] -+ driver = "pci-bridge" -+ bus = "pci.1" -+ addr = "1.0" -+ chassis_nr = "2" -+ -+ -+[device "pcie.3"] -+ driver = "pci-bridge" -+ bus = "pci.2" -+ addr = "1.0" -+ chassis_nr = "3" -+ -+[device "pcie.4"] -+ driver = "pci-bridge" -+ bus = "pci.2" -+ addr = "2.0" -+ chassis_nr = "4" -\ No newline at end of file diff --git a/help/helpindex.md b/help/helpindex.md deleted file mode 100644 index 3fafa75..0000000 --- a/help/helpindex.md +++ /dev/null @@ -1,9 +0,0 @@ -# Help - -## Kernel - -[kernel.md](./kernel.md) - -## Port Registry - -[repo.md](./repo.md) diff --git a/help/kernel.md b/help/kernel.md deleted file mode 100644 index e6169ae..0000000 --- a/help/kernel.md +++ /dev/null @@ -1,95 +0,0 @@ -# Proxmox Port Kernel - -I forked a kernel project: - - `https://github.com/jiangcuo/pve-port-kernel.git` - -The pre-build kernel file of this project is stored in the repo: - -`deb https://global.mirrors.apqa.cn/proxmox/debian/kernel sid port` - -Currently, there are two architectures: LoongArch64 and ARM64. - -The config in the kernel selects all arm64 devices and can theoretically be used for all. - -## 1. How to install the kernel - -### 1.1 Use apt - -```bash -#add repo -$ echo "deb https://global.mirrors.apqa.cn/proxmox/debian/kernel sid port" >> /etc/apt/sources.list.d/pveport.list - -#fresh -$ apt update - -#Lists the available kernels -$ apt search pve-kernel - -#install latest kernel by metapackage -$ apt install pve-kernel-6.1-generic -``` - -### 1.2 Use dpkg - -download kernel package form project releases or repo, use -`dpkg -i pve-kernel-*` to install. - -### 1.3 Boot from new kernel - -A PC booted with should automatically set the latest kernel as the first boot kernel. You just need reboot to apply. - -If you encounter a failure with a new kernel ,reboot to grub, select Advanced, and in the next options, select the previous kernel. - - -### 1.3 uboot devices - -The uboot device will read the `/{boot_partition}/extlinux/extlinux.conf` file on the boot. - -```bash -# if your boot_partition is /dev/mmcblk0p3 -$ mount /dev/mmcblk0p3 /opt -# if pve kernel vmlinuz is vmlinuz-6.1.60-generic -$ cp /boot/vmlinuz-6.1.60-generic /opt -$ sync -``` - - -You can edit your extlinux.conf. -```bash -$ nano /opt/extlinux/extlinux.conf -``` -``` -default l0 -menu title QuartzPro64 Boot Menu -prompt 0 -timeout 50 - -# create a new item with new kernel. -label l0 -menu label Boot Linux Kernel SDMMC -linux /vmlinuz-6.1.60-generic -fdt /rk3588-quartzpro64.dtb -append earlycon=uart8250,mmio32,0xfeb50000 console=ttyS2,1500000n8 root=/dev/mmcblk1p5 rw rootwait - -# backup old boot item -label 20 -menu label Boot Linux Kernel SDMMC Backup -linux /Image -fdt /rk3588-quartzpro64.dtb -append earlycon=uart8250,mmio32,0xfeb50000 console=ttyS2,1500000n8 root=/dev/mmcblk1p5 rw rootwait -``` - -The kernel package has compiled the DTB file, if you need it, you can go to the "/boot/dtbs/{kernel_version}/" folder. - -!!! NOTE - -*** Make sure you can access your device using the serial port. If your changes are wrong, you may not be able to boot the system, so you have a serial port that you can debug again. *** - - - -## 2. Manual build - -See https://github.com/jiangcuo/pve-port-kernel readme.md - - diff --git a/help/repo.md b/help/repo.md deleted file mode 100644 index b39b082..0000000 --- a/help/repo.md +++ /dev/null @@ -1,85 +0,0 @@ -# Proxmox-Port Repo List - -### Mirrors - -```bash -Golbal: https://global.mirrors.apqa.cn (Cloudflare) -Korea: https://mirrors.apqa.cn (Cloudflare) -Hong Kong: https://hk.mirrors.apqa.cn (direct) -China: https://mirrors.lierfang.com (direct) -Germany: https://de.mirrors.apqa.cn (direct) -``` - -### key - - https://mirrors.apqa.cn/proxmox/debian/pveport.gpg - - ```bash - curl -L https://mirrors.apqa.cn/proxmox/debian/pveport.gpg -o /etc/apt/trusted.gpg.d/pveport.gpg -``` - -### pve repo - -pve7 - - ```bash - deb https://mirrors.apqa.cn/proxmox/debian/pve bullseye port - ``` - -pve8 - - ```bash - deb https://mirrors.apqa.cn/proxmox/debian/pve bookworm port - ``` -If you want to use test repo: - - ```bash - deb https://mirrors.apqa.cn/proxmox/debian/pve bookworm pvetest - ``` -ceph-reef - ```bash - deb https://mirrors.apqa.cn/proxmox/debian/pve bookworm ceph-reef - ``` - - -loong64 sid only - - ```bash - deb https://mirrors.apqa.cn/proxmox/debian/pve sid port - ``` - -### pbs repo - -pve7 - - ```bash - deb https://mirrors.apqa.cn/proxmox/debian/pbs bullseye port - ``` - -pve8 - - ```bash - deb https://mirrors.apqa.cn/proxmox/debian/pbs bookworm port - ``` - - -### devel - -pve7 - - ```bash - deb https://mirrors.apqa.cn/proxmox/debian/devel bullseye port - ``` - -pve8 - - ```bash - deb https://mirrors.apqa.cn/proxmox/debian/devel bookworm port - ``` - -### Kernel Repo - - ```bash - deb https://mirrors.apqa.cn/proxmox/debian/kernel sid port - ``` -kernel build form https://github.com/jiangcuo/pve-port-kernel and may not compatible all machine diff --git a/packages/pve-manager/patches/001-remove-test-in-makefile.patch b/packages/pve-manager/patches/001-remove-test-in-makefile.patch new file mode 100644 index 0000000..13312e6 --- /dev/null +++ b/packages/pve-manager/patches/001-remove-test-in-makefile.patch @@ -0,0 +1,16 @@ +diff --git a/Makefile b/Makefile +index 337682b3c..d811e3af7 100644 +--- a/Makefile ++++ b/Makefile +@@ -15,11 +15,6 @@ SUBDIRS = aplinfo PVE bin www services configs network-hooks test templates + all: $(SUBDIRS) + set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i; done + +-.PHONY: check +-check: bin test www +- $(MAKE) -C bin check +- $(MAKE) -C test check +- $(MAKE) -C www check + + GITVERSION:=$(shell git rev-parse --short=16 HEAD) + $(BUILDDIR): diff --git a/packages/pve-manager/patches/002-add-lxc-for-arm-source.patch b/packages/pve-manager/patches/002-add-lxc-for-arm-source.patch new file mode 100644 index 0000000..99bb05e --- /dev/null +++ b/packages/pve-manager/patches/002-add-lxc-for-arm-source.patch @@ -0,0 +1,86 @@ +diff --git a/PVE/APLInfo.pm b/PVE/APLInfo.pm +index 9ea206782..4f9981b05 100644 +--- a/PVE/APLInfo.pm ++++ b/PVE/APLInfo.pm +@@ -205,6 +205,11 @@ sub get_apl_sources { + url => "https://releases.turnkeylinux.org/pve", + file => 'aplinfo.dat', + }, ++ { ++ host => "mirrors.apqa.cn", ++ url => "https://mirrors.apqa.cn/proxmox", ++ file => 'lxcs/aplinfo.dat', ++ }, + ]; + + return $sources; +diff --git a/aplinfo/Makefile b/aplinfo/Makefile +index 56af6dfcb..55b79b1c3 100644 +--- a/aplinfo/Makefile ++++ b/aplinfo/Makefile +@@ -5,7 +5,8 @@ TRUSTED_KEYS= \ + proxmox-release-6.x.pubkey \ + proxmox-release-bullseye.pubkey \ + proxmox-release-bookworm.gpg \ +- release@turnkeylinux.com.pubkey ++ release@turnkeylinux.com.pubkey \ ++ mirrors.apqa.cn.pubkey + + all: + +diff -Nur a/aplinfo/mirrors.apqa.cn.pubkey b/aplinfo/mirrors.apqa.cn.pubkey +--- a/aplinfo/mirrors.apqa.cn.pubkey ++++ b/aplinfo/mirrors.apqa.cn.pubkey +@@ -0,0 +1,52 @@ ++-----BEGIN PGP PUBLIC KEY BLOCK----- ++ ++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 ++wr7Zz10/ZojX6eOcRH3kIslX9Lc= ++=BaeF ++-----END PGP PUBLIC KEY BLOCK----- diff --git a/packages/pve-manager/patches/003-add-pveport-source.patch b/packages/pve-manager/patches/003-add-pveport-source.patch new file mode 100644 index 0000000..e8f4734 --- /dev/null +++ b/packages/pve-manager/patches/003-add-pveport-source.patch @@ -0,0 +1,32 @@ +diff --git a/configs/Makefile b/configs/Makefile +index fa586e280..698a91b5a 100644 +--- a/configs/Makefile ++++ b/configs/Makefile +@@ -8,7 +8,7 @@ country.dat: country.pl + .PHONY: install + install: country.dat vzdump.conf pve-sources.list pve-initramfs.conf pve-blacklist.conf pve.logrotate + install -D -m 0644 pve.logrotate $(DESTDIR)/etc/logrotate.d/pve +- install -D -m 0644 pve-sources.list $(DESTDIR)/etc/apt/sources.list.d/pve-enterprise.list ++ install -D -m 0644 pve-sources.list ${DESTDIR}/etc/apt/sources.list.d/pveport.list + install -D -m 0644 pve-blacklist.conf $(DESTDIR)/etc/modprobe.d/pve-blacklist.conf + install -D -m 0644 vzdump.conf $(DESTDIR)/etc/vzdump.conf + install -D -m 0644 pve-initramfs.conf $(DESTDIR)/etc/initramfs-tools/conf.d/pve-initramfs.conf +diff --git a/configs/pve-sources.list b/configs/pve-sources.list +index 010385a97..eeae1c0d8 100644 +--- a/configs/pve-sources.list ++++ b/configs/pve-sources.list +@@ -1 +1 @@ +-deb https://enterprise.proxmox.com/debian/pve bookworm pve-enterprise ++deb https://mirrors.apqa.cn/proxmox/debian/pve bookworm port +diff --git a/debian/lintian-overrides b/debian/lintian-overrides +index fb9cc49de..f9731f490 100644 +--- a/debian/lintian-overrides ++++ b/debian/lintian-overrides +@@ -3,5 +3,5 @@ pve-manager: no-manual-page [usr/bin/pvebanner] + pve-manager: no-manual-page [usr/bin/pveupdate] + pve-manager: non-standard-dir-perm 0700 != 0755 [var/log/pveproxy/] + pve-manager: systemd-service-file-refers-to-unusual-wantedby-target getty.target [lib/systemd/system/pvebanner.service] +-pve-manager: package-installs-apt-sources [etc/apt/sources.list.d/pve-enterprise.list] ++pve-manager: package-installs-apt-sources [etc/apt/sources.list.d/pveport.list] + pve-manager: privacy-breach-generic usr/share/pve-manager/touch/sencha-touch-all-debug.js * + diff --git a/packages/pve-manager/patches/005-remove-ifupdown-in-depends.patch b/packages/pve-manager/patches/005-remove-ifupdown-in-depends.patch new file mode 100644 index 0000000..8b131b8 --- /dev/null +++ b/packages/pve-manager/patches/005-remove-ifupdown-in-depends.patch @@ -0,0 +1,12 @@ +diff --git a/debian/control b/debian/control +index 336b11ea2..9006e27e6 100644 +--- a/debian/control ++++ b/debian/control +@@ -43,7 +43,6 @@ Depends: apt (>= 1.5~), + fonts-font-logos, + gdisk, + hdparm, +- ifupdown2 (>= 3.0) | ifenslave (>= 2.6), + libapt-pkg-perl, + libcrypt-ssleay-perl, + libfile-readbackwards-perl, diff --git a/packages/pve-manager/patches/006-remove-qxl-and-add-ramfb.patch b/packages/pve-manager/patches/006-remove-qxl-and-add-ramfb.patch new file mode 100644 index 0000000..bd6cf11 --- /dev/null +++ b/packages/pve-manager/patches/006-remove-qxl-and-add-ramfb.patch @@ -0,0 +1,23 @@ +diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js +index db86fa9a3..5f60b0ae2 100644 +--- a/www/manager6/Utils.js ++++ b/www/manager6/Utils.js +@@ -598,17 +580,13 @@ Ext.define('PVE.Utils', { + kvm_vga_drivers: { + '__default__': Proxmox.Utils.defaultText, + std: gettext('Standard VGA'), +- vmware: gettext('VMware compatible'), +- qxl: 'SPICE', +- qxl2: 'SPICE dual monitor', +- qxl3: 'SPICE three monitors', +- qxl4: 'SPICE four monitors', + serial0: gettext('Serial terminal') + ' 0', + serial1: gettext('Serial terminal') + ' 1', + serial2: gettext('Serial terminal') + ' 2', + serial3: gettext('Serial terminal') + ' 3', + virtio: 'VirtIO-GPU', + 'virtio-gl': 'VirGL GPU', ++ ramfb: 'ramfb', + none: Proxmox.Utils.noneText, + }, + diff --git a/packages/pve-manager/patches/007-remove-amd64-config.patch b/packages/pve-manager/patches/007-remove-amd64-config.patch new file mode 100644 index 0000000..9a43cbc --- /dev/null +++ b/packages/pve-manager/patches/007-remove-amd64-config.patch @@ -0,0 +1,91 @@ +diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js +index db86fa9a3..5f60b0ae2 100644 +--- a/www/manager6/Utils.js ++++ b/www/manager6/Utils.js +@@ -522,19 +512,11 @@ Ext.define('PVE.Utils', { + + render_scsihw: function(value) { + if (!value || value === '__default__') { +- return Proxmox.Utils.defaultText + ' (LSI 53C895A)'; +- } else if (value === 'lsi') { +- return 'LSI 53C895A'; +- } else if (value === 'lsi53c810') { +- return 'LSI 53C810'; +- } else if (value === 'megasas') { +- return 'MegaRAID SAS 8708EM2'; ++ return Proxmox.Utils.defaultText + '(VirtIO SCSI)'; + } else if (value === 'virtio-scsi-pci') { + return 'VirtIO SCSI'; + } else if (value === 'virtio-scsi-single') { + return 'VirtIO SCSI single'; +- } else if (value === 'pvscsi') { +- return 'VMware PVSCSI'; + } else { + return value; + } +diff --git a/www/manager6/form/ScsiHwSelector.js b/www/manager6/form/ScsiHwSelector.js +index fd23158be..4c3c80825 100644 +--- a/www/manager6/form/ScsiHwSelector.js ++++ b/www/manager6/form/ScsiHwSelector.js +@@ -3,11 +3,7 @@ Ext.define('PVE.form.ScsiHwSelector', { + alias: ['widget.pveScsiHwSelector'], + comboItems: [ + ['__default__', PVE.Utils.render_scsihw('')], +- ['lsi', PVE.Utils.render_scsihw('lsi')], +- ['lsi53c810', PVE.Utils.render_scsihw('lsi53c810')], +- ['megasas', PVE.Utils.render_scsihw('megasas')], + ['virtio-scsi-pci', PVE.Utils.render_scsihw('virtio-scsi-pci')], + ['virtio-scsi-single', PVE.Utils.render_scsihw('virtio-scsi-single')], +- ['pvscsi', PVE.Utils.render_scsihw('pvscsi')], + ], + }); +diff --git a/www/manager6/form/VMCPUFlagSelector.js b/www/manager6/form/VMCPUFlagSelector.js +index ace3c531f..1e185b7c5 100644 +--- a/www/manager6/form/VMCPUFlagSelector.js ++++ b/www/manager6/form/VMCPUFlagSelector.js +@@ -21,17 +21,6 @@ Ext.define('PVE.form.VMCPUFlagSelector', { + fields: ['flag', { name: 'state', defaultValue: '=' }, 'desc'], + data: [ + // FIXME: let qemu-server host this and autogenerate or get from API call?? +- { flag: 'md-clear', desc: 'Required to let the guest OS know if MDS is mitigated correctly' }, +- { flag: 'pcid', desc: 'Meltdown fix cost reduction on Westmere, Sandy-, and IvyBridge Intel CPUs' }, +- { flag: 'spec-ctrl', desc: 'Allows improved Spectre mitigation with Intel CPUs' }, +- { flag: 'ssbd', desc: 'Protection for "Speculative Store Bypass" for Intel models' }, +- { flag: 'ibpb', desc: 'Allows improved Spectre mitigation with AMD CPUs' }, +- { flag: 'virt-ssbd', desc: 'Basis for "Speculative Store Bypass" protection for AMD models' }, +- { flag: 'amd-ssbd', desc: 'Improves Spectre mitigation performance with AMD CPUs, best used with "virt-ssbd"' }, +- { flag: 'amd-no-ssb', desc: 'Notifies guest OS that host is not vulnerable for Spectre on AMD CPUs' }, +- { flag: 'pdpe1gb', desc: 'Allow guest OS to use 1GB size pages, if host HW supports it' }, +- { flag: 'hv-tlbflush', desc: 'Improve performance in overcommitted Windows guests. May lead to guest bluescreens on old CPUs.' }, +- { flag: 'hv-evmcs', desc: 'Improve performance for nested virtualization. Only supported on Intel CPUs.' }, + { flag: 'aes', desc: 'Activate AES instruction set for HW acceleration.' }, + ], + listeners: { +diff --git a/www/manager6/node/StatusView.js b/www/manager6/node/StatusView.js +index 0ac200c75..c29f433f4 100644 +--- a/www/manager6/node/StatusView.js ++++ b/www/manager6/node/StatusView.js +@@ -109,7 +109,13 @@ Ext.define('PVE.node.StatusView', { + return data.kversion; + } + let kernel = data['current-kernel']; +- let buildDate = kernel.version.match(/\((.+)\)\s*$/)?.[1] ?? 'unknown'; ++ let buildDate; ++ try { ++ buildDate = kernel.version.match(/\((.+)\)\s*$/)[1] ?? 'unknown'; ++ } catch { ++ // Patch for some kernels not match (date). ++ buildDate = kernel.version ?? 'unknown'; ++ } + return `${kernel.sysname} ${kernel.release} (${buildDate})`; + }, + value: '', +@@ -121,7 +127,7 @@ Ext.define('PVE.node.StatusView', { + textField: 'boot-info', + renderer: boot => { + if (boot.mode === 'legacy-bios') { +- return 'Legacy BIOS'; ++ return 'U-BOOT'; + } else if (boot.mode === 'efi') { + return `EFI${boot.secureboot ? ' (Secure Boot)' : ''}`; + } diff --git a/packages/pve-manager/patches/008-add-arm64-config.patch b/packages/pve-manager/patches/008-add-arm64-config.patch new file mode 100644 index 0000000..77b16ec --- /dev/null +++ b/packages/pve-manager/patches/008-add-arm64-config.patch @@ -0,0 +1,123 @@ +diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js +index db86fa9a3..5f60b0ae2 100644 +--- a/www/manager6/Utils.js ++++ b/www/manager6/Utils.js +@@ -496,7 +486,7 @@ Ext.define('PVE.Utils', { + }, + + render_qemu_machine: function(value) { +- return value || Proxmox.Utils.defaultText + ' (i440fx)'; ++ return value || Proxmox.Utils.defaultText + ' (virt)'; + }, + + render_qemu_bios: function(value) { +diff --git a/www/manager6/form/CPUModelSelector.js b/www/manager6/form/CPUModelSelector.js +index a30dd1fb6..f1c40a319 100644 +--- a/www/manager6/form/CPUModelSelector.js ++++ b/www/manager6/form/CPUModelSelector.js +@@ -15,7 +15,7 @@ Ext.define('PVE.form.CPUModelSelector', { + valueField: 'name', + displayField: 'displayname', + +- emptyText: Proxmox.Utils.defaultText + ' (kvm64)', ++ emptyText: Proxmox.Utils.defaultText + ' (host)', + allowBlank: true, + + editable: true, +diff --git a/www/manager6/form/ControllerSelector.js b/www/manager6/form/ControllerSelector.js +index d7c2625da..432316247 100644 +--- a/www/manager6/form/ControllerSelector.js ++++ b/www/manager6/form/ControllerSelector.js +@@ -34,7 +34,7 @@ Ext.define('PVE.form.ControllerSelector', { + + let clist; + if (autoSelect === 'cdrom') { +- if (!Ext.isDefined(me.vmconfig.ide2)) { ++ if (!Ext.isDefined(me.vmconfig.scsi2)) { + bussel.setValue('ide'); + deviceid.setValue(2); + return; + +diff --git a/www/manager6/panel/MultiDiskEdit.js b/www/manager6/panel/MultiDiskEdit.js +index ea1f974da..51b68eff9 100644 +--- a/www/manager6/panel/MultiDiskEdit.js ++++ b/www/manager6/panel/MultiDiskEdit.js +@@ -19,7 +19,7 @@ Ext.define('PVE.panel.MultiDiskPanel', { + let me = this; + me.lookup('addButton').setDisabled(true); + me.addDisk(); +- let count = me.lookup('grid').getStore().getCount() + 1; // +1 is from ide2 ++ let count = me.lookup('grid').getStore().getCount() + 1; // +1 is from scsi2 + me.lookup('addButton').setDisabled(count >= me.maxCount); + }, + +diff --git a/www/manager6/qemu/CreateWizard.js b/www/manager6/qemu/CreateWizard.js +index 375f0c667..226209cba 100644 +--- a/www/manager6/qemu/CreateWizard.js ++++ b/www/manager6/qemu/CreateWizard.js +@@ -190,7 +190,7 @@ Ext.define('PVE.qemu.CreateWizard', { + bind: { + nodename: '{nodename}', + }, +- confid: 'ide2', ++ confid: 'scsi2', + insideWizard: true, + }, + { +diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js +index 86d5f4cf3..0541a1de9 100644 +--- a/www/manager6/qemu/HardwareView.js ++++ b/www/manager6/qemu/HardwareView.js +@@ -164,7 +164,7 @@ Ext.define('PVE.qemu.HardwareView', { + let ostype = me.getObjectValue('ostype', undefined, pending); + if (PVE.Utils.is_windows(ostype) && + (!value || value === 'pc' || value === 'q35')) { +- return value === 'q35' ? 'pc-q35-5.1' : 'pc-i440fx-5.1'; ++ return value === 'q35' ? 'pc-q35-5.1' : 'virt'; + } + return PVE.Utils.render_qemu_machine(value); + }, +diff --git a/www/manager6/qemu/MachineEdit.js b/www/manager6/qemu/MachineEdit.js +index a697cd344..3e5a5981b 100644 +--- a/www/manager6/qemu/MachineEdit.js ++++ b/www/manager6/qemu/MachineEdit.js +@@ -24,7 +24,7 @@ Ext.define('PVE.qemu.MachineInputPanel', { + let version = me.lookup('version'); + let store = version.getStore(); + let oldRec = store.findRecord('id', version.getValue(), 0, false, false, true); +- let type = value === 'q35' ? 'q35' : 'i440fx'; ++ let type = value === 'q35' ? 'q35' : 'virt'; + store.clearFilter(); + store.addFilter(val => val.data.id === 'latest' || val.data.type === type); + if (!me.getView().isWindows) { +@@ -75,7 +75,7 @@ Ext.define('PVE.qemu.MachineInputPanel', { + + if (me.isWindows) { + if (values.machine === '__default__') { +- values.version = 'pc-i440fx-5.1'; ++ values.version = 'virt'; + } else if (values.machine === 'q35') { + values.version = 'pc-q35-5.1'; + } +diff --git a/www/manager6/qemu/MultiHDEdit.js b/www/manager6/qemu/MultiHDEdit.js +index 27884f3f3..4dd2ce96d 100644 +--- a/www/manager6/qemu/MultiHDEdit.js ++++ b/www/manager6/qemu/MultiHDEdit.js +@@ -7,7 +7,7 @@ Ext.define('PVE.qemu.MultiHDPanel', { + controller: { + xclass: 'Ext.app.ViewController', + +- // maxCount is the sum of all controller ids - 1 (ide2 is fixed in the wizard) ++ // maxCount is the sum of all controller ids - 1 (scsi2 is fixed in the wizard) + maxCount: Object.values(PVE.Utils.diskControllerMaxIDs) + .reduce((previous, current) => previous+current, 0) - 1, + +@@ -38,7 +38,7 @@ Ext.define('PVE.qemu.MultiHDPanel', { + let vm = me.getViewModel(); + + let res = { +- ide2: 'media=cdrom', ++ scsi2: 'media=cdrom', + scsihw: vm.get('current.scsihw'), + ostype: vm.get('current.ostype'), + }; diff --git a/packages/pve-manager/patches/009-remove-other-ostype.patch b/packages/pve-manager/patches/009-remove-other-ostype.patch new file mode 100644 index 0000000..b85bfbb --- /dev/null +++ b/packages/pve-manager/patches/009-remove-other-ostype.patch @@ -0,0 +1,25 @@ +diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js +index db86fa9a3..5f60b0ae2 100644 +--- a/www/manager6/Utils.js ++++ b/www/manager6/Utils.js +@@ -48,19 +48,9 @@ Ext.define('PVE.Utils', { + kvm_ostypes: { + 'Linux': [ + { desc: '6.x - 2.6 Kernel', val: 'l26' }, +- { desc: '2.4 Kernel', val: 'l24' }, + ], + 'Microsoft Windows': [ +- { desc: '11/2022/2025', val: 'win11' }, +- { desc: '10/2016/2019', val: 'win10' }, +- { desc: '8.x/2012/2012r2', val: 'win8' }, +- { desc: '7/2008r2', val: 'win7' }, +- { desc: 'Vista/2008', val: 'w2k8' }, +- { desc: 'XP/2003', val: 'wxp' }, +- { desc: '2000', val: 'w2k' }, +- ], +- 'Solaris Kernel': [ +- { desc: '-', val: 'solaris' }, ++ { desc: '11/2022', val: 'win11' }, + ], + 'Other': [ + { desc: '-', val: 'other' }, diff --git a/packages/pve-manager/patches/changelog/004-add-changelog-8.1.3+pve1.patch b/packages/pve-manager/patches/changelog/004-add-changelog-8.1.3+pve1.patch new file mode 100644 index 0000000..e5df776 --- /dev/null +++ b/packages/pve-manager/patches/changelog/004-add-changelog-8.1.3+pve1.patch @@ -0,0 +1,19 @@ +diff --git a/debian/changelog b/debian/changelog +index 61bd8602f..a287d3002 100644 +--- a/debian/changelog ++++ b/debian/changelog +@@ -350,6 +350,14 @@ pve-manager (8.1.4) bookworm; urgency=medium + + -- Proxmox Support Team Thu, 14 Dec 2023 15:20:06 +0100 + ++pve-manager (8.1.3+pve1) bookworm; urgency=medium ++ ++ * fix Nodes summary status not loading when kerneldate parse error ++ ++ * change leagacy-bios to u-boot. https://github.com/jiangcuo/Proxmox-Arm64/issues/60 ++ ++ -- jiangcuo Sun, 03 Dec 2023 22:51:03 -0500 ++ + pve-manager (8.1.3) bookworm; urgency=medium + + * ui: pool view: fix editing nested pools diff --git a/packages/pve-manager/pve-manager b/packages/pve-manager/pve-manager new file mode 160000 index 0000000..3e0176e --- /dev/null +++ b/packages/pve-manager/pve-manager @@ -0,0 +1 @@ +Subproject commit 3e0176e6bb2ade3b9031c4b179f29315fa8c4acf diff --git a/packages/pve-manager/series b/packages/pve-manager/series new file mode 100644 index 0000000..ae0bbf5 --- /dev/null +++ b/packages/pve-manager/series @@ -0,0 +1,9 @@ +patches/001-remove-test-in-makefile.patch +patches/002-add-lxc-for-arm-source.patch +patches/003-add-pveport-source.patch +patches/005-remove-ifupdown-in-depends.patch +patches/006-remove-qxl-and-add-ramfb.patch +patches/007-remove-amd64-config.patch +patches/008-add-arm64-config.patch +patches/009-remove-other-ostype.patch +patches/changelog/004-add-changelog-8.1.3+pve1.patch diff --git a/packages/qemu-server/patches/001-fix-arm64-build.patch b/packages/qemu-server/patches/001-fix-arm64-build.patch new file mode 100644 index 0000000..c9a09e8 --- /dev/null +++ b/packages/qemu-server/patches/001-fix-arm64-build.patch @@ -0,0 +1,41 @@ +diff --git a/Makefile b/Makefile +index 133468da..18de31bc 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,7 +14,7 @@ MAN5DIR=$(MANDIR)/man5/ + BASHCOMPLDIR=$(PREFIX)/share/bash-completion/completions/ + ZSHCOMPLDIR=$(PREFIX)/share/zsh/vendor-completions/ + export PERLDIR=$(PREFIX)/share/perl5 +-PERLINCDIR=$(PERLDIR)/asm-x86_64 ++PERLINCDIR=$(PERLDIR)/asm-aarch64 + + GITVERSION:=$(shell git rev-parse HEAD) + +@@ -80,7 +80,7 @@ install: $(PKGSOURCES) + $(BUILDDIR): + rm -rf $(BUILDDIR) $(BUILDDIR).tmp + rsync -a * $(BUILDDIR).tmp +- echo "git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout $(GITVERSION)" > $(BUILDDIR).tmp/debian/SOURCE ++ echo "git clone https://github.com/jiangcuo/qemu-server.git\\ngit checkout $(GITVERSION)" > $(BUILDDIR).tmp/debian/SOURCE + mv $(BUILDDIR).tmp $(BUILDDIR) + + .PHONY: deb +@@ -99,11 +99,6 @@ $(DSC): $(BUILDDIR) + sbuild: $(DSC) + sbuild $(DSC) + +-.PHONY: test +-test: +- PVE_GENERATING_DOCS=1 perl -I. ./qm verifyapi +- $(MAKE) -C test +- + .PHONY: upload + upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) + upload: $(DEB) +@@ -111,7 +106,6 @@ upload: $(DEB) + + .PHONY: clean + clean: +- $(MAKE) -C test $@ + rm -rf $(PACKAGE)-*/ *.deb *.build *.buildinfo *.changes *.dsc $(PACKAGE)_*.tar.?z + rm -f *.xml.tmp *.1 *.5 *.8 *{synopsis,opts}.adoc docinfo.xml diff --git a/packages/qemu-server/patches/002-fix-arm64-pcie.patch b/packages/qemu-server/patches/002-fix-arm64-pcie.patch new file mode 100644 index 0000000..a6a6025 --- /dev/null +++ b/packages/qemu-server/patches/002-fix-arm64-pcie.patch @@ -0,0 +1,210 @@ +diff --git a/PVE/QemuServer/PCI.pm b/PVE/QemuServer/PCI.pm +index 1673041b..429d110b 100644 +--- a/PVE/QemuServer/PCI.pm ++++ b/PVE/QemuServer/PCI.pm +@@ -151,82 +151,72 @@ sub get_pci_addr_map { + ahci0 => { bus => 0, addr => 7 }, + qga0 => { bus => 0, addr => 8 }, + spice => { bus => 0, addr => 9 }, +- virtio0 => { bus => 0, addr => 10 }, +- virtio1 => { bus => 0, addr => 11 }, +- virtio2 => { bus => 0, addr => 12 }, +- virtio3 => { bus => 0, addr => 13 }, +- virtio4 => { bus => 0, addr => 14 }, +- virtio5 => { bus => 0, addr => 15 }, +- hostpci0 => { bus => 0, addr => 16 }, +- hostpci1 => { bus => 0, addr => 17 }, +- net0 => { bus => 0, addr => 18 }, +- net1 => { bus => 0, addr => 19 }, +- net2 => { bus => 0, addr => 20 }, +- net3 => { bus => 0, addr => 21 }, +- net4 => { bus => 0, addr => 22 }, +- net5 => { bus => 0, addr => 23 }, ++# pcie.1 => { bus => 0, addr => 10 }, ++ net0 => { bus => 0, addr => 11 }, ++ hostpci4 => { bus => 0, addr => 12 }, ++ hostpci5 => { bus => 0, addr => 13 }, ++ hostpci6 => { bus => 0, addr => 14 }, ++ hostpci7 => { bus => 0, addr => 15 }, ++ hostpci8 => { bus => 0, addr => 16 }, ++ hostpci19 => { bus => 0, addr => 17 }, ++ hostpci10 => { bus => 0, addr => 18 }, ++ 'xhci' => { bus => 0, addr => 19 }, ++ hostpci0 => { bus => 0, addr => 22 }, ++ hostpci1 => { bus => 0, addr => 23 }, + vga1 => { bus => 0, addr => 24 }, + vga2 => { bus => 0, addr => 25 }, +- vga3 => { bus => 0, addr => 26 }, ++# vga3 => { bus => 0, addr => 26 }, #use to pcie2-3,for aarch64 + hostpci2 => { bus => 0, addr => 27 }, + hostpci3 => { bus => 0, addr => 28 }, +- #addr29 : usb-host (pve-usb.cfg) ++# addr29 : usb-host (pve-usb.cfg) + 'pci.1' => { bus => 0, addr => 30 }, + 'pci.2' => { bus => 0, addr => 31 }, +- 'net6' => { bus => 1, addr => 1 }, +- 'net7' => { bus => 1, addr => 2 }, +- 'net8' => { bus => 1, addr => 3 }, +- 'net9' => { bus => 1, addr => 4 }, +- 'net10' => { bus => 1, addr => 5 }, +- 'net11' => { bus => 1, addr => 6 }, +- 'net12' => { bus => 1, addr => 7 }, +- 'net13' => { bus => 1, addr => 8 }, +- 'net14' => { bus => 1, addr => 9 }, +- 'net15' => { bus => 1, addr => 10 }, +- 'net16' => { bus => 1, addr => 11 }, +- 'net17' => { bus => 1, addr => 12 }, +- 'net18' => { bus => 1, addr => 13 }, +- 'net19' => { bus => 1, addr => 14 }, +- 'net20' => { bus => 1, addr => 15 }, +- 'net21' => { bus => 1, addr => 16 }, +- 'net22' => { bus => 1, addr => 17 }, +- 'net23' => { bus => 1, addr => 18 }, +- 'net24' => { bus => 1, addr => 19 }, +- 'net25' => { bus => 1, addr => 20 }, +- 'net26' => { bus => 1, addr => 21 }, +- 'net27' => { bus => 1, addr => 22 }, +- 'net28' => { bus => 1, addr => 23 }, +- 'net29' => { bus => 1, addr => 24 }, +- 'net30' => { bus => 1, addr => 25 }, +- 'net31' => { bus => 1, addr => 26 }, +- 'xhci' => { bus => 1, addr => 27 }, ++# 'net0' => { bus => 1, addr => 1 }, ++ 'net1' => { bus => 1, addr => 2 }, ++ 'net2' => { bus => 1, addr => 3 }, ++ 'net3' => { bus => 1, addr => 4 }, ++ 'net4' => { bus => 1, addr => 5 }, ++ 'net5' => { bus => 1, addr => 6 }, ++ 'net6' => { bus => 1, addr => 7 }, ++ 'net7' => { bus => 1, addr => 8 }, ++ 'net8' => { bus => 1, addr => 9 }, ++ 'net9' => { bus => 1, addr => 10 }, ++ 'net10' => { bus => 1, addr => 11 }, ++ 'net11' => { bus => 1, addr => 12 }, ++ 'net12' => { bus => 1, addr => 13 }, ++ 'net13' => { bus => 1, addr => 14 }, ++ 'net14' => { bus => 1, addr => 15 }, ++ 'net15' => { bus => 1, addr => 16 }, ++ 'net16' => { bus => 1, addr => 17 }, ++ 'net17' => { bus => 1, addr => 18 }, ++ 'net18' => { bus => 1, addr => 19 }, ++ 'net19' => { bus => 1, addr => 20 }, ++ 'net20' => { bus => 1, addr => 21 }, ++ 'net21' => { bus => 1, addr => 22 }, ++ 'net22' => { bus => 1, addr => 23 }, ++ 'net23' => { bus => 1, addr => 24 }, ++ 'net24' => { bus => 1, addr => 25 }, + 'pci.4' => { bus => 1, addr => 28 }, + 'rng0' => { bus => 1, addr => 29 }, + 'pci.2-igd' => { bus => 1, addr => 30 }, # replaces pci.2 in case a legacy IGD device is passed through +- 'virtio6' => { bus => 2, addr => 1 }, +- 'virtio7' => { bus => 2, addr => 2 }, +- 'virtio8' => { bus => 2, addr => 3 }, +- 'virtio9' => { bus => 2, addr => 4 }, +- 'virtio10' => { bus => 2, addr => 5 }, +- 'virtio11' => { bus => 2, addr => 6 }, +- 'virtio12' => { bus => 2, addr => 7 }, +- 'virtio13' => { bus => 2, addr => 8 }, +- 'virtio14' => { bus => 2, addr => 9 }, +- 'virtio15' => { bus => 2, addr => 10 }, +- 'ivshmem' => { bus => 2, addr => 11 }, +- 'audio0' => { bus => 2, addr => 12 }, +- hostpci4 => { bus => 2, addr => 13 }, +- hostpci5 => { bus => 2, addr => 14 }, +- hostpci6 => { bus => 2, addr => 15 }, +- hostpci7 => { bus => 2, addr => 16 }, +- hostpci8 => { bus => 2, addr => 17 }, +- hostpci9 => { bus => 2, addr => 18 }, +- hostpci10 => { bus => 2, addr => 19 }, +- hostpci11 => { bus => 2, addr => 20 }, +- hostpci12 => { bus => 2, addr => 21 }, +- hostpci13 => { bus => 2, addr => 22 }, +- hostpci14 => { bus => 2, addr => 23 }, +- hostpci15 => { bus => 2, addr => 24 }, ++ 'virtio0' => { bus => 2, addr => 1 }, ++ 'virtio1' => { bus => 2, addr => 2 }, ++ 'virtio2' => { bus => 2, addr => 3 }, ++ 'virtio3' => { bus => 2, addr => 4 }, ++ 'virtio4' => { bus => 2, addr => 5 }, ++ 'virtio5' => { bus => 2, addr => 6 }, ++ 'virtio6' => { bus => 2, addr => 7 }, ++ 'virtio7' => { bus => 2, addr => 8 }, ++ 'virtio8' => { bus => 2, addr => 9 }, ++ 'virtio9' => { bus => 2, addr => 10 }, ++ 'virtio10' => { bus => 2, addr => 11 }, ++ 'virtio11' => { bus => 2, addr => 12 }, ++ 'virtio12' => { bus => 2, addr => 13 }, ++ 'virtio13' => { bus => 2, addr => 14 }, ++ 'virtio14' => { bus => 2, addr => 15 }, ++ 'virtio15' => { bus => 2, addr => 16 }, ++ 'ivshmem' => { bus => 2, addr => 17 }, ++ 'audio0' => { bus => 2, addr => 18 }, + 'virtioscsi0' => { bus => 3, addr => 1 }, + 'virtioscsi1' => { bus => 3, addr => 2 }, + 'virtioscsi2' => { bus => 3, addr => 3 }, +@@ -576,7 +566,9 @@ sub print_hostpci_devices { + my $kvm_off = 0; + my $gpu_passthrough = 0; + my $legacy_igd = 0; +- ++ if ($arch eq 'aarch64') { ++ push @$devices, '-readconfig', '/usr/share/qemu-server/pve-aarch64.cfg'; ++ } + my $pciaddr; + my $pci_devices = choose_hostpci_devices(parse_hostpci_devices($conf), $vmid); + +diff --git a/qemu-configs/Makefile b/qemu-configs/Makefile +index f55e9bef..463df4f3 100644 +--- a/qemu-configs/Makefile ++++ b/qemu-configs/Makefile +@@ -2,11 +2,12 @@ DESTDIR= + USRSHAREDIR=$(DESTDIR)/usr/share/qemu-server + + .PHONY: install +-install: pve-usb.cfg pve-q35.cfg pve-q35-4.0.cfg ++install: pve-usb.cfg pve-q35.cfg pve-q35-4.0.cfg pve-aarch64.cfg + install -d $(USRSHAREDIR) + install -m 0644 pve-usb.cfg $(USRSHAREDIR) + install -m 0644 pve-q35.cfg $(USRSHAREDIR) + install -m 0644 pve-q35-4.0.cfg $(USRSHAREDIR) ++ install -m 0644 pve-aarch64.cfg $(USRSHAREDIR) + + .PHONY: clean + clean: +diff --git a/qemu-configs/pve-aarch64.cfg b/qemu-configs/pve-aarch64.cfg +new file mode 100644 +index 00000000..9ba549e6 +--- /dev/null ++++ b/qemu-configs/pve-aarch64.cfg +@@ -0,0 +1,30 @@ ++[device "pcie.1"] ++ driver = "pci-bridge" ++ bus = "pcie.0" ++ addr = "0xa" ++ chassis_nr = "1" ++ ++#[device "pciroot"] ++# driver = "pci-bridge" ++# bus = "pci.1" ++# addr = "1.0" ++# chassis_nr = "1" ++ ++[device "pcie.2"] ++ driver = "pci-bridge" ++ bus = "pci.1" ++ addr = "1.0" ++ chassis_nr = "2" ++ ++ ++[device "pcie.3"] ++ driver = "pci-bridge" ++ bus = "pci.2" ++ addr = "1.0" ++ chassis_nr = "3" ++ ++[device "pcie.4"] ++ driver = "pci-bridge" ++ bus = "pci.2" ++ addr = "2.0" ++ chassis_nr = "4" + diff --git a/packages/qemu-server/patches/003-add-aarch64-edk2-in-depends.patch b/packages/qemu-server/patches/003-add-aarch64-edk2-in-depends.patch new file mode 100644 index 0000000..6140cc9 --- /dev/null +++ b/packages/qemu-server/patches/003-add-aarch64-edk2-in-depends.patch @@ -0,0 +1,20 @@ +diff --git a/debian/control b/debian/control +index 89a11181..d989cb95 100644 +--- a/debian/control ++++ b/debian/control +@@ -21,6 +21,7 @@ Build-Depends: debhelper-compat (= 13), + pve-cluster, + pve-doc-generator (>= 6.2-5), + pve-edk2-firmware, ++ pve-edk2-firmware-aarch64, + pve-firewall, + pve-ha-manager , + pve-qemu-kvm (>= 7.1~), +@@ -51,6 +52,7 @@ Depends: dbus, + # TODO: make legacy edk2 optional (suggests) for PVE 9 and warn explicitly about it + pve-edk2-firmware-legacy | pve-edk2-firmware (<< 4~), + pve-edk2-firmware-ovmf | pve-edk2-firmware (>= 3.20210831-1), ++ pve-edk2-firmware-aarch64, + pve-firewall (>= 5.0.4), + pve-ha-manager (>= 3.0-9), + pve-qemu-kvm (>= 7.1~), diff --git a/packages/qemu-server/patches/005-fix-arm64-cpu-cputype.patch b/packages/qemu-server/patches/005-fix-arm64-cpu-cputype.patch new file mode 100644 index 0000000..b2dc56e --- /dev/null +++ b/packages/qemu-server/patches/005-fix-arm64-cpu-cputype.patch @@ -0,0 +1,253 @@ +diff --git a/PVE/QemuServer/CPUConfig.pm b/PVE/QemuServer/CPUConfig.pm +index 33f7524f..5ae659a5 100644 +--- a/PVE/QemuServer/CPUConfig.pm ++++ b/PVE/QemuServer/CPUConfig.pm +@@ -36,22 +36,22 @@ sub load_custom_model_conf { + + #builtin models : reported-model is mandatory + my $builtin_models = { +- 'x86-64-v2' => { +- 'reported-model' => 'qemu64', +- flags => "+popcnt;+pni;+sse4.1;+sse4.2;+ssse3", +- }, +- 'x86-64-v2-AES' => { +- 'reported-model' => 'qemu64', +- flags => "+aes;+popcnt;+pni;+sse4.1;+sse4.2;+ssse3", +- }, +- 'x86-64-v3' => { +- 'reported-model' => 'qemu64', +- flags => "+aes;+popcnt;+pni;+sse4.1;+sse4.2;+ssse3;+avx;+avx2;+bmi1;+bmi2;+f16c;+fma;+abm;+movbe;+xsave", +- }, +- 'x86-64-v4' => { +- 'reported-model' => 'qemu64', +- flags => "+aes;+popcnt;+pni;+sse4.1;+sse4.2;+ssse3;+avx;+avx2;+bmi1;+bmi2;+f16c;+fma;+abm;+movbe;+xsave;+avx512f;+avx512bw;+avx512cd;+avx512dq;+avx512vl", +- }, ++ # 'x86-64-v2' => { ++ # 'reported-model' => 'qemu64', ++ # flags => "+popcnt;+pni;+sse4.1;+sse4.2;+ssse3", ++ # }, ++ # 'x86-64-v2-AES' => { ++ # 'reported-model' => 'qemu64', ++ # flags => "+aes;+popcnt;+pni;+sse4.1;+sse4.2;+ssse3", ++ # }, ++ # 'x86-64-v3' => { ++ # 'reported-model' => 'qemu64', ++ # flags => "+aes;+popcnt;+pni;+sse4.1;+sse4.2;+ssse3;+avx;+avx2;+bmi1;+bmi2;+f16c;+fma;+abm;+movbe;+xsave", ++ # }, ++ # 'x86-64-v4' => { ++ # 'reported-model' => 'qemu64', ++ # flags => "+aes;+popcnt;+pni;+sse4.1;+sse4.2;+ssse3;+avx;+avx2;+bmi1;+bmi2;+f16c;+fma;+abm;+movbe;+xsave;+avx512f;+avx512bw;+avx512cd;+avx512dq;+avx512vl", ++ # }, + }; + + my $depreacated_cpu_map = { +@@ -73,100 +73,97 @@ my $cputypes_32bit = { + + my $cpu_vendor_list = { + # Intel CPUs +- 486 => 'GenuineIntel', +- pentium => 'GenuineIntel', +- pentium2 => 'GenuineIntel', +- pentium3 => 'GenuineIntel', +- coreduo => 'GenuineIntel', +- core2duo => 'GenuineIntel', +- Conroe => 'GenuineIntel', +- Penryn => 'GenuineIntel', +- Nehalem => 'GenuineIntel', +- 'Nehalem-IBRS' => 'GenuineIntel', +- Westmere => 'GenuineIntel', +- 'Westmere-IBRS' => 'GenuineIntel', +- SandyBridge => 'GenuineIntel', +- 'SandyBridge-IBRS' => 'GenuineIntel', +- IvyBridge => 'GenuineIntel', +- 'IvyBridge-IBRS' => 'GenuineIntel', +- Haswell => 'GenuineIntel', +- 'Haswell-IBRS' => 'GenuineIntel', +- 'Haswell-noTSX' => 'GenuineIntel', +- 'Haswell-noTSX-IBRS' => 'GenuineIntel', +- Broadwell => 'GenuineIntel', +- 'Broadwell-IBRS' => 'GenuineIntel', +- 'Broadwell-noTSX' => 'GenuineIntel', +- 'Broadwell-noTSX-IBRS' => 'GenuineIntel', +- 'Skylake-Client' => 'GenuineIntel', +- 'Skylake-Client-IBRS' => 'GenuineIntel', +- 'Skylake-Client-noTSX-IBRS' => 'GenuineIntel', +- 'Skylake-Client-v4' => 'GenuineIntel', +- 'Skylake-Server' => 'GenuineIntel', +- 'Skylake-Server-IBRS' => 'GenuineIntel', +- 'Skylake-Server-noTSX-IBRS' => 'GenuineIntel', +- 'Skylake-Server-v4' => 'GenuineIntel', +- 'Skylake-Server-v5' => 'GenuineIntel', +- 'Cascadelake-Server' => 'GenuineIntel', +- 'Cascadelake-Server-v2' => 'GenuineIntel', +- 'Cascadelake-Server-noTSX' => 'GenuineIntel', +- 'Cascadelake-Server-v4' => 'GenuineIntel', +- 'Cascadelake-Server-v5' => 'GenuineIntel', +- 'Cooperlake' => 'GenuineIntel', +- 'Cooperlake-v2' => 'GenuineIntel', +- KnightsMill => 'GenuineIntel', +- 'Icelake-Client' => 'GenuineIntel', # depreacated, removed with QEMU 7.1 +- 'Icelake-Client-noTSX' => 'GenuineIntel', # depreacated, removed with QEMU 7.1 +- 'Icelake-Server' => 'GenuineIntel', +- 'Icelake-Server-noTSX' => 'GenuineIntel', +- 'Icelake-Server-v3' => 'GenuineIntel', +- 'Icelake-Server-v4' => 'GenuineIntel', +- 'Icelake-Server-v5' => 'GenuineIntel', +- 'Icelake-Server-v6' => 'GenuineIntel', +- 'SapphireRapids' => 'GenuineIntel', +- 'SapphireRapids-v2' => 'GenuineIntel', +- 'GraniteRapids' => 'GenuineIntel', +- +- # AMD CPUs +- athlon => 'AuthenticAMD', +- phenom => 'AuthenticAMD', +- Opteron_G1 => 'AuthenticAMD', +- Opteron_G2 => 'AuthenticAMD', +- Opteron_G3 => 'AuthenticAMD', +- Opteron_G4 => 'AuthenticAMD', +- Opteron_G5 => 'AuthenticAMD', +- EPYC => 'AuthenticAMD', +- 'EPYC-IBPB' => 'AuthenticAMD', +- 'EPYC-v3' => 'AuthenticAMD', +- 'EPYC-v4' => 'AuthenticAMD', +- 'EPYC-Rome' => 'AuthenticAMD', +- 'EPYC-Rome-v2' => 'AuthenticAMD', +- 'EPYC-Rome-v3' => 'AuthenticAMD', +- 'EPYC-Rome-v4' => 'AuthenticAMD', +- 'EPYC-Milan' => 'AuthenticAMD', +- 'EPYC-Milan-v2' => 'AuthenticAMD', +- 'EPYC-Genoa' => 'AuthenticAMD', +- +- # generic types, use vendor from host node +- host => 'default', +- kvm32 => 'default', +- kvm64 => 'default', +- qemu32 => 'default', +- qemu64 => 'default', +- max => 'default', ++ # 486 => 'GenuineIntel', ++ # pentium => 'GenuineIntel', ++ # pentium2 => 'GenuineIntel', ++ # pentium3 => 'GenuineIntel', ++ # coreduo => 'GenuineIntel', ++ # core2duo => 'GenuineIntel', ++ # Conroe => 'GenuineIntel', ++ # Penryn => 'GenuineIntel', ++ # Nehalem => 'GenuineIntel', ++ # 'Nehalem-IBRS' => 'GenuineIntel', ++ # Westmere => 'GenuineIntel', ++ # 'Westmere-IBRS' => 'GenuineIntel', ++ # SandyBridge => 'GenuineIntel', ++ # 'SandyBridge-IBRS' => 'GenuineIntel', ++ # IvyBridge => 'GenuineIntel', ++ # 'IvyBridge-IBRS' => 'GenuineIntel', ++ # Haswell => 'GenuineIntel', ++ # 'Haswell-IBRS' => 'GenuineIntel', ++ # 'Haswell-noTSX' => 'GenuineIntel', ++ # 'Haswell-noTSX-IBRS' => 'GenuineIntel', ++ # Broadwell => 'GenuineIntel', ++ # 'Broadwell-IBRS' => 'GenuineIntel', ++ # 'Broadwell-noTSX' => 'GenuineIntel', ++ # 'Broadwell-noTSX-IBRS' => 'GenuineIntel', ++ # 'Skylake-Client' => 'GenuineIntel', ++ # 'Skylake-Client-IBRS' => 'GenuineIntel', ++ # 'Skylake-Client-noTSX-IBRS' => 'GenuineIntel', ++ # 'Skylake-Client-v4' => 'GenuineIntel', ++ # 'Skylake-Server' => 'GenuineIntel', ++ # 'Skylake-Server-IBRS' => 'GenuineIntel', ++ # 'Skylake-Server-noTSX-IBRS' => 'GenuineIntel', ++ # 'Skylake-Server-v4' => 'GenuineIntel', ++ # 'Skylake-Server-v5' => 'GenuineIntel', ++ # 'Cascadelake-Server' => 'GenuineIntel', ++ # 'Cascadelake-Server-v2' => 'GenuineIntel', ++ # 'Cascadelake-Server-noTSX' => 'GenuineIntel', ++ # 'Cascadelake-Server-v4' => 'GenuineIntel', ++ # 'Cascadelake-Server-v5' => 'GenuineIntel', ++ # 'Cooperlake' => 'GenuineIntel', ++ # 'Cooperlake-v2' => 'GenuineIntel', ++ # KnightsMill => 'GenuineIntel', ++ # 'Icelake-Client' => 'GenuineIntel', # depreacated, removed with QEMU 7.1 ++ # 'Icelake-Client-noTSX' => 'GenuineIntel', # depreacated, removed with QEMU 7.1 ++ # 'Icelake-Server' => 'GenuineIntel', ++ # 'Icelake-Server-noTSX' => 'GenuineIntel', ++ # 'Icelake-Server-v3' => 'GenuineIntel', ++ # 'Icelake-Server-v4' => 'GenuineIntel', ++ # 'Icelake-Server-v5' => 'GenuineIntel', ++ # 'Icelake-Server-v6' => 'GenuineIntel', ++ # 'SapphireRapids' => 'GenuineIntel', ++ ++ # # AMD CPUs ++ # athlon => 'AuthenticAMD', ++ # phenom => 'AuthenticAMD', ++ # Opteron_G1 => 'AuthenticAMD', ++ # Opteron_G2 => 'AuthenticAMD', ++ # Opteron_G3 => 'AuthenticAMD', ++ # Opteron_G4 => 'AuthenticAMD', ++ # Opteron_G5 => 'AuthenticAMD', ++ # EPYC => 'AuthenticAMD', ++ # 'EPYC-IBPB' => 'AuthenticAMD', ++ # 'EPYC-v3' => 'AuthenticAMD', ++ #'EPYC-v4' => 'AuthenticAMD', ++ # 'EPYC-Rome' => 'AuthenticAMD', ++ # 'EPYC-Rome-v2' => 'AuthenticAMD', ++ #'EPYC-Rome-v3' => 'AuthenticAMD', ++ #'EPYC-Rome-v4' => 'AuthenticAMD', ++ #'EPYC-Milan' => 'AuthenticAMD', ++ #'EPYC-Milan-v2' => 'AuthenticAMD', ++ #'EPYC-Genoa' => 'AuthenticAMD', ++ ++ # # generic types, use vendor from host node ++ # host => 'default', ++ # kvm32 => 'default', ++ # kvm64 => 'default', ++ # qemu32 => 'default', ++ # qemu64 => 'default', ++ # max => 'default', ++ # virt arm64 cpus ++ 'host' => 'default', ++ 'cortex-a35' => 'default', ++ 'cortex-a53' => 'default', ++ 'cortex-a55' => 'default', ++ 'cortex-a57' => 'default', ++ 'cortex-a72' => 'default', ++ 'cortex-a76' => 'default', ++ 'neoverse-n1' => 'default', ++ 'max' => 'default', + }; + + my @supported_cpu_flags = ( +- 'pcid', +- 'spec-ctrl', +- 'ibpb', +- 'ssbd', +- 'virt-ssbd', +- 'amd-ssbd', +- 'amd-no-ssb', +- 'pdpe1gb', +- 'md-clear', +- 'hv-tlbflush', +- 'hv-evmcs', + 'aes' + ); + my $cpu_flag_supported_re = qr/([+-])(@{[join('|', @supported_cpu_flags)]})/; +@@ -188,7 +185,7 @@ my $cpu_fmt = { + ." Only valid for custom CPU model definitions, default models will always report themselves to the guest OS.", + type => 'string', + enum => [ sort { lc("$a") cmp lc("$b") } keys %$cpu_vendor_list ], +- default => 'kvm64', ++ default => 'host', + optional => 1, + }, + hidden => { +@@ -736,7 +733,10 @@ sub get_default_cpu_type { + my ($arch, $kvm) = @_; + + my $cputype = $kvm ? 'kvm64' : 'qemu64'; +- $cputype = 'cortex-a57' if $arch eq 'aarch64'; ++ $cputype = 'host' if $arch eq 'aarch64'; ++ $cputype = 'host' if $arch eq 'arm'; ++ $cputype = 'rv64' if $arch eq 'riscv64'; ++ $cputype = 'la464-loongarch-cpu' if $arch eq 'loongarch64'; + + return $cputype; + } diff --git a/packages/qemu-server/patches/006-add-qemu-xhci.patch b/packages/qemu-server/patches/006-add-qemu-xhci.patch new file mode 100644 index 0000000..050459c --- /dev/null +++ b/packages/qemu-server/patches/006-add-qemu-xhci.patch @@ -0,0 +1,38 @@ +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm +index b26da505..fc8ca388 100644 +--- a/PVE/QemuServer.pm ++++ b/PVE/QemuServer.pm +@@ -1370,7 +1375,7 @@ sub print_tabletdevice_full { + # we use uhci for old VMs because tablet driver was buggy in older qemu + my $usbbus; + if ($q35 || $arch eq 'aarch64') { +- $usbbus = 'ehci'; ++ $usbbus = 'qemu-xhci'; + } else { + $usbbus = 'uhci'; + } +@@ -1383,7 +1388,7 @@ sub print_keyboarddevice_full { + + return if $arch ne 'aarch64'; + +- return "usb-kbd,id=keyboard,bus=ehci.0,port=2"; ++ return "usb-kbd,id=keyboard,bus=qemu-xhci.0,port=2"; + } + + my sub get_drive_id { + +diff --git a/PVE/QemuServer/USB.pm b/PVE/QemuServer/USB.pm +index 49957444..c7b5033f 100644 +--- a/PVE/QemuServer/USB.pm ++++ b/PVE/QemuServer/USB.pm +@@ -134,8 +134,8 @@ sub get_usb_controllers { + my $is_q35 = PVE::QemuServer::Machine::machine_type_is_q35($conf); + + if ($arch eq 'aarch64') { +- $pciaddr = print_pci_addr('ehci', $bridges, $arch, $machine); +- push @$devices, '-device', "usb-ehci,id=ehci$pciaddr"; ++ $pciaddr = print_pci_addr('qemu-xhci', $bridges, $arch, $machine); ++ push @$devices, '-device', "qemu-xhci,id=qemu-xhci"; + } elsif (!$is_q35) { + $pciaddr = print_pci_addr("piix3", $bridges, $arch, $machine); + push @$devices, '-device', "piix3-usb-uhci,id=uhci$pciaddr.0x2"; diff --git a/packages/qemu-server/patches/007-use-virt-machine-type.patch b/packages/qemu-server/patches/007-use-virt-machine-type.patch new file mode 100644 index 0000000..4b5d556 --- /dev/null +++ b/packages/qemu-server/patches/007-use-virt-machine-type.patch @@ -0,0 +1,55 @@ +diff --git a/PVE/API2/Qemu/Machine.pm b/PVE/API2/Qemu/Machine.pm +index afb535c2..db6c3d80 100644 +--- a/PVE/API2/Qemu/Machine.pm ++++ b/PVE/API2/Qemu/Machine.pm +@@ -38,7 +38,7 @@ __PACKAGE__->register_method({ + }, + type => { + type => 'string', +- enum => ['q35', 'i440fx'], ++ enum => ['q35', 'virt'], + description => "The machine type.", + }, + version => { +@@ -50,7 +50,7 @@ __PACKAGE__->register_method({ + }, + code => sub { + my $machines = eval { +- my $raw = file_get_contents('/usr/share/kvm/machine-versions-x86_64.json'); ++ my $raw = file_get_contents('/usr/share/kvm/machine-versions-aarch64.json'); + return from_json($raw, { utf8 => 1 }); + }; + die "could not load supported machine versions - $@\n" if $@; + +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm +index b26da505..fc8ca388 100644 +--- a/PVE/QemuServer.pm ++++ b/PVE/QemuServer.pm +@@ -4112,19 +4125,15 @@ sub config_to_command { + $machine_type_min =~ s/\+pve\d+$//; + $machine_type_min .= "+pve$required_pve_version"; + } +- push @$machineFlags, "type=${machine_type_min}"; +- +- PVE::QemuServer::Machine::assert_valid_machine_property($conf, $machine_conf); +- +- if (my $viommu = $machine_conf->{viommu}) { +- if ($viommu eq 'intel') { +- unshift @$devices, '-device', 'intel-iommu,intremap=on,caching-mode=on'; +- push @$machineFlags, 'kernel-irqchip=split'; +- } elsif ($viommu eq 'virtio') { +- push @$devices, '-device', 'virtio-iommu-pci'; ++ if ($arch eq 'aarch64'){ ++ if (!$kvm){ ++ push @$machineFlags, "type=${machine_type_min}"; ++ }else{ ++ push @$machineFlags, "type=${machine_type_min},gic-version=host"; + } ++ }else{ ++ push @$machineFlags, "type=${machine_type_min}"; + } +- + push @$cmd, @$devices; + push @$cmd, '-rtc', join(',', @$rtcFlags) if scalar(@$rtcFlags); + push @$cmd, '-machine', join(',', @$machineFlags) if scalar(@$machineFlags); + diff --git a/packages/qemu-server/patches/008-add-ramfb-support.patch b/packages/qemu-server/patches/008-add-ramfb-support.patch new file mode 100644 index 0000000..15328f9 --- /dev/null +++ b/packages/qemu-server/patches/008-add-ramfb-support.patch @@ -0,0 +1,40 @@ +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm +index b26da505..fc8ca388 100644 +--- a/PVE/QemuServer.pm ++++ b/PVE/QemuServer.pm +@@ -184,7 +200,7 @@ my $vga_fmt = { + default => 'std', + optional => 1, + default_key => 1, +- enum => [qw(cirrus qxl qxl2 qxl3 qxl4 none serial0 serial1 serial2 serial3 std virtio virtio-gl vmware)], ++ enum => [qw(cirrus qxl qxl2 qxl3 qxl4 none serial0 serial1 serial2 serial3 std virtio virtio-gl vmware ramfb)], + }, + memory => { + description => "Sets the VGA memory (in MiB). Has no effect with serial display.", +@@ -1775,7 +1780,8 @@ my $vga_map = { + 'std' => 'VGA', + 'vmware' => 'vmware-svga', + 'virtio' => 'virtio-vga', +- 'virtio-gl' => 'virtio-vga-gl', ++ 'virtio-gl' => 'virtio-gpu-gl', ++ 'ramfb' => 'ramfb', + }; + + sub print_vga_device { +@@ -3793,9 +3803,12 @@ sub config_to_command { + push @$cmd, '-no-reboot' if defined($conf->{reboot}) && $conf->{reboot} == 0; + + if ($vga->{type} && $vga->{type} !~ m/^serial\d+$/ && $vga->{type} ne 'none'){ +- push @$devices, '-device', print_vga_device( +- $conf, $vga, $arch, $machine_version, $machine_type, undef, $qxlnum, $bridges); +- ++ if ($vga->{type} eq 'ramfb'){ ++ push @$devices, '-device', 'ramfb'; ++ } else { ++ push @$devices, '-device', print_vga_device( ++ $conf, $vga, $arch, $machine_version, $machine_type, undef, $qxlnum, $bridges); ++ } + push @$cmd, '-display', 'egl-headless,gl=core' if $vga->{type} eq 'virtio-gl'; # VIRGL + + my $socket = PVE::QemuServer::Helpers::vnc_socket($vmid); + diff --git a/packages/qemu-server/patches/009-add-tmp-support.patch b/packages/qemu-server/patches/009-add-tmp-support.patch new file mode 100644 index 0000000..50a63db --- /dev/null +++ b/packages/qemu-server/patches/009-add-tmp-support.patch @@ -0,0 +1,17 @@ +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm +index b26da505..fc8ca388 100644 +--- a/PVE/QemuServer.pm ++++ b/PVE/QemuServer.pm +@@ -3125,7 +3131,14 @@ sub add_tpm_device { + + push @$devices, "-chardev", "socket,id=tpmchar,path=$paths->{socket}"; + push @$devices, "-tpmdev", "emulator,id=tpmdev,chardev=tpmchar"; ++ ++ #https://bugzilla.proxmox.com/show_bug.cgi?id=4219 ++ my $arch = $conf->{arch} // get_host_arch(); ++ if ($arch eq 'x86_64'){ + push @$devices, "-device", "tpm-tis,tpmdev=tpmdev"; ++ }else{ ++ push @$devices, "-device", "tpm-tis-device,tpmdev=tpmdev"; ++ } + } diff --git a/packages/qemu-server/patches/010-add-secboot.patch b/packages/qemu-server/patches/010-add-secboot.patch new file mode 100644 index 0000000..5fce6fb --- /dev/null +++ b/packages/qemu-server/patches/010-add-secboot.patch @@ -0,0 +1,44 @@ +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm +index b26da505..fc8ca388 100644 +--- a/PVE/QemuServer.pm ++++ b/PVE/QemuServer.pm +@@ -97,6 +97,22 @@ my $OVMF = { + ], + }, + aarch64 => { ++ '4m-no-smm' => [ ++ "$EDK2_FW_BASE/AAVMF_CODE.fd", ++ "$EDK2_FW_BASE/AAVMF_VARS.fd", ++ ], ++ '4m-no-smm-ms' => [ ++ "$EDK2_FW_BASE/AAVMF_CODE.ms.fd", ++ "$EDK2_FW_BASE/AAVMF_VARS.ms.fd", ++ ], ++ '4m' => [ ++ "$EDK2_FW_BASE/AAVMF_CODE.fd", ++ "$EDK2_FW_BASE/AAVMF_VARS.fd", ++ ], ++ '4m-ms' => [ ++ "$EDK2_FW_BASE/AAVMF_CODE.ms.fd", ++ "$EDK2_FW_BASE/AAVMF_VARS.ms.fd", ++ ], + default => [ + "$EDK2_FW_BASE/AAVMF_CODE.fd", + "$EDK2_FW_BASE/AAVMF_VARS.fd", +@@ -3295,13 +3308,9 @@ sub get_ovmf_files($$$) { + or die "no OVMF images known for architecture '$arch'\n"; + + my $type = 'default'; +- if ($arch eq 'x86_64') { +- if (defined($efidisk->{efitype}) && $efidisk->{efitype} eq '4m') { +- $type = $smm ? "4m" : "4m-no-smm"; +- $type .= '-ms' if $efidisk->{'pre-enrolled-keys'}; +- } else { +- # TODO: log_warn about use of legacy images for x86_64 with Promxox VE 9 +- } ++ if (defined($efidisk->{efitype}) && $efidisk->{efitype} eq '4m') { ++ $type = $smm ? "4m" : "4m-no-smm"; ++ $type .= '-ms' if $efidisk->{'pre-enrolled-keys'}; + } + + my ($ovmf_code, $ovmf_vars) = $types->{$type}->@*; diff --git a/packages/qemu-server/patches/011-remote-other-ostype.patch b/packages/qemu-server/patches/011-remote-other-ostype.patch new file mode 100644 index 0000000..ec76c5b --- /dev/null +++ b/packages/qemu-server/patches/011-remote-other-ostype.patch @@ -0,0 +1,35 @@ +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm +index b26da505..fc8ca388 100644 +--- a/PVE/QemuServer.pm ++++ b/PVE/QemuServer.pm +@@ -404,8 +420,7 @@ my $confdesc = { + ostype => { + optional => 1, + type => 'string', +- # NOTE: When extending, also consider extending `%guest_types` in `Import/ESXi.pm`. +- enum => [qw(other wxp w2k w2k3 w2k8 wvista win7 win8 win10 win11 l24 l26 solaris)], ++ enum => [qw(win11 l26 other)], + description => "Specify guest operating system.", + verbose_description => < { diff --git a/packages/qemu-server/patches/012-fix-pbs-file-brower-issue.patch b/packages/qemu-server/patches/012-fix-pbs-file-brower-issue.patch new file mode 100644 index 0000000..95278b0 --- /dev/null +++ b/packages/qemu-server/patches/012-fix-pbs-file-brower-issue.patch @@ -0,0 +1,24 @@ +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm +index b26da505..fc8ca388 100644 +--- a/PVE/QemuServer.pm ++++ b/PVE/QemuServer.pm +@@ -3374,7 +3383,8 @@ sub query_supported_cpu_flags { + '-chardev', "socket,id=qmp,path=/var/run/qemu-server/$fakevmid.qmp,server=on,wait=off", + '-mon', 'chardev=qmp,mode=control', + '-pidfile', $pidfile, +- '-S', '-daemonize' ++ '-S', '-daemonize', ++ '-cpu', 'max' + ]; + + if (!$kvm) { + +@@ -3389,7 +3399,7 @@ sub query_supported_cpu_flags { + $fakevmid, + 'query-cpu-model-expansion', + type => 'full', +- model => { name => 'host' } ++ model => { name => 'max' } + ); + + my $props = $cmd_result->{model}->{props}; diff --git a/packages/qemu-server/patches/013-remove-other-scsihw.patch b/packages/qemu-server/patches/013-remove-other-scsihw.patch new file mode 100644 index 0000000..1b90428 --- /dev/null +++ b/packages/qemu-server/patches/013-remove-other-scsihw.patch @@ -0,0 +1,16 @@ +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm +index b26da505..fc8ca388 100644 +--- a/PVE/QemuServer.pm ++++ b/PVE/QemuServer.pm +@@ -391,8 +407,8 @@ my $confdesc = { + optional => 1, + type => 'string', + description => "SCSI controller model", +- enum => [qw(lsi lsi53c810 virtio-scsi-pci virtio-scsi-single megasas pvscsi)], +- default => 'lsi', ++ enum => [qw(virtio-scsi-pci virtio-scsi-single)], ++ default => 'virtio-scsi-pci', + }, + description => { + optional => 1, + diff --git a/packages/qemu-server/patches/014-use-scsi2-for-cdrom.patch b/packages/qemu-server/patches/014-use-scsi2-for-cdrom.patch new file mode 100644 index 0000000..b037b61 --- /dev/null +++ b/packages/qemu-server/patches/014-use-scsi2-for-cdrom.patch @@ -0,0 +1,38 @@ +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm +index b26da505..fc8ca388 100644 +--- a/PVE/QemuServer.pm ++++ b/PVE/QemuServer.pm +@@ -599,9 +604,9 @@ EODESCR + }, + cdrom => { + optional => 1, +- type => 'string', format => 'pve-qm-ide', ++ type => 'string', format => 'pve-qm-scsi', + typetext => '', +- description => "This is an alias for option -ide2", ++ description => "This is an alias for option -scsi", + }, + cpu => { + optional => 1, + +@@ -2394,7 +2400,7 @@ sub parse_vm_config { + if ($@) { + $handle_error->("vm $vmid - unable to parse value of '$key' - $@"); + } else { +- $key = 'ide2' if $key eq 'cdrom'; ++ $key = 'scsi2' if $key eq 'cdrom'; + my $fmt = $confdesc->{$key}->{format}; + if ($fmt && $fmt =~ /^pve-qm-(?:ide|scsi|virtio|sata)$/) { + my $v = parse_drive($key, $value); +@@ -2426,8 +2432,8 @@ sub write_vm_config { + delete $conf->{snapstate}; # just to be sure + + if ($conf->{cdrom}) { +- die "option ide2 conflicts with cdrom\n" if $conf->{ide2}; +- $conf->{ide2} = $conf->{cdrom}; ++ die "option scsi2 conflicts with cdrom\n" if $conf->{scsi2}; ++ $conf->{scsi2} = $conf->{cdrom}; + delete $conf->{cdrom}; + } + + sub start_swtpm { diff --git a/packages/qemu-server/patches/015-remove-vmgenid-in-arm64.patch b/packages/qemu-server/patches/015-remove-vmgenid-in-arm64.patch new file mode 100644 index 0000000..104e619 --- /dev/null +++ b/packages/qemu-server/patches/015-remove-vmgenid-in-arm64.patch @@ -0,0 +1,13 @@ +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm +index b26da505..fc8ca388 100644 +--- a/PVE/QemuServer.pm ++++ b/PVE/QemuServer.pm +@@ -3679,7 +3689,7 @@ sub config_to_command { + push @$cmd, $fixups->@*; + } + +- if ($conf->{vmgenid}) { ++ if ($conf->{vmgenid} && $arch eq 'x86_64') { + push @$devices, '-device', 'vmgenid,guid='.$conf->{vmgenid}; + } + diff --git a/packages/qemu-server/patches/016-fix-arm64-virtgl-error.patch b/packages/qemu-server/patches/016-fix-arm64-virtgl-error.patch new file mode 100644 index 0000000..7bbd52d --- /dev/null +++ b/packages/qemu-server/patches/016-fix-arm64-virtgl-error.patch @@ -0,0 +1,13 @@ +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm +index b26da505..fc8ca388 100644 +--- a/PVE/QemuServer.pm ++++ b/PVE/QemuServer.pm +@@ -1835,7 +1841,7 @@ sub print_vga_device { + } + + if ($vga->{type} eq 'virtio-gl') { +- my $base = '/usr/lib/x86_64-linux-gnu/lib'; ++ my $base = '/usr/lib/aarch64-linux-gnu/lib'; + die "missing libraries for '$vga->{type}' detected! Please install 'libgl1' and 'libegl1'\n" + if !-e "${base}EGL.so.1" || !-e "${base}GL.so.1"; + diff --git a/packages/qemu-server/patches/017-remove-cpu-flags-detect-message.patch b/packages/qemu-server/patches/017-remove-cpu-flags-detect-message.patch new file mode 100644 index 0000000..136cc83 --- /dev/null +++ b/packages/qemu-server/patches/017-remove-cpu-flags-detect-message.patch @@ -0,0 +1,16 @@ +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm +index b26da505..fc8ca388 100644 +--- a/PVE/QemuServer.pm ++++ b/PVE/QemuServer.pm +@@ -3354,8 +3363,8 @@ sub query_supported_cpu_flags { + + # FIXME: Once this is merged, the code below should work for ARM as well: + # https://lists.nongnu.org/archive/html/qemu-devel/2019-06/msg04947.html +- die "QEMU/KVM cannot detect CPU flags on ARM (aarch64)\n" if +- $arch eq "aarch64"; ++ # die "QEMU/KVM cannot detect CPU flags on ARM (aarch64)\n" if ++ # $arch eq "aarch64"; + + my $kvm_supported = defined(kvm_version()); + my $qemu_cmd = get_command_for_arch($arch); + diff --git a/packages/qemu-server/patches/changelog/004-add-changelog.patch b/packages/qemu-server/patches/changelog/004-add-changelog.patch new file mode 100644 index 0000000..37ccc12 --- /dev/null +++ b/packages/qemu-server/patches/changelog/004-add-changelog.patch @@ -0,0 +1,55 @@ +diff --git a/debian/changelog b/debian/changelog +index ddb70dc8..ba7366c4 100644 +--- a/debian/changelog ++++ b/debian/changelog +@@ -121,6 +121,20 @@ qemu-server (8.1.2) bookworm; urgency=medium + + -- Proxmox Support Team Fri, 19 Apr 2024 16:09:18 +0200 + ++qemu-server (8.1.1+port2) bookworm; urgency=medium ++ ++ * fix query_supported_cpu_flags on aarch64 ++ ++ -- jiangcuo Wed, 27 Mar 2024 09:26:45 +0800 ++ ++qemu-server (8.1.1+port1) bookworm; urgency=medium ++ ++ * update to 8.1.1 ++ ++ * remove qemu cpu flags check ++ ++ -- jiangcuo Fri, 22 Mar 2024 21:11:29 +0800 ++ + qemu-server (8.1.1) bookworm; urgency=medium + + * config: pending network: avoid undef-warning on old/new comparison +@@ -173,6 +187,12 @@ qemu-server (8.1.0) bookworm; urgency=medium + + -- Proxmox Support Team Fri, 08 Mar 2024 15:00:25 +0100 + ++qemu-server (8.0.10+pve1) bookworm; urgency=medium ++ ++ * add pve-edk2-firmware-aarch64 depends ++ ++ -- jiangcuo Sun, 03 Dec 2023 01:46:23 -0500 ++ + qemu-server (8.0.10) bookworm; urgency=medium + + * sdn: pass vmid and hostname to allow requesting a new mapping +@@ -191,6 +211,16 @@ qemu-server (8.0.9) bookworm; urgency=medium + + -- Proxmox Support Team Tue, 21 Nov 2023 15:40:27 +0100 + ++qemu-server (8.0.8-1) bookworm; urgency=medium ++ ++ * remove some scshw ++ ++ * add new cputype ++ ++ * add virt machine ++ ++ -- jiangcuo Sun, 19 Nov 2023 14:29:21 +0800 ++ + qemu-server (8.0.8) bookworm; urgency=medium + + * fix #2816: restore: remove timeout when allocating disks diff --git a/packages/qemu-server/qemu-server b/packages/qemu-server/qemu-server new file mode 160000 index 0000000..00d68b8 --- /dev/null +++ b/packages/qemu-server/qemu-server @@ -0,0 +1 @@ +Subproject commit 00d68b8d1a166e03d59b7dffde50f960063bb2fb diff --git a/packages/qemu-server/series b/packages/qemu-server/series new file mode 100644 index 0000000..aa897a7 --- /dev/null +++ b/packages/qemu-server/series @@ -0,0 +1,17 @@ +patches/001-fix-arm64-build.patch +patches/002-fix-arm64-pcie.patch +patches/003-add-aarch64-edk2-in-depends.patch +patches/005-fix-arm64-cpu-cputype.patch +patches/006-add-qemu-xhci.patch +patches/007-use-virt-machine-type.patch +patches/008-add-ramfb-support.patch +patches/009-add-tmp-support.patch +patches/010-add-secboot.patch +patches/011-remote-other-ostype.patch +patches/012-fix-pbs-file-brower-issue.patch +patches/013-remove-other-scsihw.patch +patches/014-use-scsi2-for-cdrom.patch +patches/015-remove-vmgenid-in-arm64.patch +patches/016-fix-arm64-virtgl-error.patch +patches/017-remove-cpu-flags-detect-message.patch +patches/changelog/004-add-changelog.patch diff --git a/pve-edk2-firmware/LOONGARCH_CODE.fd b/pve-edk2-firmware/LOONGARCH_CODE.fd deleted file mode 100644 index 038da16..0000000 Binary files a/pve-edk2-firmware/LOONGARCH_CODE.fd and /dev/null differ diff --git a/pve-edk2-firmware/RISCV_VARS.fd b/pve-edk2-firmware/RISCV_VARS.fd deleted file mode 100644 index dd90ea9..0000000 Binary files a/pve-edk2-firmware/RISCV_VARS.fd and /dev/null differ diff --git a/pve-edk2-firmware/fw_dynamic.bin b/pve-edk2-firmware/fw_dynamic.bin deleted file mode 100755 index 7accd65..0000000 Binary files a/pve-edk2-firmware/fw_dynamic.bin and /dev/null differ diff --git a/pve-edk2-firmware/readme.md b/pve-edk2-firmware/readme.md deleted file mode 100644 index f58f866..0000000 --- a/pve-edk2-firmware/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# This is prebuild edk2 firmware - -## 1. Build RISCV64 -https://github-wiki-see.page/m/riscv-non-isa/riscv-acpi/wiki/PoC-%3A-How-to-build-and-test-ACPI-enabled-kernel - -### a. Clone source code -```bash -git clone --branch riscv_acpi https://github.com/ventanamicro/opensbi.git opensbi -git clone --recurse-submodule git@github.com:tianocore/edk2.git edk2 -``` -### b. Build edk2 -```bash -export WORKSPACE=`pwd` -export GCC5_RISCV64_PREFIX=/usr/bin/riscv64-linux-gnu- -export PACKAGES_PATH=$WORKSPACE/edk2 -export EDK_TOOLS_PATH=$WORKSPACE/edk2/BaseTools -source edk2/edksetup.sh -make -C edk2/BaseTools clean -make -C edk2/BaseTools -make -C edk2/BaseTools/Source/C -source edk2/edksetup.sh BaseTools -build -a RISCV64 --buildtarget RELEASE -p OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc -t GCC5 -truncate -s 32M Build/RiscVVirtQemu/RELEASE_GCC5/FV/RISCV_VIRT.fd -``` -edk2 firmware will be located at `Build/RiscVVirtQemu/RELEASE_GCC5/FV/RISCV_VIRT.fd` - -### c. Build OpenSBI - -```bash -cd opensbi -make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- PLATFORM=generic -``` -sbifw located at `opensbi/build/platform/generic/firmware/fw_dynamic.bin` - -## 2. Build Loongarch64 -https://mirrors.pku.edu.cn/loongarch/archlinux/images/README.html