add ReadMe and dockerfile

This commit is contained in:
jiangcuo 2024-11-01 15:07:45 +08:00
parent b83f897454
commit ee8a6ab722
3 changed files with 109 additions and 44 deletions

66
README.md Normal file → Executable file
View File

@ -1,51 +1,29 @@
# Proxmox-Port
# Proxmox VE Port package source
Arm64/Riscv64/Loongarch64 are ok.
## How to Build
There is a detailed introduction in the wiki.
### Initializing the build host
We need Debian 12 for this code
## 1. Tested platform:
- Rockpi (arm64)
- Raspberry Pi (arm64)
- Amlogic TV box (arm64)
- Kunpeng (arm64)
- FT (arm64)
- Ampere (arm64)
- Apple (arm64,vm only,no kvm support)
- 3A5000/3A6000/3C5000 (loongarch64)
- VisionFive2 (riscv64)
Detailed: https://github.com/jiangcuo/Proxmox-Port/wiki/Support-List
```bash
apt update
apt install quilt docker.io -y
cd docker
docker build -t pvebuilder -f dockerfile.arm64 .
```
### Build via Docker
```bash
bash build.sh pve-common
```
The built package will be under /tmp/pve-common
## 2. screen shot
arm64
### Custom Docker Image
<img width="800" alt="image" src="https://github.com/jiangcuo/Proxmox-Port/assets/49061187/0628e750-e0ff-4b74-a90e-865aac4df8fa">
```bash
BUILDERNAME=dockerpull.com/pvebuilder:20241101 bash build.sh pve-common
```
riscv64
<img width="800" alt="image" src="https://github.com/jiangcuo/Proxmox-Port/assets/49061187/841799fc-85c0-4227-ab12-e999ee66ffd3">
loongarch64
<img width="800" alt="image" src="https://github.com/jiangcuo/Proxmox-Port/assets/49061187/1d01de5a-455c-46d4-9ff1-12ba199a5e66">
## 3. Installation
If you are using server that supports EFI,you can install proxmox-ve with iso.
https://mirrors.apqa.cn/proxmox/isos/
If you are using u-boot device or failed with iso, you can install proxmox-ve from repo.
Head to the wiki page to learn more.
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=jiangcuo/Proxmox-Arm64,jiangcuo/Proxmox-Port&type=Date)](https://star-history.com/#jiangcuo/Proxmox-Arm64&jiangcuo/Proxmox-Port&Date)

43
docker/dockerfile.arm64 Normal file
View File

@ -0,0 +1,43 @@
FROM debian:12
ARG DEBIAN_APT=http://mirrors.ustc.edu.cn
ARG PVE_APT=https://mirrors.lierfang.com
ARG ARCH=
RUN rm /etc/apt/sources.list.d/* \
&& echo "deb $DEBIAN_APT/debian bookworm main contrib non-free non-free-firmware" >/etc/apt/sources.list \
&& echo "deb $DEBIAN_APT/debian bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list \
&& echo "deb $DEBIAN_APT/debian bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list \
&& echo "deb $DEBIAN_APT/debian-security bookworm-security main contrib non-free non-free-firmware " >> /etc/apt/sources.list
RUN apt update && apt install -y wget nano curl gnupg ca-certificates apt-utils
RUN ARCH=$(dpkg --print-architecture) \
&& if [ "$ARCH" = "amd64" ]; then \
echo "deb $PVE_APT/proxmox/debian/pve bookworm pve-no-subscription" >> /etc/apt/sources.list; \
echo "deb $PVE_APT/proxmox/debian/devel bookworm main" >> /etc/apt/sources.list; \
curl -l -o /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg $PVE_APT/proxmox/debian/proxmox-release-bookworm.gpg; \
else \
echo "deb $PVE_APT/proxmox/debian/pve bookworm port" >> /etc/apt/sources.list; \
echo "deb $PVE_APT/proxmox/debian/devel bookworm port" >> /etc/apt/sources.list; \
curl -l -o /etc/apt/trusted.gpg.d/pveport.gpg $PVE_APT/proxmox/debian/pveport.gpg; \
fi
RUN apt update && apt -y install build-* devscripts cargo dh-cargo devscripts rsync debcargo pkg-config debhelper git bison dwarves flex meson equivs
RUN apt update \
&& DEBIAN_FRONTEND=noninteractiv apt-get -y --no-install-recommends install proxmox-ve || echo ok
RUN rm /var/lib/dpkg/info/pve-manager.postinst \
&& rm /var/lib/dpkg/info/proxmox-ve.postinst \
&& dpkg --configure -a
ADD ./start.sh /
CMD ["bash","/start.sh"]

44
docker/start.sh Normal file
View File

@ -0,0 +1,44 @@
#!/bin/bash
errlog(){
echo $1
exit 1
}
exec_build(){
echo "install depends"
apt update
yes |mk-build-deps --install --remove
if [ -f "Makefile" ];then
echo "clean "
make clean || echo ok
echo "build deb in `pwd` "
make deb
else
dpkg-buildpackage -b -us -uc ||errlog "build error"
cp ../*.deb ../*.buildinfo ../*.changes $PKGDIR
fi
}
if [ ! -d "$PKGDIR" ];then
errlog "$PKGDIR dir is not existd,Exitting !"
fi
if [ -f "$PKGDIR/../autobuild.sh" ];then
cd $PKGDIR/../
bash autobuild.sh
else
# Rust not need copy
if [ ! -f "Cargo.toml" ];then
cd $PKGDIR
exec_build
else
mkdir /build/
rsync -ra $PKGDIR /build
cd /build/data
exec_build
fi
fi