├── Patch ├── .gitkeep ├── pve-edk2-firmware │ ├── readme.md │ └── add_secboot.patch ├── lxcfs │ └── set-links-to-aarch64.patch ├── qemu-server │ ├── 0002set_cpu_to_host.patch │ ├── 007-set-gic-version-to-host.patch │ ├── 0006-add-secboot.patch │ ├── 0004-set-usb-qemu_xhci.patch │ ├── 0005-add-ramfb-support.patch │ └── 0001-add_pcie.patch ├── proxmox-mini-journalreader │ └── add-aarch64-support.patch ├── zfsonlinux │ └── 009-zfsonlinux-debs.patch ├── pve-qemu │ └── 008pve-qemu-default-is-aarch.patch ├── pve-lxc-syscalld │ └── add-aarch64-support.patch ├── proxmox-backup-restore-image │ └── 003proxmox-backup-restore-image-add-aarch64.patch ├── pve-manager │ └── 001add-ramfb-pvearm_source-cpu_to_host.patch ├── proxmox-backup │ └── 004proxmox-backup-add-aarch64.patch ├── pve-installer │ └── 001pve-installer-add-multi-arch-support.patch └── proxmox-backup-qemu │ └── 002proxmox-backup-qemu-add-makefile.patch ├── .gitignore ├── README.md ├── iso ├── initrd │ ├── .pve-cd-id.txt │ ├── .cd-info │ ├── mkinitrd.sh │ └── init └── tools │ ├── mkiso.sh │ ├── getdepends.sh │ ├── update-suqahsfs.sh │ └── create_pve-base.sh ├── .DS_Store ├── images ├── pasthrough.png └── proxmox-devel-repo-rust-crates-pkg.png ├── .github └── FUNDING.yml ├── changlog.md ├── README-zh.md ├── repacked.sh └── LICENSE /Patch/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | iso/setuperror 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | https://github.com/jiangcuo/Proxmox-Port 2 | -------------------------------------------------------------------------------- /Patch/pve-edk2-firmware/readme.md: -------------------------------------------------------------------------------- 1 | ## pve-edk2-firmware 2 | 3 | -------------------------------------------------------------------------------- /iso/initrd/.pve-cd-id.txt: -------------------------------------------------------------------------------- 1 | 08b01b1a-10da-11ee-b2e5-dfbfc77c9f31 2 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangcuo/Proxmox-Arm64/HEAD/.DS_Store -------------------------------------------------------------------------------- /images/pasthrough.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangcuo/Proxmox-Arm64/HEAD/images/pasthrough.png -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # 2 | custom: ["0x757bb4557b7796948230dfc9f673228890908f74","alipay to jiangcuo@bingsin.com"] 3 | -------------------------------------------------------------------------------- /changlog.md: -------------------------------------------------------------------------------- 1 | ## 20230613 2 | upgrade to proxmox ve 8 beta8 3 | 4 | ## 20230901 5 | 6 | upgrade to proxmove ve 8.0.3-1 7 | -------------------------------------------------------------------------------- /iso/initrd/.cd-info: -------------------------------------------------------------------------------- 1 | RELEASE='8.0' 2 | ISORELEASE='1' 3 | ISONAME='proxmox-ve' 4 | PRODUCT='pve' 5 | PRODUCTLONG='Proxmox VE' 6 | -------------------------------------------------------------------------------- /images/proxmox-devel-repo-rust-crates-pkg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangcuo/Proxmox-Arm64/HEAD/images/proxmox-devel-repo-rust-crates-pkg.png -------------------------------------------------------------------------------- /iso/tools/mkiso.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #isopath 3 | isopath=$1 4 | xorriso -as mkisofs -r -V 'PVE' \ 5 | -o ../pvearm.iso \ 6 | -R -cache-inodes \ 7 | -e boot/grub/efi.img \ 8 | -no-emul-boot \ 9 | -append_partition 2 0xef boot/grub/efi.img \ 10 | -partition_cyl_align all \ 11 | $isopath/ -------------------------------------------------------------------------------- /Patch/pve-edk2-firmware/add_secboot.patch: -------------------------------------------------------------------------------- 1 | diff -Nru a/debian/pve-edk2-firmware.links b/debian/pve-edk2-firmware.links 2 | --- a/debian/pve-edk2-firmware.links 1970-01-01 08:00:00.000000000 +0800 3 | +++ b/debian/pve-edk2-firmware.links 2023-08-25 16:54:31.112605807 +0800 4 | @@ -0,0 +1 @@ 5 | +usr/share/pve-edk2-firmware/AAVMF_CODE.fd usr/share/pve-edk2-firmware/AAVMF_CODE.ms.fd 6 | -------------------------------------------------------------------------------- /Patch/lxcfs/set-links-to-aarch64.patch: -------------------------------------------------------------------------------- 1 | diff -ur a/debian/lxcfs.links b/debian/lxcfs.links 2 | --- a/debian/lxcfs.links 2023-06-03 12:11:56.478211935 +0000 3 | +++ b/debian/lxcfs.links 2023-06-03 12:14:39.007960046 +0000 4 | @@ -1 +1 @@ 5 | -usr/lib/x86_64-linux-gnu/lxcfs/liblxcfs.so usr/lib/x86_64-linux-gnu/liblxcfs.so 6 | +usr/lib/aarch64-linux-gnu/lxcfs/liblxcfs.so usr/lib/aarch64-linux-gnu/liblxcfs.so -------------------------------------------------------------------------------- /Patch/qemu-server/0002set_cpu_to_host.patch: -------------------------------------------------------------------------------- 1 | diff -x .git -ur a/PVE/QemuServer/CPUConfig.pm b/PVE/QemuServer/CPUConfig.pm 2 | --- a/PVE/QemuServer/CPUConfig.pm 2023-06-06 13:22:56.188610475 +0000 3 | +++ b/PVE/QemuServer/CPUConfig.pm 2023-06-06 13:16:46.274504157 +0000 4 | @@ -463,7 +463,7 @@ 5 | 6 | my $cputype = $kvm ? "kvm64" : "qemu64"; 7 | if ($arch eq 'aarch64') { 8 | - $cputype = 'cortex-a57'; 9 | + $cputype = 'host'; 10 | } 11 | 12 | my $cpu = {}; 13 | -------------------------------------------------------------------------------- /Patch/qemu-server/007-set-gic-version-to-host.patch: -------------------------------------------------------------------------------- 1 | diff -uNr a/PVE/QemuServer.pm b/PVE/QemuServer.pm 2 | --- a/PVE/QemuServer.pm 2023-06-24 00:08:52.414002113 +0800 3 | +++ b/PVE/QemuServer.pm 2023-06-24 00:25:26.572220096 +0800 4 | @@ -4158,8 +4183,11 @@ 5 | $machine_type_min =~ s/\+pve\d+$//; 6 | $machine_type_min .= "+pve$required_pve_version"; 7 | } 8 | - push @$machineFlags, "type=${machine_type_min}"; 9 | - 10 | + if ($arch eq 'aarch64'){ 11 | + push @$machineFlags, "type=${machine_type_min},gic-version=host"; 12 | + }else{ 13 | + push @$machineFlags, "type=${machine_type_min}"; 14 | + } 15 | push @$cmd, @$devices; 16 | push @$cmd, '-rtc', join(',', @$rtcFlags) if scalar(@$rtcFlags); 17 | push @$cmd, '-machine', join(',', @$machineFlags) if scalar(@$machineFlags); 18 | -------------------------------------------------------------------------------- /iso/tools/getdepends.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #原文链接:https://blog.csdn.net/qq_51470638/article/details/127136484 3 | #$1 = pkg 4 | get_all_depends() 5 | { 6 | apt-cache depends --no-pre-depends --no-suggests --no-recommends \ 7 | --no-conflicts --no-breaks --no-enhances\ 8 | --no-replaces --recurse $1 | awk '{print $2}'| tr -d '<>' | sort --unique 9 | } 10 | 11 | mkdir packages-$1 12 | cd packages-$1 13 | for pkg in $* 14 | do 15 | all_depends=$(get_all_depends $pkg) 16 | echo -e "所有依赖共计"$(echo $all_depends | wc -w)"个" 17 | echo $all_depends 18 | i=0 19 | for depend in $all_depends 20 | do 21 | i=$((i+1)) 22 | echo -e "\033[1;32m正在下载第$i个依赖:"$depend "\033[0m" 23 | apt-get download $depend 24 | done 25 | done 26 | -------------------------------------------------------------------------------- /iso/initrd/mkinitrd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #isopath="" 3 | isopath=$1 4 | localpath=$(dirname $(readlink -f "$0")) 5 | chmod +x $localpath/init 6 | mkdir $localpath/initrd -p 7 | for inits in `find $isopath/boot/ -maxdepth 1 -name "initrd*" -printf '%f\n'`; 8 | do 9 | initpath="$isopath/boot/$inits" 10 | cp $initpath $localpath/initrd/initrd.img.zst 11 | cd $localpath/initrd 12 | zstd -d initrd.img.zst 13 | mkdir $localpath/initrd/initrd 14 | cd $localpath/initrd/initrd 15 | echo "uncpio $inits" 16 | cpio -idm <../initrd.img 17 | echo "copy local init" 18 | cp $localpath/init $localpath/initrd/initrd 19 | cp $isopath/.cd-info ./ 20 | cp $isopath/.pve-cd-id.txt ./ 21 | mkdir proc sys tmp mnt -p 22 | mkdir mnt/.base mnt/.installer-mp mnt/.installer mnt/.workdir -p 23 | echo "cpio $inits" 24 | find . | cpio -o -H newc | gzip > $initpath 25 | rm $localpath/initrd/* -rf 26 | echo "$inits done" 27 | done 28 | rm -rf $localpath/initrd 29 | echo "all done" 30 | -------------------------------------------------------------------------------- /Patch/proxmox-mini-journalreader/add-aarch64-support.patch: -------------------------------------------------------------------------------- 1 | diff -ur a/src/mini-journalreader.c b/src/mini-journalreader.c 2 | --- a/src/mini-journalreader.c 2022-10-09 14:07:17.107884890 +0000 3 | +++ b/src/mini-journalreader.c 2023-01-03 08:08:29.275105219 +0000 4 | @@ -169,7 +169,8 @@ 5 | if (json) { 6 | char tmp[7]; 7 | for (size_t i = 0; i < l;i++) { 8 | - if (d[i] == '"' || d[i] == '\\' || (d[i] >= 0 && d[i] <= 0x1F)) { 9 | + int x = (int)d[i]; 10 | + if (d[i] == '"' || d[i] == '\\' || (x >= 0 && x <= 0x1F)) { 11 | sprintf(tmp, "\\u%04X", d[i]); 12 | print_to_buf(tmp, 6); 13 | } else { 14 | @@ -256,11 +257,11 @@ 15 | const char *endcursor = NULL; 16 | uint64_t begin = 0; 17 | uint64_t end = 0; 18 | - char c; 19 | + int c; 20 | 21 | progname = argv[0]; 22 | 23 | - while ((c = (char)getopt (argc, argv, "b:e:d:n:f:t:jh")) != -1) { 24 | +while ((c = getopt (argc, argv, "b:e:d:n:f:t:jh")) != -1) { 25 | switch (c) { 26 | case 'b': 27 | begin = arg_to_uint64(optarg); -------------------------------------------------------------------------------- /README-zh.md: -------------------------------------------------------------------------------- 1 | # Proxmox-Arm 2 | 3 | [Englist](README.md) | [中文](README-zh.md) 4 | 5 | ## 获取有限的支持 6 | 7 | mail: jiangcuo@bingsin.com 8 | 9 | issue: https://github.com/jiangcuo/Proxmox-Arm64/issues 10 | 11 | qq群组:750937440 12 | 13 | ## 1. 测试的平台 (arm64): 14 | - Rockpi 15 | - Raspberry Pi 16 | - Amlogic TV box 17 | - Kunpeng 18 | - FT 由于该产品的系列有点多,最好先安装debian再安装proxmox ve 19 | - Ampere 20 | 21 | ## 2. features 22 | 23 | - ramfb support. 24 | - add more pice on vm,so we can hotplug and use more nets disks.(not perfect) 25 | - set gic-version=host. 26 | - tpm 27 | 28 | ## 3. version 29 | 30 | ### pve 31 | - public version = 7.4-2 32 | - testing version = 7.4-2 33 | 34 | ### pbs 35 | - public version = 2.4.1-1 36 | - testing version = 2.4.1-1 37 | 38 | ## 4. Installtion 39 | 40 | 如果使用带efi的设备,可以使用ISO安装 41 | 42 | https://mirrors.apqa.cn/proxmox/isos/ 43 | 44 | 如果使用u-boot启动的设备,请先安装好debian或者armbian再安装proxmox ve 45 | 46 | 这部分请参考wifi 47 | 48 | ## 直通 49 | 目前已经过测试,可以直通io卡,显卡有问题。 50 | 51 | ![ ](https://raw.githubusercontent.com/jiangcuo/Proxmox-Arm64/main/images/pasthrough.png) 52 | 53 | ## 了解更多 ? 54 | 55 | 请参考wiki页面 56 | 57 | https://github.com/jiangcuo/Proxmox-Arm64/wiki 58 | -------------------------------------------------------------------------------- /repacked.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | repacked_path="/repacked" 3 | mirror_path="/var/spool/apt-mirror/mirror/download.proxmox.com/debian/devel/dists/bullseye/main/binary-amd64/" 4 | #newpkg 5 | ls $mirror_path |grep librust>/tmp/newpkg 6 | #oldpkg 7 | ls $repacked_path >/tmp/oldpkg 8 | #oldpkg-arm64.deb to amd64.deb 9 | sed -i "s/arm64/amd64/g" /tmp/oldpkg 10 | #diff 11 | diff -u /tmp/oldpkg /tmp/newpkg |grep +librust|sed "s/^.//g" > /tmp/needpkg 12 | echo "$(date "+%Y/%m/%d %H:%M:%S") Needpkgs:" 13 | if test -s /tmp/needpkg 14 | then 15 | cat /tmp/needpkg 16 | else 17 | echo "all pkg is up date" 18 | exit 0 19 | fi 20 | 21 | for packlist in `cat /tmp/needpkg`;do 22 | extract_path="/librust/$packlist/extract" 23 | mkdir $extract_path/DEBIAN -p 24 | dpkg -X $mirror_path$packlist $extract_path > /dev/null 25 | dpkg -e $mirror_path$packlist $extract_path/DEBIAN > /dev/null 26 | sed -i "s/amd64/arm64/g" $extract_path/DEBIAN/control > /dev/null 27 | dpkg-deb -Zxz -b $extract_path $repacked_path > /dev/null 28 | echo "$(date "+%Y/%m/%d %H:%M:%S") repacked $packlist done" >>/var/log/repacked.log 29 | done 30 | echo "$(date "+%Y/%m/%d %H:%M:%S") all package repacked done" 31 | echo "$(date "+%Y/%m/%d %H:%M:%S") all package repacked done" >>/var/log/repacked.log 32 | -------------------------------------------------------------------------------- /Patch/qemu-server/0006-add-secboot.patch: -------------------------------------------------------------------------------- 1 | diff -x .git -ur a/PVE/QemuServer.pm b/PVE/QemuServer.pm 2 | --- a/PVE/QemuServer.pm 2023-06-06 13:53:11.469993571 +0000 3 | +++ b/PVE/QemuServer.pm 2023-06-06 13:52:29.537733197 +0000 4 | @@ -89,6 +89,22 @@ 5 | ], 6 | }, 7 | aarch64 => { 8 | + '4m-no-smm' => [ 9 | + "$EDK2_FW_BASE/AAVMF_CODE.fd", 10 | + "$EDK2_FW_BASE/AAVMF_VARS.fd", 11 | + ], 12 | + '4m-no-smm-ms' => [ 13 | + "$EDK2_FW_BASE/AAVMF_CODE.ms.fd", 14 | + "$EDK2_FW_BASE/AAVMF_VARS.ms.fd", 15 | + ], 16 | + '4m' => [ 17 | + "$EDK2_FW_BASE/AAVMF_CODE.fd", 18 | + "$EDK2_FW_BASE/AAVMF_VARS.fd", 19 | + ], 20 | + '4m-ms' => [ 21 | + "$EDK2_FW_BASE/AAVMF_CODE.ms.fd", 22 | + "$EDK2_FW_BASE/AAVMF_VARS.ms.fd", 23 | + ], 24 | default => [ 25 | "$EDK2_FW_BASE/AAVMF_CODE.fd", 26 | "$EDK2_FW_BASE/AAVMF_VARS.fd", 27 | @@ -3398,7 +3414,7 @@ 28 | or die "no OVMF images known for architecture '$arch'\n"; 29 | 30 | my $type = 'default'; 31 | - if ($arch ne "aarch64" && defined($efidisk->{efitype}) && $efidisk->{efitype} eq '4m') { 32 | + if (defined($efidisk->{efitype}) && $efidisk->{efitype} eq '4m') { 33 | $type = $smm ? "4m" : "4m-no-smm"; 34 | $type .= '-ms' if $efidisk->{'pre-enrolled-keys'}; 35 | } 36 | Only in qemu-server2/qemu-server/: ramfb.support 37 | -------------------------------------------------------------------------------- /iso/tools/update-suqahsfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #isopath="" 3 | isopath=$1 4 | 5 | #update pve-base.sqaushfs 6 | echo "unzip pve-bash" 7 | unsquashfs $isopath/pve-base.sqaushfs 8 | echo "update pkg list" 9 | chroot squashfs-root/ apt update 10 | echo "upgrade dist" 11 | LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot squashfs-root/ apt dist-upgrade -y 12 | chroot squashfs-root/ apt clean 13 | echo "clean" 14 | rm $isopath/pve-base.sqaushfs 15 | echo "mk pve-base.sqaushfs" 16 | mksquashfs squashfs-root/ $isopath/pve-base.sqaushfs 17 | mv squashfs-root pve-base 18 | #update pve-installet.squashfs 19 | 20 | echo "unzip pve-installer" 21 | unsquashfs $isopath/pve-installer.squashfs 22 | mv squashfs-root pve-installer 23 | mkdir workdir .workdir 24 | mount -t overlay -o lowerdir=pve-base,upperdir=pve-installer,workdir=.workdir overlay workdir 25 | echo "update pkg list" 26 | chroot workdir apt update 27 | chroot workdir apt install curl gunpg2 -y 28 | 29 | echo "add mirrors" 30 | echo "deb https://mirrors.apqa.cn/proxmox/ pvearm main"> workdir/etc/apt/sources.list.d/foxi.list 31 | chroot workdir curl -L -O https://mirrors.apqa.cn/proxmox/gpg.key 32 | chroot workdir apt-key add gpg.key 33 | echo "update pkg list" 34 | chroot workdir apt update 35 | echo "upgrade dist" 36 | LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot workdir apt dist-upgrade -y 37 | umount workdir 38 | rm $isopath/pve-installer.squashfs 39 | mksquashfs pve-installer $isopath/pve-installer.squashfs 40 | 41 | -------------------------------------------------------------------------------- /Patch/qemu-server/0004-set-usb-qemu_xhci.patch: -------------------------------------------------------------------------------- 1 | diff -x .git -ur a/PVE/QemuServer/USB.pm b/PVE/QemuServer/USB.pm 2 | --- a/PVE/QemuServer/USB.pm 2023-06-06 13:30:40.391616859 +0000 3 | +++ b/PVE/QemuServer/USB.pm 2023-06-06 13:28:43.439549799 +0000 4 | @@ -59,8 +59,8 @@ 5 | my $is_q35 = PVE::QemuServer::Machine::machine_type_is_q35($conf); 6 | 7 | if ($arch eq 'aarch64') { 8 | - $pciaddr = print_pci_addr('ehci', $bridges, $arch, $machine); 9 | - push @$devices, '-device', "usb-ehci,id=ehci$pciaddr"; 10 | + $pciaddr = print_pci_addr('qemu-xhci', $bridges, $arch, $machine); 11 | + push @$devices, '-device', "qemu-xhci,id=qemu-xhci"; 12 | } elsif (!$is_q35) { 13 | $pciaddr = print_pci_addr("piix3", $bridges, $arch, $machine); 14 | push @$devices, '-device', "piix3-usb-uhci,id=uhci$pciaddr.0x2"; 15 | diff -x .git -ur a/PVE/QemuServer.pm b/PVE/QemuServer.pm 16 | --- a/PVE/QemuServer.pm 2023-06-06 12:57:18.378594124 +0000 17 | +++ b/PVE/QemuServer.pm 2023-06-06 13:29:58.967574871 +0000 18 | @@ -1473,7 +1473,7 @@ 19 | # we use uhci for old VMs because tablet driver was buggy in older qemu 20 | my $usbbus; 21 | if ($q35 || $arch eq 'aarch64') { 22 | - $usbbus = 'ehci'; 23 | + $usbbus = 'qemu-xhci'; 24 | } else { 25 | $usbbus = 'uhci'; 26 | } 27 | @@ -1486,7 +1486,7 @@ 28 | 29 | return if $arch ne 'aarch64'; 30 | 31 | - return "usb-kbd,id=keyboard,bus=ehci.0,port=2"; 32 | + return "usb-kbd,id=keyboard,bus=qemu-xhci.0,port=2"; 33 | } 34 | 35 | my sub get_drive_id { 36 | -------------------------------------------------------------------------------- /Patch/qemu-server/0005-add-ramfb-support.patch: -------------------------------------------------------------------------------- 1 | diff -x .git -ur a/PVE/QemuServer.pm b/PVE/QemuServer.pm 2 | --- a/PVE/QemuServer.pm 2023-06-06 13:46:11.147465479 +0000 3 | +++ b/PVE/QemuServer.pm 2023-06-06 13:46:39.471628665 +0000 4 | @@ -184,7 +184,7 @@ 5 | default => 'std', 6 | optional => 1, 7 | default_key => 1, 8 | - enum => [qw(cirrus qxl qxl2 qxl3 qxl4 none serial0 serial1 serial2 serial3 std virtio virtio-gl vmware)], 9 | + enum => [qw(cirrus qxl qxl2 qxl3 qxl4 none serial0 serial1 serial2 serial3 std virtio virtio-gl vmware ramfb)], 10 | }, 11 | memory => { 12 | description => "Sets the VGA memory (in MiB). Has no effect with serial display.", 13 | @@ -1879,6 +1879,7 @@ 14 | 'vmware' => 'vmware-svga', 15 | 'virtio' => 'virtio-vga', 16 | 'virtio-gl' => 'virtio-vga-gl', 17 | + 'ramfb' => 'ramfb', 18 | }; 19 | 20 | sub print_vga_device { 21 | @@ -3853,9 +3854,12 @@ 22 | push @$cmd, '-no-reboot' if defined($conf->{reboot}) && $conf->{reboot} == 0; 23 | 24 | if ($vga->{type} && $vga->{type} !~ m/^serial\d+$/ && $vga->{type} ne 'none'){ 25 | - push @$devices, '-device', print_vga_device( 26 | - $conf, $vga, $arch, $machine_version, $machine_type, undef, $qxlnum, $bridges); 27 | - 28 | + if ($vga->{type} eq 'ramfb'){ 29 | + push @$devices, '-device', 'ramfb'; 30 | + } else { 31 | + push @$devices, '-device', print_vga_device( 32 | + $conf, $vga, $arch, $machine_version, $machine_type, undef, $qxlnum, $bridges); 33 | + } 34 | push @$cmd, '-display', 'egl-headless,gl=core' if $vga->{type} eq 'virtio-gl'; # VIRGL 35 | 36 | my $socket = PVE::QemuServer::Helpers::vnc_socket($vmid); 37 | -------------------------------------------------------------------------------- /Patch/zfsonlinux/009-zfsonlinux-debs.patch: -------------------------------------------------------------------------------- 1 | diff -Nur -x .git a/Makefile b/Makefile 2 | --- a/Makefile 2023-10-11 12:15:44.042697739 -0400 3 | +++ b/Makefile 2023-10-11 12:16:02.566610583 -0400 4 | @@ -7,23 +7,23 @@ 5 | BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM) 6 | ORIG_SRC_TAR = $(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz 7 | 8 | -ZFS_DEB1= libnvpair3linux_$(DEB_VERSION)_amd64.deb 9 | +ZFS_DEB1= libnvpair3linux_$(DEB_VERSION)_arm64.deb 10 | 11 | ZFS_DEB_BINARY = \ 12 | -libpam-zfs_$(DEB_VERSION)_amd64.deb \ 13 | -libuutil3linux_$(DEB_VERSION)_amd64.deb \ 14 | -libzfs4linux_$(DEB_VERSION)_amd64.deb \ 15 | -libzfsbootenv1linux_$(DEB_VERSION)_amd64.deb \ 16 | -libzpool5linux_$(DEB_VERSION)_amd64.deb \ 17 | -zfs-test_$(DEB_VERSION)_amd64.deb \ 18 | -zfsutils-linux_$(DEB_VERSION)_amd64.deb \ 19 | -zfs-zed_$(DEB_VERSION)_amd64.deb 20 | +libpam-zfs_$(DEB_VERSION)_arm64.deb \ 21 | +libuutil3linux_$(DEB_VERSION)_arm64.deb \ 22 | +libzfs4linux_$(DEB_VERSION)_arm64.deb \ 23 | +libzfsbootenv1linux_$(DEB_VERSION)_arm64.deb \ 24 | +libzpool5linux_$(DEB_VERSION)_arm64.deb \ 25 | +zfs-test_$(DEB_VERSION)_arm64.deb \ 26 | +zfsutils-linux_$(DEB_VERSION)_arm64.deb \ 27 | +zfs-zed_$(DEB_VERSION)_arm64.deb 28 | 29 | -ZFS_DBG_DEBS = $(patsubst %_$(DEB_VERSION)_amd64.deb, %-dbgsym_$(DEB_VERSION)_amd64.deb, $(ZFS_DEB1) $(ZFS_DEB_BINARY)) 30 | +ZFS_DBG_DEBS = $(patsubst %_$(DEB_VERSION)_arm64.deb, %-dbgsym_$(DEB_VERSION)_arm64.deb, $(ZFS_DEB1) $(ZFS_DEB_BINARY)) 31 | 32 | ZFS_DEB2= $(ZFS_DEB_BINARY) \ 33 | -libzfslinux-dev_$(DEB_VERSION)_amd64.deb \ 34 | -python3-pyzfs_$(DEB_VERSION)_amd64.deb \ 35 | +libzfslinux-dev_$(DEB_VERSION)_arm64.deb \ 36 | +python3-pyzfs_$(DEB_VERSION)_arm64.deb \ 37 | pyzfs-doc_$(DEB_VERSION)_all.deb \ 38 | spl_$(DEB_VERSION)_all.deb \ 39 | zfs-initramfs_$(DEB_VERSION)_all.deb 40 | -------------------------------------------------------------------------------- /Patch/pve-qemu/008pve-qemu-default-is-aarch.patch: -------------------------------------------------------------------------------- 1 | diff -Nru10 -x .git a/debian/pve-qemu-kvm.links b/debian/pve-qemu-kvm.links 2 | --- a/debian/pve-qemu-kvm.links 2023-09-01 20:59:39.259597729 +0800 3 | +++ b/debian/pve-qemu-kvm.links 2023-09-01 22:35:29.580930034 +0800 4 | @@ -1,13 +1,13 @@ 5 | # also use aarch64 for 32 bit arm 6 | usr/bin/qemu-system-aarch64 usr/bin/qemu-system-arm 7 | -usr/bin/qemu-system-x86_64 usr/bin/kvm 8 | +usr/bin/qemu-system-aarch64 usr/bin/kvm 9 | # qemu-system-i386 and qemu-system-x86_64 provides the same hardware emulation 10 | usr/bin/qemu-system-x86_64 usr/bin/qemu-system-i386 11 | # upstream provides a qemu man page, 12 | # we symlink to kvm for backward compatibility 13 | # and to qemu-system-{i386,x86_64} to fullfill our 'Provides: qemu-system-x86' 14 | usr/share/man/man1/qemu.1 usr/share/man/man1/kvm.1 15 | usr/share/man/man1/qemu.1 usr/share/man/man1/qemu-system-aarch64.1 16 | usr/share/man/man1/qemu.1 usr/share/man/man1/qemu-system-arm.1 17 | usr/share/man/man1/qemu.1 usr/share/man/man1/qemu-system-i386.1 18 | usr/share/man/man1/qemu.1 usr/share/man/man1/qemu-system-x86_64.1 19 | diff -Nru10 -x .git a/debian/rules b/debian/rules 20 | --- a/debian/rules 2023-09-01 20:59:39.259597729 +0800 21 | +++ b/debian/rules 2023-09-01 22:35:43.537024569 +0800 22 | @@ -36,21 +36,20 @@ 23 | cp -f /usr/share/misc/config.guess config.guess 24 | endif 25 | 26 | # guest-agent is only required for guest systems 27 | ./configure \ 28 | --with-git-submodules=ignore \ 29 | --docdir=/usr/share/doc/pve-qemu-kvm \ 30 | --localstatedir=/var \ 31 | --prefix=/usr \ 32 | --sysconfdir=/etc \ 33 | - --target-list=$(HOST_CPU)-softmmu,aarch64-softmmu \ 34 | --with-suffix="kvm" \ 35 | --with-pkgversion="${DEB_SOURCE}_${DEB_VERSION_UPSTREAM_REVISION}" \ 36 | --audio-drv-list="alsa" \ 37 | --datadir=/usr/share \ 38 | --libexecdir=/usr/lib/kvm \ 39 | --disable-capstone \ 40 | --disable-gtk \ 41 | --disable-guest-agent \ 42 | --disable-guest-agent-msi \ 43 | --disable-libnfs \ 44 | -------------------------------------------------------------------------------- /Patch/pve-lxc-syscalld/add-aarch64-support.patch: -------------------------------------------------------------------------------- 1 | diff -ur -x .git a/src/macros.rs b/src/macros.rs 2 | --- a/src/macros.rs 2022-09-11 12:51:22.984264183 +0000 3 | +++ b/src/macros.rs 2022-09-11 12:52:58.512311468 +0000 4 | @@ -1,7 +1,6 @@ 5 | // c_str!() from the byte-strings crate is implemented via a proc macro which seems a bit excessive 6 | macro_rules! c_str { 7 | ($data:expr) => {{ 8 | - #![allow(unused_unsafe)] 9 | let bytes = concat!($data, "\0"); 10 | unsafe { std::ffi::CStr::from_bytes_with_nul_unchecked(bytes.as_bytes()) } 11 | }}; 12 | diff -ur -x .git a/src/sys_quotactl.rs b/src/sys_quotactl.rs 13 | --- a/src/sys_quotactl.rs 2022-09-11 12:51:22.984264183 +0000 14 | +++ b/src/sys_quotactl.rs 2022-09-11 12:52:34.832293930 +0000 15 | @@ -113,7 +113,7 @@ 16 | let mut data: dqinfo = unsafe { mem::zeroed() }; 17 | let special = special.as_ref().map(|c| c.as_ptr()).unwrap_or(ptr::null()); 18 | sc_libc_try!(unsafe { 19 | - libc::quotactl(cmd, special, id, &mut data as *mut dqinfo as *mut i8) 20 | + libc::quotactl(cmd, special, id, &mut data as *mut dqinfo as *mut libc::c_char) 21 | }); 22 | 23 | msg.mem_write_struct(addr, &data)?; 24 | @@ -143,7 +143,7 @@ 25 | cmd, 26 | special.as_ptr(), 27 | id, 28 | - &mut data as *mut dqinfo as *mut i8, 29 | + &mut data as *mut dqinfo as *mut libc::c_char, 30 | ) 31 | }); 32 | 33 | @@ -166,7 +166,7 @@ 34 | 35 | let mut data: u32 = 0; 36 | let special = special.as_ref().map(|c| c.as_ptr()).unwrap_or(ptr::null()); 37 | - sc_libc_try!(unsafe { libc::quotactl(cmd, special, id, &mut data as *mut u32 as *mut i8) }); 38 | + sc_libc_try!(unsafe { libc::quotactl(cmd, special, id, &mut data as *mut u32 as *mut libc::c_char) }); 39 | 40 | msg.mem_write_struct(addr, &data)?; 41 | Ok(SyscallStatus::Ok(0)) 42 | @@ -257,7 +257,7 @@ 43 | cmd, 44 | special.as_ptr(), 45 | id, 46 | - &mut data as *mut libc::dqblk as *mut i8, 47 | + &mut data as *mut libc::dqblk as *mut libc::c_char, 48 | ) 49 | }); 50 | 51 | @@ -290,7 +290,7 @@ 52 | cmd, 53 | special.as_ptr(), 54 | id, 55 | - &mut data as *mut libc::dqblk as *mut i8, 56 | + &mut data as *mut libc::dqblk as *mut libc::c_char, 57 | ) 58 | }); 59 | 60 | @@ -323,7 +323,7 @@ 61 | cmd, 62 | special.as_ptr(), 63 | id, 64 | - &mut data as *mut nextdqblk as *mut i8, 65 | + &mut data as *mut nextdqblk as *mut libc::c_char, 66 | ) 67 | }); 68 | -------------------------------------------------------------------------------- /Patch/proxmox-backup-restore-image/003proxmox-backup-restore-image-add-aarch64.patch: -------------------------------------------------------------------------------- 1 | diff -u1 -r -x rej pve-src/proxmox-backup-restore-image/debian/control pve-maker/proxmox-backup-restore-image/debian/control 2 | --- pve-src/proxmox-backup-restore-image/debian/control 2022-10-10 03:21:00.475765775 +0000 3 | +++ pve-maker/proxmox-backup-restore-image/debian/control 2022-10-10 07:39:09.341330888 +0000 4 | @@ -31,3 +31,3 @@ 5 | Package: proxmox-backup-restore-image 6 | -Architecture: amd64 7 | +Architecture: arm64 8 | Recommends: proxmox-backup-file-restore 9 | @@ -39,3 +39,3 @@ 10 | Package: proxmox-backup-restore-image-debug 11 | -Architecture: amd64 12 | +Architecture: arm64 13 | Depends: proxmox-backup-restore-image 14 | diff -u1 -r -x rej pve-src/proxmox-backup-restore-image/debian/install pve-maker/proxmox-backup-restore-image/debian/install 15 | --- pve-src/proxmox-backup-restore-image/debian/install 2022-10-10 03:21:00.475765775 +0000 16 | +++ pve-maker/proxmox-backup-restore-image/debian/install 2022-10-10 07:39:09.341330888 +0000 17 | @@ -1,2 +1,2 @@ 18 | -build/bzImage /usr/lib/x86_64-linux-gnu/proxmox-backup/file-restore/ 19 | -build/initramfs/initramfs.img /usr/lib/x86_64-linux-gnu/proxmox-backup/file-restore/ 20 | +build/Image /usr/lib/aarch64-linux-gnu/proxmox-backup/file-restore/ 21 | +build/initramfs/initramfs.img /usr/lib/aarch64-linux-gnu/proxmox-backup/file-restore/ 22 | diff -u1 -r -x rej pve-src/proxmox-backup-restore-image/debian/proxmox-backup-restore-image-debug.install pve-maker/proxmox-backup-restore-image/debian/proxmox-backup-restore-image-debug.install 23 | --- pve-src/proxmox-backup-restore-image/debian/proxmox-backup-restore-image-debug.install 2022-10-10 03:21:00.475765775 +0000 24 | +++ pve-maker/proxmox-backup-restore-image/debian/proxmox-backup-restore-image-debug.install 2022-10-10 07:39:09.341330888 +0000 25 | @@ -1 +1 @@ 26 | -build/initramfs/initramfs-debug.img /usr/lib/x86_64-linux-gnu/proxmox-backup/file-restore/ 27 | +build/initramfs/initramfs-debug.img /usr/lib/aarch64-linux-gnu/proxmox-backup/file-restore/ 28 | diff -u1 -r -x rej pve-src/proxmox-backup-restore-image/src/Makefile pve-maker/proxmox-backup-restore-image/src/Makefile 29 | --- pve-src/proxmox-backup-restore-image/src/Makefile 2022-10-10 03:21:00.475765775 +0000 30 | +++ pve-maker/proxmox-backup-restore-image/src/Makefile 2022-10-10 07:40:44.641530855 +0000 31 | @@ -9,3 +9,3 @@ 32 | 33 | -KERNEL_IMG=${BUILDDIR}/bzImage 34 | +KERNEL_IMG=${BUILDDIR}/Image 35 | INITRAMFS_IMG=${INITRAMFS_BUILDDIR}/initramfs.img 36 | @@ -57,3 +57,3 @@ 37 | cd ${BUILDDIR}/${KERNEL_SUBMODULE}; $(MAKE) 38 | - mv ${BUILDDIR}/${KERNEL_SUBMODULE}/arch/x86/boot/bzImage ${KERNEL_IMG} 39 | + mv ${BUILDDIR}/${KERNEL_SUBMODULE}/arch/arm64/boot/Image ${KERNEL_IMG} 40 | 41 | @@ -83,3 +83,3 @@ 42 | # kernel/init-shim-rs builds 43 | - qemu-system-x86_64 -serial stdio -vnc none -enable-kvm \ 44 | + qemu-system-aarch64 -serial stdio -vnc none -enable-kvm \ 45 | -kernel ${KERNEL_IMG} \ 46 | diff -u1 -r -x rej pve-src/proxmox-backup-restore-image/src/build_initramfs.sh pve-maker/proxmox-backup-restore-image/src/build_initramfs.sh 47 | --- pve-src/proxmox-backup-restore-image/src/build_initramfs.sh 2022-10-10 03:21:00.475765775 +0000 48 | +++ pve-maker/proxmox-backup-restore-image/src/build_initramfs.sh 2022-10-10 07:39:09.341330888 +0000 49 | @@ -47,14 +47,14 @@ 50 | add_pkgs " 51 | - libstdc++6:amd64 \ 52 | - libssl1.1:amd64 \ 53 | - libacl1:amd64 \ 54 | - libblkid1:amd64 \ 55 | - libuuid1:amd64 \ 56 | - zlib1g:amd64 \ 57 | - libzstd1:amd64 \ 58 | - liblz4-1:amd64 \ 59 | - liblzma5:amd64 \ 60 | - libgcrypt20:amd64 \ 61 | - lvm2:amd64 \ 62 | - thin-provisioning-tools:amd64 \ 63 | + libstdc++6:arm64 \ 64 | + libssl1.1:arm64 \ 65 | + libacl1:arm64 \ 66 | + libblkid1:arm64 \ 67 | + libuuid1:arm64 \ 68 | + zlib1g:arm64 \ 69 | + libzstd1:arm64 \ 70 | + liblz4-1:arm64 \ 71 | + liblzma5:arm64 \ 72 | + libgcrypt20:arm64 \ 73 | + lvm2:arm64 \ 74 | + thin-provisioning-tools:arm64 \ 75 | " 76 | @@ -77,6 +77,6 @@ 77 | add_pkgs " 78 | - util-linux:amd64 \ 79 | - busybox-static:amd64 \ 80 | - gdb:amd64 \ 81 | - strace:amd64 \ 82 | + util-linux:arm64 \ 83 | + busybox-static:arm64 \ 84 | + gdb:arm64 \ 85 | + strace:arm64 \ 86 | " 87 | -------------------------------------------------------------------------------- /Patch/pve-manager/001add-ramfb-pvearm_source-cpu_to_host.patch: -------------------------------------------------------------------------------- 1 | diff -Nur -x .git pve-manager/Makefile pve-manager2/Makefile 2 | --- pve-manager/Makefile 2023-06-07 08:33:43.742420344 +0000 3 | +++ pve-manager2/Makefile 2023-06-07 08:02:16.668323297 +0000 4 | @@ -20,11 +20,6 @@ 5 | all: $(SUBDIRS) 6 | set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i; done 7 | 8 | -.PHONY: check 9 | -check: bin test www 10 | - $(MAKE) -C bin check 11 | - $(MAKE) -C test check 12 | - $(MAKE) -C www check 13 | 14 | .PHONY: dinstall 15 | dinstall: $(DEB) 16 | diff -Nur -x .git pve-manager/configs/Makefile pve-manager2/configs/Makefile 17 | --- pve-manager/configs/Makefile 2023-06-07 08:34:02.234582283 +0000 18 | +++ pve-manager2/configs/Makefile 2023-06-07 07:53:43.397027481 +0000 19 | @@ -8,7 +8,7 @@ 20 | .PHONY: install 21 | install: country.dat vzdump.conf pve-sources.list pve-initramfs.conf pve-blacklist.conf pve.logrotate 22 | install -D -m 0644 pve.logrotate $(DESTDIR)/etc/logrotate.d/pve 23 | - install -D -m 0644 pve-sources.list $(DESTDIR)/etc/apt/sources.list.d/pve-enterprise.list 24 | + install -D -m 0644 pve-sources.list ${DESTDIR}/etc/apt/sources.list.d/pveport.list 25 | install -D -m 0644 pve-blacklist.conf $(DESTDIR)/etc/modprobe.d/pve-blacklist.conf 26 | install -D -m 0644 vzdump.conf $(DESTDIR)/etc/vzdump.conf 27 | install -D -m 0644 pve-initramfs.conf $(DESTDIR)/etc/initramfs-tools/conf.d/pve-initramfs.conf 28 | diff -Nur -x .git pve-manager/configs/pve-sources.list pve-manager2/configs/pve-sources.list 29 | --- pve-manager/configs/pve-sources.list 2023-06-07 08:33:47.342451474 +0000 30 | +++ pve-manager2/configs/pve-sources.list 2023-06-07 08:05:32.825598625 +0000 31 | @@ -1 +1 @@ 32 | -deb https://enterprise.proxmox.com/debian/pve bookworm pve-enterprise 33 | +deb https://mirrors.apqa.cn/proxmox/debian/pve bookworm port 34 | diff -Nur -x .git pve-manager/debian/control pve-manager2/debian/control 35 | --- pve-manager/debian/control 2023-06-13 02:18:38.932442362 +0000 36 | +++ pve-manager2/debian/control 2023-06-13 02:19:31.512440466 +0000 37 | @@ -41,7 +41,6 @@ 38 | fonts-font-awesome, 39 | gdisk, 40 | hdparm, 41 | - ifupdown2 (>= 3.0) | ifenslave (>= 2.6), 42 | libapt-pkg-perl, 43 | libcrypt-ssleay-perl, 44 | libfile-readbackwards-perl, 45 | @@ -96,7 +95,7 @@ 46 | ${perl:Depends}, 47 | ${shlibs:Depends} 48 | Recommends: proxmox-offline-mirror-helper 49 | -Suggests: libpve-network-perl (>= 0.5-1) 50 | +Suggests: libpve-network-perl (>= 0.5-1),pve-firmware 51 | Conflicts: vlan, 52 | vzdump, 53 | Replaces: vlan, 54 | diff -Nur -x .git pve-manager/debian/lintian-overrides pve-manager2/debian/lintian-overrides 55 | --- pve-manager/debian/lintian-overrides 2023-06-07 08:34:13.286681179 +0000 56 | +++ pve-manager2/debian/lintian-overrides 2023-06-07 07:54:51.009456553 +0000 57 | @@ -3,5 +3,5 @@ 58 | pve-manager: no-manual-page [usr/bin/pveupdate] 59 | pve-manager: non-standard-dir-perm 0700 != 0755 [var/log/pveproxy/] 60 | pve-manager: systemd-service-file-refers-to-unusual-wantedby-target getty.target [lib/systemd/system/pvebanner.service] 61 | -pve-manager: package-installs-apt-sources [etc/apt/sources.list.d/pve-enterprise.list] 62 | +pve-manager: package-installs-apt-sources [etc/apt/sources.list.d/pveport.list] 63 | pve-manager: privacy-breach-generic usr/share/pve-manager/touch/sencha-touch-all-debug.js * 64 | diff -Nur -x .git pve-manager/www/manager6/Utils.js pve-manager2/www/manager6/Utils.js 65 | --- pve-manager/www/manager6/Utils.js 2023-06-13 02:18:38.940442362 +0000 66 | +++ pve-manager2/www/manager6/Utils.js 2023-06-07 08:01:59.240210281 +0000 67 | @@ -606,6 +606,7 @@ 68 | serial3: gettext('Serial terminal') + ' 3', 69 | virtio: 'VirtIO-GPU', 70 | 'virtio-gl': 'VirGL GPU', 71 | + ramfb: 'ramfb', 72 | none: Proxmox.Utils.noneText, 73 | }, 74 | 75 | diff -Nur -x .git pve-manager/www/manager6/form/CPUModelSelector.js pve-manager2/www/manager6/form/CPUModelSelector.js 76 | --- pve-manager/www/manager6/form/CPUModelSelector.js 2023-06-07 08:33:51.926491404 +0000 77 | +++ pve-manager2/www/manager6/form/CPUModelSelector.js 2023-06-07 08:03:02.028617693 +0000 78 | @@ -15,7 +15,7 @@ 79 | valueField: 'name', 80 | displayField: 'displayname', 81 | 82 | - emptyText: Proxmox.Utils.defaultText + ' (kvm64)', 83 | + emptyText: Proxmox.Utils.defaultText + ' (host)', 84 | allowBlank: true, 85 | 86 | editable: true, 87 | -------------------------------------------------------------------------------- /Patch/proxmox-backup/004proxmox-backup-add-aarch64.patch: -------------------------------------------------------------------------------- 1 | diff -Nru10 -x .git a/proxmox-backup/debian/lintian-overrides b/proxmox-backup/debian/lintian-overrides 2 | --- a/proxmox-backup/debian/lintian-overrides 2023-09-01 21:14:05.613770182 +0800 3 | +++ b/proxmox-backup/debian/lintian-overrides 2023-09-01 21:12:47.353815728 +0800 4 | @@ -1,7 +1,7 @@ 5 | proxmox-backup-server: mail-transport-agent-dependency-does-not-specify-default-mta 6 | proxmox-backup-server: package-installs-apt-sources [etc/apt/sources.list.d/pbs-enterprise.list] 7 | -proxmox-backup-server: elevated-privileges 4755 root/root [usr/lib/x86_64-linux-gnu/proxmox-backup/sg-tape-cmd] 8 | +proxmox-backup-server: elevated-privileges 4755 root/root [usr/lib/aarch64-linux-gnu/proxmox-backup/sg-tape-cmd] 9 | proxmox-backup-server: systemd-service-file-refers-to-unusual-wantedby-target getty.target [lib/systemd/system/proxmox-backup-banner.service] 10 | -proxmox-backup-server: uses-dpkg-database-directly [usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-backup-api] 11 | -proxmox-backup-server: uses-dpkg-database-directly [usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-backup-proxy] 12 | +proxmox-backup-server: uses-dpkg-database-directly [usr/lib/aarch64-linux-gnu/proxmox-backup/proxmox-backup-api] 13 | +proxmox-backup-server: uses-dpkg-database-directly [usr/lib/aarch64-linux-gnu/proxmox-backup/proxmox-backup-proxy] 14 | proxmox-backup-server: uses-dpkg-database-directly [usr/sbin/proxmox-backup-debug] 15 | diff -Nru10 -x .git a/proxmox-backup/debian/proxmox-backup-file-restore.install proxmox-backup/debian/proxmox-backup-file-restore.install 16 | --- a/proxmox-backup/debian/proxmox-backup-file-restore.install 2023-09-01 21:14:12.074115877 +0800 17 | +++ b/proxmox-backup/debian/proxmox-backup-file-restore.install 2023-09-01 21:12:47.357815918 +0800 18 | @@ -1,4 +1,4 @@ 19 | usr/bin/proxmox-file-restore 20 | -usr/lib/x86_64-linux-gnu/proxmox-backup/file-restore/proxmox-restore-daemon 21 | +usr/lib/aarch64-linux-gnu/proxmox-backup/file-restore/proxmox-restore-daemon 22 | usr/share/man/man1/proxmox-file-restore.1 23 | usr/share/zsh/vendor-completions/_proxmox-file-restore 24 | diff -Nru10 -x .git a/proxmox-backup/debian/proxmox-backup-file-restore.postinst b/proxmox-backup/debian/proxmox-backup-file-restore.postinst 25 | --- a/proxmox-backup/debian/proxmox-backup-file-restore.postinst 2023-09-01 21:14:12.078116092 +0800 26 | +++ b/proxmox-backup/debian/proxmox-backup-file-restore.postinst 2023-09-01 21:12:47.357815918 +0800 27 | @@ -1,17 +1,17 @@ 28 | #!/bin/sh 29 | 30 | set -e 31 | 32 | update_initramfs() { 33 | # regenerate initramfs for single file restore VM 34 | - INST_PATH="/usr/lib/x86_64-linux-gnu/proxmox-backup/file-restore" 35 | + INST_PATH="/usr/lib/aarch64-linux-gnu/proxmox-backup/file-restore" 36 | CACHE_PATH="/var/cache/proxmox-backup/file-restore-initramfs.img" 37 | CACHE_PATH_DBG="/var/cache/proxmox-backup/file-restore-initramfs-debug.img" 38 | 39 | # cleanup first, in case proxmox-file-restore was uninstalled since we do 40 | # not want an unuseable image lying around 41 | rm -f "$CACHE_PATH" 42 | 43 | if [ ! -f "$INST_PATH/initramfs.img" ]; then 44 | echo "proxmox-backup-restore-image is not installed correctly, skipping update" >&2 45 | exit 0 46 | diff -Nru10 -x .git a/proxmox-backup/debian/proxmox-backup-server.install b/proxmox-backup/debian/proxmox-backup-server.install 47 | --- a/proxmox-backup/debian/proxmox-backup-server.install 2023-09-01 21:14:46.375993452 +0800 48 | +++ b/proxmox-backup/debian/proxmox-backup-server.install 2023-09-01 21:12:47.357815918 +0800 49 | @@ -1,24 +1,24 @@ 50 | etc/pbs-enterprise.list /etc/apt/sources.list.d/ 51 | etc/proxmox-backup-banner.service /lib/systemd/system/ 52 | etc/proxmox-backup-daily-update.service /lib/systemd/system/ 53 | etc/proxmox-backup-daily-update.timer /lib/systemd/system/ 54 | etc/proxmox-backup-proxy.service /lib/systemd/system/ 55 | etc/proxmox-backup.service /lib/systemd/system/ 56 | usr/bin/pmt 57 | usr/bin/pmtx 58 | usr/bin/proxmox-tape 59 | -usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-backup-api 60 | -usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-backup-banner 61 | -usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-backup-proxy 62 | -usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-daily-update 63 | -usr/lib/x86_64-linux-gnu/proxmox-backup/sg-tape-cmd 64 | +usr/lib/aarch64-linux-gnu/proxmox-backup/proxmox-backup-api 65 | +usr/lib/aarch64-linux-gnu/proxmox-backup/proxmox-backup-banner 66 | +usr/lib/aarch64-linux-gnu/proxmox-backup/proxmox-backup-proxy 67 | +usr/lib/aarch64-linux-gnu/proxmox-backup/proxmox-daily-update 68 | +usr/lib/aarch64-linux-gnu/proxmox-backup/sg-tape-cmd 69 | usr/sbin/pbs2to3 70 | usr/sbin/proxmox-backup-debug 71 | usr/sbin/proxmox-backup-manager 72 | usr/share/javascript/proxmox-backup/css/ext6-pbs.css 73 | usr/share/javascript/proxmox-backup/images 74 | usr/share/javascript/proxmox-backup/index.hbs 75 | usr/share/javascript/proxmox-backup/js/proxmox-backup-gui.js 76 | usr/share/man/man1/pbs2to3.1 77 | usr/share/man/man1/pmt.1 78 | usr/share/man/man1/pmtx.1 79 | -------------------------------------------------------------------------------- /Patch/pve-installer/001pve-installer-add-multi-arch-support.patch: -------------------------------------------------------------------------------- 1 | diff -ur -x .git pve-installer2/proxinstall pve-installer/proxinstall 2 | --- pve-installer2/proxinstall 2023-07-24 08:11:57.840283231 +0000 3 | +++ pve-installer/proxinstall 2023-07-22 02:58:41.581487417 +0000 4 | @@ -1583,12 +1583,12 @@ 5 | "See 'System Requirements' in the $iso_env->{cfg}->{fullname} documentation."); 6 | } 7 | 8 | - if ($iso_env->{product} eq 'pve' && !$run_env->{hvm_supported}) { 9 | - Proxmox::UI::error( 10 | - "No support for hardware-accelerated KVM virtualization detected.\n\n" 11 | - ."Check BIOS settings for Intel VT / AMD-V / SVM." 12 | - ); 13 | - } 14 | +# if ($iso_env->{product} eq 'pve' && !$run_env->{hvm_supported}) { 15 | +# Proxmox::UI::error( 16 | +# "No support for hardware-accelerated KVM virtualization detected.\n\n" 17 | +# ."Check BIOS settings for Intel VT / AMD-V / SVM." 18 | +# ); 19 | +# } 20 | 21 | Proxmox::UI::display_html('license.htm', sub { 22 | my ($raw_html, $iso_env) = @_; 23 | diff -ur -x .git pve-installer2/Proxmox/Install.pm pve-installer/Proxmox/Install.pm 24 | --- pve-installer2/Proxmox/Install.pm 2023-07-24 08:11:57.796282527 +0000 25 | +++ pve-installer/Proxmox/Install.pm 2023-07-24 07:58:04.310873925 +0000 26 | @@ -6,6 +6,7 @@ 27 | use Cwd 'abs_path'; 28 | use Encode; 29 | use POSIX ":sys_wait_h"; 30 | +use POSIX qw(EINTR EEXIST EOPNOTSUPP); 31 | 32 | use Proxmox::Install::ISOEnv; 33 | use Proxmox::Install::RunEnv; 34 | @@ -57,6 +58,13 @@ 35 | $last_display_change = 0; 36 | } 37 | 38 | +my $host_arch; 39 | +sub get_host_arch { 40 | + $host_arch = (POSIX::uname())[4] if !$host_arch; 41 | + return $host_arch; 42 | +} 43 | +my $arch = get_host_arch(); 44 | + 45 | sub display_info { 46 | my $min_display_time = 15; 47 | 48 | @@ -96,6 +104,7 @@ 49 | }, 50 | }; 51 | 52 | + 53 | sub create_filesystem { 54 | my ($dev, $name, $type, $start, $end, $fs, $fe) = @_; 55 | 56 | @@ -558,9 +567,18 @@ 57 | 58 | syscmd("mount -n $espdev -t vfat $targetdir/boot/efi") == 0 || 59 | die "unable to mount $espdev\n"; 60 | - 61 | + my $arch = get_host_arch(); 62 | + my $rc; 63 | eval { 64 | - my $rc = syscmd("chroot $targetdir /usr/sbin/grub-install --target x86_64-efi --no-floppy --bootloader-id='proxmox' $dev"); 65 | + if ($arch eq "aarch64"){ 66 | + my $rc = syscmd("chroot $targetdir /usr/sbin/grub-install --target arm64-efi --no-floppy --bootloader-id='proxmox' $dev"); 67 | + } elsif ($arch eq "loongarch64"){ 68 | + my $rc = syscmd("chroot $targetdir /usr/sbin/grub-install --target loongarch64-efi --no-floppy --bootloader-id='proxmox' $dev"); 69 | + } elsif ($arch eq "riscv64"){ 70 | + my $rc = syscmd("chroot $targetdir /usr/sbin/grub-install --target riscv64-efi --no-floppy --bootloader-id='proxmox' $dev"); 71 | + } else { 72 | + die "unable to install grub on arch $arch\n"; 73 | + } 74 | if ($rc != 0) { 75 | my $run_env = Proxmox::Install::RunEnv::get(); 76 | if ($run_env->{boot_type} eq 'efi') { 77 | @@ -571,8 +589,19 @@ 78 | } 79 | # also install fallback boot file (OVMF does not boot without) 80 | mkdir("$targetdir/boot/efi/EFI/BOOT"); 81 | - syscmd("cp $targetdir/boot/efi/EFI/proxmox/grubx64.efi $targetdir/boot/efi/EFI/BOOT/BOOTx64.EFI") == 0 || 82 | + syscmd("cp -r $targetdir/boot/efi/EFI/proxmox/* $targetdir/boot/efi/EFI/boot/"); 83 | + if ($arch eq "aarch64"){ 84 | + syscmd("cp $targetdir/boot/efi/EFI/boot/grubaa64.efi $targetdir/boot/efi/EFI/boot/bootaa64.efi ") == 0 || 85 | die "unable to copy efi boot loader\n"; 86 | + } elsif ($arch eq "loongarch64") { 87 | + syscmd("cp $targetdir/boot/efi/EFI/boot/grubloongarch64.efi $targetdir/boot/efi/EFI/boot/bootloongarch64.efi") == 0 || 88 | + die "unable to copy efi boot loader\n"; 89 | + } elsif ($arch eq "riscv64") { 90 | + syscmd("cp $targetdir/boot/efi/EFI/boot/grubriscv64.efi $targetdir/boot/efi/EFI/boot/bootriscv64.efi") == 0 || 91 | + die "unable to copy efi boot loader\n"; 92 | + } else { 93 | + die "unable to opy efi boot loader on arch $arch\n"; 94 | + } 95 | }; 96 | my $err = $@; 97 | 98 | @@ -1142,14 +1171,6 @@ 99 | diversion_remove($targetdir, "/usr/sbin/update-grub"); 100 | diversion_remove($targetdir, "/usr/sbin/update-initramfs"); 101 | 102 | - my $kapi; 103 | - foreach my $fn (<$targetdir/lib/modules/*>) { 104 | - if ($fn =~ m!/(\d+\.\d+\.\d+-\d+-pve)$!) { 105 | - die "found multiple kernels\n" if defined($kapi); 106 | - $kapi = $1; 107 | - } 108 | - } 109 | - die "unable to detect kernel version\n" if !defined($kapi); 110 | 111 | if (!is_test_mode()) { 112 | 113 | @@ -1159,7 +1180,7 @@ 114 | 115 | my $bootloader_err_list = []; 116 | eval { 117 | - syscmd("chroot $targetdir /usr/sbin/update-initramfs -c -k $kapi") == 0 || 118 | + syscmd("chroot $targetdir /usr/sbin/update-initramfs -c -k all") == 0 || 119 | die "unable to install initramfs\n"; 120 | 121 | my $native_4k_disk_bootable = 0; 122 | @@ -1174,8 +1195,8 @@ 123 | } else { 124 | if (!$native_4k_disk_bootable) { 125 | eval { 126 | - syscmd("chroot $targetdir /usr/sbin/grub-install --target i386-pc --no-floppy --bootloader-id='proxmox' $dev") == 0 || 127 | - die "unable to install the i386-pc boot loader on '$dev'\n"; 128 | +# syscmd("chroot $targetdir /usr/sbin/grub-install --target i386-pc --no-floppy --bootloader-id='proxmox' $dev") == 0 || 129 | + print ("not need install the i386-pc boot loader on '$dev'\n"); 130 | }; 131 | push @$bootloader_err_list, $@ if $@; 132 | } 133 | -------------------------------------------------------------------------------- /Patch/proxmox-backup-qemu/002proxmox-backup-qemu-add-makefile.patch: -------------------------------------------------------------------------------- 1 | diff -ur -x .git a/proxmox-backup-qemu/Cargo.toml b/proxmox-backup-qemu/Cargo.toml 2 | --- a/proxmox-backup-qemu/Cargo.toml 2022-09-12 00:52:28.477933067 -0400 3 | +++ b/proxmox-backup-qemu/Cargo.toml 2022-09-12 00:51:40.433801344 -0400 4 | @@ -34,13 +34,36 @@ 5 | proxmox-schema = { version = "1", features = [ "api-macro" ] } 6 | proxmox-sys = { version = "0.2", features = [ "sortable-macro"] } 7 | 8 | -pbs-api-types = { git = "git://git.proxmox.com/git/proxmox-backup.git", rev = "bc21ade293fa7af096ad21fce54fda1e9814993c" } 9 | -pbs-tools = { git = "git://git.proxmox.com/git/proxmox-backup.git", rev = "bc21ade293fa7af096ad21fce54fda1e9814993c" } 10 | -pbs-config = { git = "git://git.proxmox.com/git/proxmox-backup.git", rev = "bc21ade293fa7af096ad21fce54fda1e9814993c" } 11 | -pbs-datastore = { git = "git://git.proxmox.com/git/proxmox-backup.git", rev = "bc21ade293fa7af096ad21fce54fda1e9814993c" } 12 | -pbs-client = { git = "git://git.proxmox.com/git/proxmox-backup.git", rev = "bc21ade293fa7af096ad21fce54fda1e9814993c" } 13 | +pbs-api-types = "0.1.0" 14 | +pbs-tools = "0.1.0" 15 | +pbs-config = "0.1.0" 16 | +pbs-datastore = "0.1.0" 17 | +pbs-client = "0.1.0" 18 | 19 | serde_json = "1.0" 20 | tokio = { version = "1.6", features = [ "fs", "io-util", "macros", "net", "rt-multi-thread", "signal", "time" ] } 21 | tokio-stream = "0.1.1" 22 | bincode = "1.0" 23 | + 24 | +[patch.crates-io] 25 | +proxmox-async = { path = "../proxmox/proxmox-async" } 26 | +proxmox-lang = { path = "../proxmox/proxmox-lang" } 27 | +proxmox-schema = { path = "../proxmox/proxmox-schema" } 28 | +proxmox-sys = { path = "../proxmox/proxmox-sys" } 29 | +proxmox-serde = { path = "../proxmox/proxmox-serde" } 30 | +proxmox-time = { path = "../proxmox/proxmox-time" } 31 | +proxmox-uuid = { path = "../proxmox/proxmox-uuid" } 32 | +proxmox-compression = { path = "../proxmox/proxmox-compression" } 33 | +proxmox-fuse = { path = "../proxmox-fuse" } 34 | +proxmox-http = { path = "../proxmox/proxmox-http" } 35 | +proxmox-io = { path = "../proxmox/proxmox-io" } 36 | +proxmox-router = { path = "../proxmox/proxmox-router" } 37 | +pxar = { path = "../pxar" } 38 | +proxmox-section-config = { path = "../proxmox/proxmox-section-config" } 39 | +proxmox-shared-memory = { path = "../proxmox/proxmox-shared-memory" } 40 | +proxmox-borrow = { path = "../proxmox/proxmox-borrow" } 41 | +pbs-api-types= { path = "../proxmox-backup/pbs-api-types" } 42 | +pbs-tools= { path = "../proxmox-backup/pbs-tools" } 43 | +pbs-config= { path = "../proxmox-backup/pbs-config" } 44 | +pbs-datastore= { path = "../proxmox-backup/pbs-datastore" } 45 | +pbs-client= { path = "../proxmox-backup/pbs-client" } 46 | diff -ur -x .git a/proxmox-backup-qemu/debian/control b/proxmox-backup-qemu/debian/control 47 | --- a/proxmox-backup-qemu/debian/control 2022-09-12 00:52:28.477933067 -0400 48 | +++ b/proxmox-backup-qemu/debian/control 2022-09-12 00:51:40.433801344 -0400 49 | @@ -4,83 +4,6 @@ 50 | Maintainer: Proxmox Support Team 51 | Build-Depends: cbindgen, 52 | debhelper (>= 12), 53 | - librust-anyhow-1+default-dev, 54 | - librust-base64-0.13+default-dev, 55 | - librust-bincode-1+default-dev, 56 | - librust-bitflags-1+default-dev (>= 1.2.1-~~), 57 | - librust-bytes-1+default-dev, 58 | - librust-crc32fast-1+default-dev, 59 | - librust-endian-trait-0.6+arrays-dev, 60 | - librust-endian-trait-0.6+default-dev, 61 | - librust-flate2-1+default-dev, 62 | - librust-foreign-types-0.3+default-dev, 63 | - librust-futures-0.3+default-dev, 64 | - librust-h2-0.3+default-dev, 65 | - librust-h2-0.3+stream-dev, 66 | - librust-hex-0.4+default-dev (>= 0.4.3-~~), 67 | - librust-hex-0.4+serde-dev (>= 0.4.3-~~), 68 | - librust-http-0.2+default-dev, 69 | - librust-hyper-0.14+default-dev, 70 | - librust-hyper-0.14+full-dev, 71 | - librust-lazy-static-1+default-dev (>= 1.4-~~), 72 | - librust-libc-0.2+default-dev, 73 | - librust-log-0.4+default-dev, 74 | - librust-nix-0.19+default-dev (>= 0.19.1-~~), 75 | - librust-nom-5+default-dev (>= 5.1-~~), 76 | - librust-once-cell-1+default-dev (>= 1.5-~~), 77 | - librust-openssl-0.10+default-dev, 78 | - librust-pathpatterns-0.1+default-dev (>= 0.1.2-~~), 79 | - librust-percent-encoding-2+default-dev (>= 2.1-~~), 80 | - librust-pin-project-lite-0.2+default-dev, 81 | - librust-proxmox-async-0.4+default-dev, 82 | - librust-proxmox-borrow-1+default-dev, 83 | - librust-proxmox-compression-0.1+default-dev (>= 0.1.1-~~), 84 | - librust-proxmox-fuse-0.1+default-dev (>= 0.1.1-~~), 85 | - librust-proxmox-http-0.6+client-dev, 86 | - librust-proxmox-http-0.6+default-dev, 87 | - librust-proxmox-http-0.6+http-helpers-dev, 88 | - librust-proxmox-http-0.6+websocket-dev, 89 | - librust-proxmox-io-1+default-dev (>= 1.0.1-~~), 90 | - librust-proxmox-io-1+tokio-dev (>= 1.0.1-~~), 91 | - librust-proxmox-lang-1+default-dev (>= 1.1-~~), 92 | - librust-proxmox-router-1+cli-dev (>= 1.2-~~), 93 | - librust-proxmox-router-1+default-dev (>= 1.2-~~), 94 | - librust-proxmox-schema-1+api-macro-dev (>= 1.3.1-~~), 95 | - librust-proxmox-schema-1+default-dev (>= 1.3.1-~~), 96 | - librust-proxmox-section-config-1+default-dev, 97 | - librust-proxmox-serde-0.1+default-dev, 98 | - librust-proxmox-shared-memory-0.2+default-dev, 99 | - librust-proxmox-sys-0.2+default-dev, 100 | - librust-proxmox-sys-0.2+sortable-macro-dev, 101 | - librust-proxmox-time-1+default-dev (>= 1.1.1-~~), 102 | - librust-proxmox-uuid-1+default-dev, 103 | - librust-proxmox-uuid-1+serde-dev, 104 | - librust-pxar-0.10+default-dev (>= 0.10.1-~~), 105 | - librust-pxar-0.10+tokio-io-dev (>= 0.10.1-~~), 106 | - librust-regex-1+default-dev (>= 1.5.5-~~), 107 | - librust-rustyline-7+default-dev, 108 | - librust-serde-1+default-dev, 109 | - librust-serde-1+derive-dev, 110 | - librust-serde-json-1+default-dev, 111 | - librust-serde-plain-1+default-dev, 112 | - librust-tar-0.4+default-dev, 113 | - librust-tokio-1+default-dev (>= 1.6-~~), 114 | - librust-tokio-1+fs-dev (>= 1.6-~~), 115 | - librust-tokio-1+io-util-dev (>= 1.6-~~), 116 | - librust-tokio-1+macros-dev (>= 1.6-~~), 117 | - librust-tokio-1+net-dev (>= 1.6-~~), 118 | - librust-tokio-1+rt-dev (>= 1.6-~~), 119 | - librust-tokio-1+rt-multi-thread-dev (>= 1.6-~~), 120 | - librust-tokio-1+signal-dev (>= 1.6-~~), 121 | - librust-tokio-1+sync-dev (>= 1.6-~~), 122 | - librust-tokio-1+time-dev (>= 1.6-~~), 123 | - librust-tokio-stream-0.1+default-dev (>= 0.1.1-~~), 124 | - librust-tower-service-0.3+default-dev, 125 | - librust-url-2+default-dev (>= 2.1-~~), 126 | - librust-walkdir-2+default-dev, 127 | - librust-xdg-2+default-dev (>= 2.2-~~), 128 | - librust-zstd-0.6+bindgen-dev, 129 | - librust-zstd-0.6+default-dev, 130 | Standards-Version: 4.5.1 131 | Homepage: https://www.proxmox.com 132 | -------------------------------------------------------------------------------- /iso/tools/create_pve-base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | arch="arm64" 3 | codename="bookworm" 4 | rootfssrc="/tmp/rootfs" 5 | pve_pkgs='rados|pve|proxmox|extjs|qemu-server|apparmor|criu|spiceterm|vncterm|ceph|rgw|corosync|rbd|libcfg7|libcmap4|libcpg4|ibjs-qrcodejs|libknet1|libnozzle1|quorum|lxcfs|smartmontools' 6 | apt install debootstrap squashfs-tools -y 7 | rm -rf $rootfssrc 8 | mkdir $rootfssrc 9 | debootstrap --arch=$arch $codename $rootfssrc https://mirrors.ustc.edu.cn/debian/ 10 | 11 | cat << EOF > $rootfssrc/etc/apt/sources.list 12 | deb https://mirrors.ustc.edu.cn/debian/ $codename main contrib non-free non-free-firmware 13 | deb https://mirrors.ustc.edu.cn/debian/ $codename-updates main contrib non-free non-free-firmware 14 | deb https://mirrors.ustc.edu.cn/debian/ $codename-backports main contrib non-free non-free-firmware 15 | deb https://mirrors.ustc.edu.cn/debian-security/ $codename-security main contrib non-free non-free-firmware 16 | EOF 17 | 18 | LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot $rootfssrc apt update 19 | LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot $rootfssrc apt install vim pciutils curl wget aria2 net-tools rsync iotop htop tcpdump -y 20 | LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot $rootfssrc apt install -y \ 21 | busybox initramfs-tools initramfs-tools-core klibc-utils libklibc linux-base btrfs-progs tree faketime file fontconfig fontconfig-config fonts-dejavu-core fonts-font-awesome fonts-glyphicons-halflings fuse gdisk genisoimage \ 22 | glib-networking glib-networking-common glib-networking-services glusterfs-client glusterfs-common gnupg gnupg-l10n gnupg-utils gnutls-bin gpg gpg-agent \ 23 | gpg-wks-client gpg-wks-server gpgconf gpgsm groff-base gsettings-desktop-schemas gstreamer1.0-libav gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ 24 | gstreamer1.0-x hdparm ibverbs-providers idn ipset iptables iso-codes javascript-common keyutils libaa1 libaacs0 libaio1 libanyevent-http-perl \ 25 | libanyevent-perl libaom3 libappconfig-perl libapt-pkg-perl libarchive13 libasound2 libasound2-data libass9 libassuan0 libasync-interrupt-perl libasyncns0 \ 26 | libauthen-pam-perl libauthen-sasl-perl libavahi-client3 libavahi-common-data libavahi-common3 libavc1394-0 libavcodec59 libavfilter8 libavformat59 \ 27 | libavutil57 libbabeltrace1 libbdplus0 libbinutils libblas3 libbluray2 libbs2b0 libbytes-random-secure-perl libcaca0 libcairo-gobject2 libcairo2 libcbor0.8 \ 28 | libcrypt-ssleay-perl libctf-nobfd0 libctf0 libcups2 libcurl3-gnutls libdata-dump-perl libdatrie1 libdav1d6 libdbi1 libdconf1 libdeflate0 libdevel-cycle-perl \ 29 | libdevmapper-event1.02.1 libdigest-bubblebabble-perl libdigest-hmac-perl libdouble-conversion3 libdrm-amdgpu1 libdrm-common libdrm-nouveau2 libdrm-radeon1 \ 30 | libdrm2 libdv4 libdw1 libencode-locale-perl libepoxy0 libev-perl libevent-2.1-7 libevent-core-2.1-7 libfaketime libfdt1 libfido2-1 libfile-chdir-perl \ 31 | libfile-listing-perl libfile-readbackwards-perl libfilesys-df-perl libflac12 libflite1 libfmt9 libfont-afm-perl libfontconfig1 libfreetype6 libfribidi0 \ 32 | libfuse2 libfuse3-3 libgbm1 libgdbm-compat4 libgdbm6 libgdk-pixbuf-2.0-0 libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common libgfapi0 libgfchangelog0 libgfortran5 \ 33 | libgfrpc0 libgfxdr0 libgl1 libgl1-mesa-dri libglapi-mesa libglib2.0-0 libglib2.0-data libglusterd0 libglusterfs0 libglvnd0 libglx-mesa0 libglx0 libgme0 \ 34 | libgnutls-dane0 libgnutlsxx30 libgomp1 libgoogle-perftools4 libgpgme11 libgprofng0 libgraphite2-3 libgsm1 libgssapi-perl libgstreamer-plugins-base1.0-0 \ 35 | libgstreamer1.0-0 libguard-perl libgudev-1.0-0 libharfbuzz0b libhtml-form-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl \ 36 | libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libhwy1 libibverbs1 libidn12 libiec61883-0 libinih1 \ 37 | libio-html-perl libio-multiplex-perl libio-socket-ssl-perl libio-stringy-perl libip6tc2 libipset13 libiscsi7 libjack-jackd2-0 libjbig0 libjpeg62-turbo \ 38 | liblttng-ust-common1 liblttng-ust-ctl5 liblttng-ust1 liblua5.3-0 liblvm2cmd2.03 liblwp-mediatypes-perl liblwp-protocol-https-perl liblzo2-2 libmagic-mgc \ 39 | libmagic1 libmailtools-perl libmath-random-isaac-perl libmath-random-isaac-xs-perl libmbedcrypto7 libmime-base32-perl libmp3lame0 libmpg123-0 libmysofa1 \ 40 | libncurses6 libnet-dbus-perl libnet-dns-perl libnet-dns-sec-perl libnet-http-perl libnet-ip-perl libnet-ldap-perl libnet-libidn2-perl libnet-smtp-ssl-perl \ 41 | libnpth0 libnspr4 libnss3 libnuma1 liboath0 libogg0 libopenjp2-7 libopenmpt0 libopus0 liborc-0.4-0 libpam-systemd libpango-1.0-0 \ 42 | libpangocairo-1.0-0 libpangoft2-1.0-0 libpcre2-16-0 libperl4-corelibs-perl libperl5.36 libpgm-5.3-0 libpixman-1-0 libplacebo208 libpng16-16 libpocketsphinx3 \ 43 | libslirp0 libsmbclient libsnappy1v5 libsndfile1 libsocket6-perl libsord-0-0 libsoup2.4-1 libsoup2.4-common libsoxr0 libspeex1 libsphinxbase3 \ 44 | libspice-server1 libsratom-0-0 libsrt1.5-gnutls libssh-gcrypt-4 libstatgrab10 libstring-shellquote-perl libsubid4 libsvtav1enc1 libswresample4 libswscale6 \ 45 | libtag1v5 libtag1v5-vanilla libtalloc2 libtcmalloc-minimal4 libtdb1 libtemplate-perl libterm-readline-gnu-perl libtevent0 libthai-data libthai0 libtheora0 \ 46 | libthrift-0.17.0 libtie-ixhash-perl libtiff6 libtimedate-perl libtpms0 libtry-tiny-perl libtwolame0 libtypes-serialiser-perl libu2f-server0 libuchardet0 \ 47 | libudfread0 libunbound8 libunwind8 liburcu8 liburi-perl liburing2 libusb-1.0-0 libusbredirparser1 libuuid-perl libv4l-0 libv4lconvert0 \ 48 | libva-drm2 libva-x11-2 libva2 libvdpau-va-gl1 libvdpau1 libvidstab1.1 libvirglrenderer1 libvisual-0.4-0 libvorbis0a libvorbisenc2 libvorbisfile3 \ 49 | libwww-robotrules-perl libx11-6 libx11-data libx11-xcb1 libx264-164 libx265-199 libxau6 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 \ 50 | libxcb-randr0 libxcb-render0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcb1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxml-libxml-perl \ 51 | libxml-namespacesupport-perl libxml-parser-perl libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl libxml-twig-perl libxml-xpathengine-perl libxmuu1 \ 52 | libxrender1 libxshmfence1 libxslt1.1 libxv1 libxvidcore4 libxxf86vm1 libyaml-0-2 libyaml-libyaml-perl libz3-4 libzimg2 libzmq5 \ 53 | ocl-icd-libopencl1 perl perl-modules-5.36 perl-openssl-defaults pinentry-curses pocketsphinx-en-us \ 54 | python3-certifi python3-cffi-backend python3-chardet python3-charset-normalizer python3-cryptography python3-gpg python3-idna python3-jwt python3-ldb \ 55 | thin-provisioning-tools ucf uidmap va-driver-all vdpau-driver-all xauth xdg-user-dirs xfsprogs xsltproc xz-utils zstd \ 56 | apparmor binutils binutils-aarch64-linux-gnu bridge-utils cifs-utils criu cstream dosfstools dtach ebtables libcephfs2 \ 57 | libcfg7 libcmap4 libcorosync-common4 libcpg4 libcrypt-openssl-bignum-perl libcrypt-openssl-random-perl libcrypt-openssl-rsa-perl libjs-bootstrap \ 58 | libjs-jquery libjson-glib-1.0-0 libjson-glib-1.0-common libjson-perl libjson-xs-perl libknet1 liblinux-inotify2-perl \ 59 | libnet1 libnetaddr-ip-perl libnetfilter-log1 libnfsidmap1 libnozzle1 libposix-strptime-perl libprotobuf-c1 libprotobuf32 libqb100 \ 60 | libqrencode4 libquorum5 librados2 libradosstriper1 librbd1 librdkafka1 librgw2 librrd8 librrds-perl \ 61 | libvotequorum8 lvm2 lzop nfs-common numactl python3-ceph-argparse python3-ceph-common \ 62 | python3-cephfs python3-protobuf python3-rados python3-rbd python3-rgw \ 63 | python3-samba python3-talloc python3-tdb python3-yaml qrencode rpcbind \ 64 | rrdcached samba-common samba-common-bin samba-dsdb-modules sgml-base smartmontools smbclient socat sqlite3 init systemd efibootmgr gettext-base grub-common grub-efi grub-efi-arm64 grub-efi-arm64-bin grub-efi-arm64-signed grub2-common \ 65 | libefiboot1 libefivar1 mokutil os-prober console-setup \ 66 | shim-helpers-arm64-signed shim-signed shim-signed-common shim-unsigned secureboot-db 67 | 68 | LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot $rootfssrc apt clean 69 | LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot $rootfssrc rm /var/lib/apt/* -rf 70 | LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot $rootfssrc rm /var/cache/* -rf 71 | 72 | mksquashfs $rootfssrc /root/pve-base.squashfs 73 | -------------------------------------------------------------------------------- /Patch/qemu-server/0001-add_pcie.patch: -------------------------------------------------------------------------------- 1 | diff -uNr -x .git a/PVE/QemuServer/PCI.pm b/PVE/QemuServer/PCI.pm 2 | --- a/PVE/QemuServer/PCI.pm 2023-06-06 13:03:01.500126696 +0000 3 | +++ b/PVE/QemuServer/PCI.pm 2023-06-06 12:55:08.954380569 +0000 4 | @@ -139,82 +139,72 @@ 5 | ahci0 => { bus => 0, addr => 7 }, 6 | qga0 => { bus => 0, addr => 8 }, 7 | spice => { bus => 0, addr => 9 }, 8 | - virtio0 => { bus => 0, addr => 10 }, 9 | - virtio1 => { bus => 0, addr => 11 }, 10 | - virtio2 => { bus => 0, addr => 12 }, 11 | - virtio3 => { bus => 0, addr => 13 }, 12 | - virtio4 => { bus => 0, addr => 14 }, 13 | - virtio5 => { bus => 0, addr => 15 }, 14 | - hostpci0 => { bus => 0, addr => 16 }, 15 | - hostpci1 => { bus => 0, addr => 17 }, 16 | - net0 => { bus => 0, addr => 18 }, 17 | - net1 => { bus => 0, addr => 19 }, 18 | - net2 => { bus => 0, addr => 20 }, 19 | - net3 => { bus => 0, addr => 21 }, 20 | - net4 => { bus => 0, addr => 22 }, 21 | - net5 => { bus => 0, addr => 23 }, 22 | +# pcie.1 => { bus => 0, addr => 10 }, 23 | + net0 => { bus => 0, addr => 11 }, 24 | + hostpci4 => { bus => 0, addr => 12 }, 25 | + hostpci5 => { bus => 0, addr => 13 }, 26 | + hostpci6 => { bus => 0, addr => 14 }, 27 | + hostpci7 => { bus => 0, addr => 15 }, 28 | + hostpci8 => { bus => 0, addr => 16 }, 29 | + hostpci19 => { bus => 0, addr => 17 }, 30 | + hostpci10 => { bus => 0, addr => 18 }, 31 | + hostpci0 => { bus => 0, addr => 22 }, 32 | + hostpci1 => { bus => 0, addr => 23 }, 33 | vga1 => { bus => 0, addr => 24 }, 34 | vga2 => { bus => 0, addr => 25 }, 35 | - vga3 => { bus => 0, addr => 26 }, 36 | +# vga3 => { bus => 0, addr => 26 }, #use to pcie2-3,for aarch64 37 | hostpci2 => { bus => 0, addr => 27 }, 38 | hostpci3 => { bus => 0, addr => 28 }, 39 | - #addr29 : usb-host (pve-usb.cfg) 40 | +# addr29 : usb-host (pve-usb.cfg) 41 | 'pci.1' => { bus => 0, addr => 30 }, 42 | 'pci.2' => { bus => 0, addr => 31 }, 43 | - 'net6' => { bus => 1, addr => 1 }, 44 | - 'net7' => { bus => 1, addr => 2 }, 45 | - 'net8' => { bus => 1, addr => 3 }, 46 | - 'net9' => { bus => 1, addr => 4 }, 47 | - 'net10' => { bus => 1, addr => 5 }, 48 | - 'net11' => { bus => 1, addr => 6 }, 49 | - 'net12' => { bus => 1, addr => 7 }, 50 | - 'net13' => { bus => 1, addr => 8 }, 51 | - 'net14' => { bus => 1, addr => 9 }, 52 | - 'net15' => { bus => 1, addr => 10 }, 53 | - 'net16' => { bus => 1, addr => 11 }, 54 | - 'net17' => { bus => 1, addr => 12 }, 55 | - 'net18' => { bus => 1, addr => 13 }, 56 | - 'net19' => { bus => 1, addr => 14 }, 57 | - 'net20' => { bus => 1, addr => 15 }, 58 | - 'net21' => { bus => 1, addr => 16 }, 59 | - 'net22' => { bus => 1, addr => 17 }, 60 | - 'net23' => { bus => 1, addr => 18 }, 61 | - 'net24' => { bus => 1, addr => 19 }, 62 | - 'net25' => { bus => 1, addr => 20 }, 63 | - 'net26' => { bus => 1, addr => 21 }, 64 | - 'net27' => { bus => 1, addr => 22 }, 65 | - 'net28' => { bus => 1, addr => 23 }, 66 | - 'net29' => { bus => 1, addr => 24 }, 67 | - 'net30' => { bus => 1, addr => 25 }, 68 | - 'net31' => { bus => 1, addr => 26 }, 69 | +# 'net0' => { bus => 1, addr => 1 }, 70 | + 'net1' => { bus => 1, addr => 2 }, 71 | + 'net2' => { bus => 1, addr => 3 }, 72 | + 'net3' => { bus => 1, addr => 4 }, 73 | + 'net4' => { bus => 1, addr => 5 }, 74 | + 'net5' => { bus => 1, addr => 6 }, 75 | + 'net6' => { bus => 1, addr => 7 }, 76 | + 'net7' => { bus => 1, addr => 8 }, 77 | + 'net8' => { bus => 1, addr => 9 }, 78 | + 'net9' => { bus => 1, addr => 10 }, 79 | + 'net10' => { bus => 1, addr => 11 }, 80 | + 'net11' => { bus => 1, addr => 12 }, 81 | + 'net12' => { bus => 1, addr => 13 }, 82 | + 'net13' => { bus => 1, addr => 14 }, 83 | + 'net14' => { bus => 1, addr => 15 }, 84 | + 'net15' => { bus => 1, addr => 16 }, 85 | + 'net16' => { bus => 1, addr => 17 }, 86 | + 'net17' => { bus => 1, addr => 18 }, 87 | + 'net18' => { bus => 1, addr => 19 }, 88 | + 'net19' => { bus => 1, addr => 20 }, 89 | + 'net20' => { bus => 1, addr => 21 }, 90 | + 'net21' => { bus => 1, addr => 22 }, 91 | + 'net22' => { bus => 1, addr => 23 }, 92 | + 'net23' => { bus => 1, addr => 24 }, 93 | + 'net24' => { bus => 1, addr => 25 }, 94 | 'xhci' => { bus => 1, addr => 27 }, 95 | 'pci.4' => { bus => 1, addr => 28 }, 96 | 'rng0' => { bus => 1, addr => 29 }, 97 | 'pci.2-igd' => { bus => 1, addr => 30 }, # replaces pci.2 in case a legacy IGD device is passed through 98 | - 'virtio6' => { bus => 2, addr => 1 }, 99 | - 'virtio7' => { bus => 2, addr => 2 }, 100 | - 'virtio8' => { bus => 2, addr => 3 }, 101 | - 'virtio9' => { bus => 2, addr => 4 }, 102 | - 'virtio10' => { bus => 2, addr => 5 }, 103 | - 'virtio11' => { bus => 2, addr => 6 }, 104 | - 'virtio12' => { bus => 2, addr => 7 }, 105 | - 'virtio13' => { bus => 2, addr => 8 }, 106 | - 'virtio14' => { bus => 2, addr => 9 }, 107 | - 'virtio15' => { bus => 2, addr => 10 }, 108 | - 'ivshmem' => { bus => 2, addr => 11 }, 109 | - 'audio0' => { bus => 2, addr => 12 }, 110 | - hostpci4 => { bus => 2, addr => 13 }, 111 | - hostpci5 => { bus => 2, addr => 14 }, 112 | - hostpci6 => { bus => 2, addr => 15 }, 113 | - hostpci7 => { bus => 2, addr => 16 }, 114 | - hostpci8 => { bus => 2, addr => 17 }, 115 | - hostpci9 => { bus => 2, addr => 18 }, 116 | - hostpci10 => { bus => 2, addr => 19 }, 117 | - hostpci11 => { bus => 2, addr => 20 }, 118 | - hostpci12 => { bus => 2, addr => 21 }, 119 | - hostpci13 => { bus => 2, addr => 22 }, 120 | - hostpci14 => { bus => 2, addr => 23 }, 121 | - hostpci15 => { bus => 2, addr => 24 }, 122 | + 'virtio0' => { bus => 2, addr => 1 }, 123 | + 'virtio1' => { bus => 2, addr => 2 }, 124 | + 'virtio2' => { bus => 2, addr => 3 }, 125 | + 'virtio3' => { bus => 2, addr => 4 }, 126 | + 'virtio4' => { bus => 2, addr => 5 }, 127 | + 'virtio5' => { bus => 2, addr => 6 }, 128 | + 'virtio6' => { bus => 2, addr => 7 }, 129 | + 'virtio7' => { bus => 2, addr => 8 }, 130 | + 'virtio8' => { bus => 2, addr => 9 }, 131 | + 'virtio9' => { bus => 2, addr => 10 }, 132 | + 'virtio10' => { bus => 2, addr => 11 }, 133 | + 'virtio11' => { bus => 2, addr => 12 }, 134 | + 'virtio12' => { bus => 2, addr => 13 }, 135 | + 'virtio13' => { bus => 2, addr => 14 }, 136 | + 'virtio14' => { bus => 2, addr => 15 }, 137 | + 'virtio15' => { bus => 2, addr => 16 }, 138 | + 'ivshmem' => { bus => 2, addr => 17 }, 139 | + 'audio0' => { bus => 2, addr => 18 }, 140 | 'virtioscsi0' => { bus => 3, addr => 1 }, 141 | 'virtioscsi1' => { bus => 3, addr => 2 }, 142 | 'virtioscsi2' => { bus => 3, addr => 3 }, 143 | @@ -399,7 +389,9 @@ 144 | my $kvm_off = 0; 145 | my $gpu_passthrough = 0; 146 | my $legacy_igd = 0; 147 | - 148 | + if ($arch eq 'aarch64') { 149 | + push @$devices, '-readconfig', '/usr/share/qemu-server/pve-aarch64.cfg'; 150 | + } 151 | my $pciaddr; 152 | for (my $i = 0; $i < $MAX_HOSTPCI_DEVICES; $i++) { 153 | my $id = "hostpci$i"; 154 | 155 | 156 | diff -uNr -x .git a/qemu-configs/Makefile b/qemu-configs/Makefile 157 | --- a/qemu-configs/Makefile 2023-06-06 13:03:01.500126696 +0000 158 | +++ b/qemu-configs/Makefile 2023-06-06 12:40:18.675980074 +0000 159 | @@ -2,11 +2,12 @@ 160 | USRSHAREDIR=$(DESTDIR)/usr/share/qemu-server 161 | 162 | .PHONY: install 163 | -install: pve-usb.cfg pve-q35.cfg pve-q35-4.0.cfg 164 | +install: pve-usb.cfg pve-q35.cfg pve-q35-4.0.cfg pve-aarch64.cfg 165 | install -d $(USRSHAREDIR) 166 | install -m 0644 pve-usb.cfg $(USRSHAREDIR) 167 | install -m 0644 pve-q35.cfg $(USRSHAREDIR) 168 | install -m 0644 pve-q35-4.0.cfg $(USRSHAREDIR) 169 | + install -m 0644 pve-aarch64.cfg $(USRSHAREDIR) 170 | 171 | .PHONY: clean 172 | clean: 173 | diff -uNr -x .git a/qemu-configs/pve-aarch64.cfg b/qemu-configs/pve-aarch64.cfg 174 | --- a/qemu-configs/pve-aarch64.cfg 1970-01-01 00:00:00.000000000 +0000 175 | +++ b/qemu-configs/pve-aarch64.cfg 2023-06-06 12:41:01.716400573 +0000 176 | @@ -0,0 +1,30 @@ 177 | +[device "pcie.1"] 178 | + driver = "pci-bridge" 179 | + bus = "pcie.0" 180 | + addr = "0xa" 181 | + chassis_nr = "1" 182 | + 183 | +#[device "pciroot"] 184 | +# driver = "pci-bridge" 185 | +# bus = "pci.1" 186 | +# addr = "1.0" 187 | +# chassis_nr = "1" 188 | + 189 | +[device "pcie.2"] 190 | + driver = "pci-bridge" 191 | + bus = "pci.1" 192 | + addr = "1.0" 193 | + chassis_nr = "2" 194 | + 195 | + 196 | +[device "pcie.3"] 197 | + driver = "pci-bridge" 198 | + bus = "pci.2" 199 | + addr = "1.0" 200 | + chassis_nr = "3" 201 | + 202 | +[device "pcie.4"] 203 | + driver = "pci-bridge" 204 | + bus = "pci.2" 205 | + addr = "2.0" 206 | + chassis_nr = "4" 207 | \ No newline at end of file 208 | -------------------------------------------------------------------------------- /iso/initrd/init: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # (C) 2009-2023 Proxmox Server Solutions GmbH 4 | 5 | export PATH=/sbin:/bin:/usr/bin:/usr/sbin 6 | modprobe virtio-gpu 7 | modprobe amdgpu 8 | 9 | if [ -f /.cd-info ]; then 10 | . /.cd-info 11 | else 12 | # NOTE: the only reason for not exiting now is trying to provide a shell 13 | # for debugging this mess 14 | /bin/echo "[ERROR] could not source .cd-info file!" 15 | /bin/echo "[WARN] trying fallback to PVE, but the installation will likely fail." 16 | /bin/echo "[WARN] check your installation medium and the downloaded ISO" 17 | PRODUCT="PVE" 18 | PRODUCTLONG="Proxmox VE" 19 | RELEASE="?.?" 20 | fi 21 | 22 | PRODUCT_LC="$(echo "$PRODUCT" | tr '[:upper:]' '[:lower:]')" 23 | 24 | CDID_FN=".$PRODUCT_LC-cd-id.txt" 25 | 26 | # busybox needs full paths until proc is mounted 27 | 28 | /bin/echo "Welcome to the $PRODUCTLONG $RELEASE installer" 29 | /bin/echo "initial setup startup" 30 | 31 | /bin/echo "mounting proc filesystem" 32 | /bin/mount -nt proc proc /proc 33 | 34 | echo "mounting sys filesystem" 35 | mount -nt sysfs sysfs /sys 36 | if [ -d /sys/firmware/efi ]; then 37 | echo "EFI boot mode detected, mounting efivars filesystem" 38 | mount -nt efivarfs efivarfs /sys/firmware/efi/efivars 39 | fi 40 | 41 | # ensure we have a devtmpfs, so that we see the changes from the chroot /dev 42 | # managed by udev here too, and thus normal path look ups on devices are in 43 | # sync from the kernel root POV and the installer (ch)root POV 44 | mount -t devtmpfs devtmpfs /dev 45 | 46 | # ensure early that the since 5.15 enabled SYSFB_SIMPLEFB is actually usable 47 | modprobe -q "simplefb" 48 | 49 | parse_cmdline() { 50 | root= 51 | lvm2root= 52 | proxdebug=0 53 | # shellcheck disable=SC2013 54 | for par in $(cat /proc/cmdline); do 55 | case $par in 56 | lvm2root=*) 57 | lvm2root="${par#lvm2root=}" 58 | ;; 59 | root=/dev/mapper/*) 60 | lvm2root="${par#root=}" 61 | ;; 62 | root=*) 63 | root="${par#root=}" 64 | ;; 65 | proxdebug) 66 | proxdebug=1 67 | ;; 68 | esac 69 | done; 70 | } 71 | 72 | myreboot() { 73 | echo b > /proc/sysrq-trigger 74 | echo "rebooting..." 75 | sleep 100 76 | exit 0 77 | } 78 | 79 | debugsh() { 80 | setsid sh -c '/bin/sh /dev/tty1 2>&1' 81 | } 82 | 83 | debugsh_err_reboot() { 84 | errmsg=$1 85 | 86 | echo "" # try to make the message stand out more 87 | echo "[ERROR] $errmsg" 88 | echo "unable to continue (type exit or CTRL-D to reboot)" 89 | debugsh 90 | myreboot 91 | } 92 | 93 | echo "boot comandline: $(cat /proc/cmdline)" 94 | parse_cmdline 95 | 96 | # use mdev as firmware loader 97 | echo /sbin/mdev >/proc/sys/kernel/hotplug 98 | # initially populate /dev through /sys with cold-plugged devices 99 | /sbin/mdev -s 100 | 101 | DRIVERS="msdos isofs" 102 | for mod in $DRIVERS; do 103 | modprobe -q "$mod" 104 | done 105 | 106 | filenames= 107 | # Note: skip filenames with spaces (avoid problems with bash IFS) 108 | # Note: busybox only support -regextype 'posix-basic' 109 | for fn in $(find /sys/devices/* -regex '^[^\ ]*/modalias'); do 110 | filenames="$filenames $fn" 111 | done 112 | 113 | modlist= 114 | 115 | load_alias() { 116 | alias_fn=$1 117 | 118 | alias=$(cat "${alias_fn}") 119 | if [ -n "$alias" ]; then 120 | for mod in $(modprobe -q -R "$alias" ); do 121 | mod_found=0 122 | for m in $modlist; do 123 | if [ "$m" = "$mod" ]; then 124 | mod_found=1 125 | fi 126 | done 127 | if [ ${mod_found} -eq "0" ]; then 128 | modlist="$modlist $mod" 129 | fi 130 | done 131 | fi 132 | } 133 | 134 | load_mods() { 135 | class_prefix=$1 136 | for fn in $filenames; do 137 | dirname=${fn%/*} 138 | if [ -n "$class_prefix" ]; then 139 | if [ -f "$dirname/class" ]; then 140 | class=$(cat "$dirname/class") 141 | class=${class:2:8} 142 | if [ "${class_prefix}" = "${class:0:${#class_prefix}}" ]; then 143 | load_alias "$fn" 144 | fi 145 | fi 146 | else 147 | load_alias "$fn" 148 | fi 149 | done 150 | } 151 | 152 | # for PCI Device classes and subclasses see linux-src/include/linux/pci_ids.h 153 | # load storage drivers 154 | 155 | load_mods 06 # PCI_BASE_CLASS_BRIDGE 156 | load_mods 03 # PCI_BASE_CLASS_DISPLAY 157 | 158 | # we try to have a load order, so that /dev/sda is on IDE 159 | load_mods 0101 # PCI_CLASS_STORAGE_IDE 160 | load_mods 0106 # PCI_CLASS_STORAGE_SATA 161 | load_mods 0107 # PCI_CLASS_STORAGE_SAS 162 | load_mods 0100 # PCI_CLASS_STORAGE_SCSI 163 | load_mods 01 # PCI_BASE_CLASS_STORAGE 164 | 165 | load_mods 02 # PCI_BASE_CLASS_NETWORK 166 | 167 | load_mods # all other 168 | 169 | echo "loading drivers: $modlist" 170 | 171 | for mod in $modlist; do 172 | modprobe "$mod" 173 | done 174 | 175 | stdmod="usb-storage uas usbhid usbkbd hid_generic mac_hid virtio_blk" 176 | for mod in $stdmod; do 177 | modprobe "$mod" 178 | done 179 | 180 | # we have no iscsi daemon, so we need to scan iscsi device manually. 181 | # else we cant boot from iscsi hba because devices are not detected. 182 | for i in /sys/class/scsi_host/host*; do 183 | host="${i##*/}" 184 | if [ -d "$i" ] && [ -f "$i/scan" ] && [ -d "/sys/class/iscsi_host/$host" ] ; then 185 | echo "Scanning iSCSI $host" 186 | echo "- - -" > "$i/scan" 187 | fi 188 | done 189 | 190 | if [ -n "$lvm2root" ]; then 191 | 192 | printf '%s' "Finding device mapper major and minor numbers: " 193 | 194 | MAJOR=$(sed -n 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices) 195 | MINOR=$(sed -n 's/^ *\([0-9]\+\) \+device-mapper$/\1/p' /proc/misc) 196 | if test -n "$MAJOR" -a -n "$MINOR" ; then 197 | # shellcheck disable=SC2174 198 | mkdir -p -m 755 /dev/mapper 199 | mknod -m 600 /dev/mapper/control c "$MAJOR" "$MINOR" 200 | fi 201 | 202 | echo "($MAJOR,$MINOR)" 203 | 204 | vg=${lvm2root} 205 | vg=${vg#/dev/mapper/} 206 | if [ "$vg" = "$1" ]; then 207 | echo "activating all volume groups" 208 | lvm vgchange --ignorelockingfailure -aly 209 | else 210 | # Split volume group from logical volume. 211 | vg=$(echo "${vg}" | sed -e 's#\(.*\)\([^-]\)-[^-].*#\1\2#') 212 | # Reduce padded --'s to -'s 213 | vg=$(echo "${vg}" | sed -e 's#--#-#g') 214 | echo "activating volume group $vg" 215 | lvm vgchange -aly --ignorelockingfailure "${vg}" 216 | fi 217 | 218 | echo "create /dev/mapper/ entries using vgscan" 219 | lvm vgscan --mknodes 220 | 221 | echo "trying to mount lvm root: ($lvm2root)" 222 | 223 | found= 224 | for try in 5 4 3 2 1; do 225 | for t in ext4 auto; do 226 | if mount -n -t $t -r "$lvm2root" /mnt; then 227 | found=ok 228 | break; 229 | fi 230 | done 231 | if test -n "$found"; then 232 | break; 233 | fi 234 | if test $try -gt 1; then 235 | echo "testing again in 5 seconds" 236 | sleep 5 237 | fi 238 | done 239 | 240 | elif [ -n "$root" ]; then 241 | 242 | case $root in 243 | /dev/*) 244 | real_root=$root 245 | ;; 246 | *:*) 247 | dev_min=$((0x${root#*:})) 248 | dev_maj=$((0x${root%:*})) 249 | mknod /tmp/rootdev b $dev_maj $dev_min 250 | real_root=/tmp/rootdev 251 | ;; 252 | *) 253 | dev_min=$((0x$root & 255)) 254 | dev_maj=$((0x$root >> 8)) 255 | mknod /tmp/rootdev b $dev_maj $dev_min 256 | real_root=/tmp/rootdev 257 | ;; 258 | esac 259 | 260 | echo "trying to mount root: $real_root ($root)" 261 | 262 | found= 263 | for try in 5 4 3 2 1; do 264 | for t in ext4 auto; do 265 | if mount -n -t $t -r $real_root /mnt; then 266 | found=ok 267 | break; 268 | fi 269 | done 270 | if test -n "$found"; then 271 | break; 272 | fi 273 | if test $try -gt 1; then 274 | echo "testing again in 5 seconds" 275 | sleep 5 276 | fi 277 | done 278 | 279 | else 280 | 281 | cdrom= 282 | 283 | initrdisoimage="/proxmox.iso" 284 | 285 | if [ -f $initrdisoimage ]; then 286 | # this is useful for PXE boot 287 | echo "found proxmox ISO image inside initrd image" 288 | if mount -t iso9660 -o loop,ro $initrdisoimage /mnt >/dev/null 2>&1; then 289 | cdrom=$initrdisoimage 290 | fi 291 | else 292 | echo "searching for block device containing the ISO $ISONAME-$RELEASE-$ISORELEASE" 293 | reqid="$(cat "/$CDID_FN")" 294 | echo "with ISO ID '$reqid'" 295 | delay=1 # start out with a relatively short delay, often devices get ready quite quickly 296 | for try in $(seq 1 9); do # 9 tries, each one second more sleep -> 45s total 297 | for i in /sys/block/hd* /sys/block/sr* /sys/block/scd* /sys/block/sd* /sys/block/nvme*; do 298 | # don't try to mount /all/ devices, as it produces IO, as a heuristic check all 299 | # those which are removable and all those which are of type iso9660 (we can mount 300 | # only those anyway) and those which have it's main partition < 1 GiB (ISO has 301 | # normally 750MiB) this also gets USB sticks on strange systems where the firmware 302 | # says it's not removable... 303 | if [ -d "$i" ]; then 304 | basedev="${i##*/}" 305 | path="/dev/$basedev" 306 | size="$(cat "$i/size")" 307 | 308 | if [ "$(cat "$i/removable")" = 1 ] || 309 | blkid "$path" | grep -q ' TYPE="iso9660"' || 310 | [ "$size" -lt $(( 1024 * 1024 * 65 )) ] 311 | then 312 | echo "testing device '$path' for ISO" 313 | if mount -t auto -o ro "$path" /mnt >/dev/null 2>&1; then 314 | if [ -r "/mnt/$CDID_FN" ] && [ "X$(cat "/mnt/$CDID_FN")" = "X$reqid" ]; then 315 | echo "found $PRODUCTLONG ISO" 316 | cdrom=$path 317 | break 318 | else 319 | echo "found ISO9660 FS but no, or wrong proxmox cd-id, skipping" 320 | fi 321 | umount /mnt 322 | fi 323 | else 324 | { 325 | echo "dev $i neither removable, nor type 'iso9660' nor smallish, skipping ISO check"; 326 | echo " removable: $(cat "$i/removable"), size: $size, blkid: $(blkid "$path")"; 327 | } >> skipped-devs.txt 328 | fi 329 | fi 330 | done 331 | if test -n "$cdrom"; then 332 | break; 333 | fi 334 | if test $try -gt 1; then 335 | echo "testing again in $delay seconds" 336 | sleep "$delay" 337 | # gradually increase sleeps, as HW is either ready quickly or needs tens of seconds 338 | delay=$((delay + 1)) 339 | fi 340 | done 341 | fi 342 | 343 | if [ -z "$cdrom" ]; then 344 | debugsh_err_reboot "no device with valid ISO found, please check your installation medium" 345 | fi 346 | fi 347 | 348 | if [ $proxdebug -ne 0 ]; then 349 | echo "Debugging mode (type 'exit' or press CTRL-D to continue startup)" 350 | debugsh 351 | fi 352 | 353 | BASE_SQFS="/mnt/$PRODUCT_LC-base.squashfs" 354 | INSTALLER_SQFS="/mnt/$PRODUCT_LC-installer.squashfs" 355 | 356 | if [ -f "$INSTALLER_SQFS" ]; then 357 | # this is a Proxmox XYZ installation CD 358 | 359 | # hostid (gethostid(3)) is used by zfs to identify which system imported a pool last it needs 360 | # to be present in /etc/hostid before spl.ko is loaded create it in the installer and copy it 361 | # over to the targetdir after installation 362 | dd if=/dev/urandom of=/etc/hostid bs=1 count=4 status=none 363 | 364 | if ! mount -t squashfs -o ro,loop "$BASE_SQFS" /mnt/.base; then 365 | debugsh_err_reboot "mount '$BASE_SQFS' failed" 366 | fi 367 | 368 | if ! mount -t squashfs -o ro,loop "$INSTALLER_SQFS" /mnt/.installer; then 369 | debugsh_err_reboot "mount '$INSTALLER_SQFS' failed" 370 | fi 371 | 372 | if ! mount -t tmpfs tmpfs /mnt/.workdir; then 373 | debugsh_err_reboot "mount overlay workdir failed" 374 | fi 375 | 376 | mkdir /mnt/.workdir/work 377 | mkdir /mnt/.workdir/upper 378 | 379 | if ! mount -t overlay -o lowerdir=/mnt/.installer:/mnt/.base,upperdir=/mnt/.workdir/upper,workdir=/mnt/.workdir/work none /mnt/.installer-mp; then 380 | debugsh_err_reboot "mount overlayfs failed" 381 | fi 382 | 383 | if ! mount --bind /mnt /mnt/.installer-mp/cdrom; then 384 | debugsh_err_reboot "bind mount cdrom failed" 385 | fi 386 | 387 | cp /etc/hostid /mnt/.installer-mp/etc/ 388 | cp /.cd-info /mnt/.installer-mp/ || true 389 | 390 | if [ -x "/mnt/.installer-mp/sbin/unconfigured.sh" ]; then 391 | mount -t devtmpfs devtmpfs /mnt/.installer-mp/dev 392 | 393 | echo "switching root from initrd to actual installation system" 394 | # and run the installer (via exec, so hand over PID 1) 395 | # NOTE: the setsid/redirect dance is really required to have job control in debug shells 396 | if ! exec switch_root -c /dev/console /mnt/.installer-mp /bin/setsid /bin/sh -c 'exec /sbin/unconfigured.sh /dev/tty1 2>&1'; then 397 | debugsh_err_reboot "unable to switch root to installer ($?)" 398 | fi 399 | # NOTE: should never be reached 400 | else 401 | debugsh_err_reboot "unable to find installer (/sbin/unconfigured.sh)" 402 | fi 403 | 404 | echo "unexpected return from installer environment, trigger confused reboot now.." 405 | cd / 406 | 407 | # Send a SIGKILL to all processes, except for init. 408 | kill -s KILL -1 409 | sleep 1 410 | 411 | umount /mnt/.installer-mp/cdrom 412 | umount /mnt/.installer-mp 413 | umount /mnt/.workdir/ 414 | umount /mnt/.installer 415 | umount /mnt/.base 416 | 417 | umount -a -l 418 | 419 | myreboot 420 | 421 | else 422 | # or begin normal init for "rescue" boot 423 | umount /sys 424 | umount /proc 425 | 426 | exec /sbin/switch_root -c /dev/console /mnt sbin/init 427 | fi 428 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | --------------------------------------------------------------------------------