diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..9848b50 --- /dev/null +++ b/build.sh @@ -0,0 +1,71 @@ +#!/bin/bash +PKGNAME=$1 +SH_PATH=$(readlink -f `dirname "$0"`) + +errlog(){ + echo $1; + exit 1; +} + +if [ ! -n "$PKGNAME" ];then + errlog "Useage: ./build.sh pve-common" +fi + +if [ ! -d "$SH_PATH/packages/$PKGNAME" ];then + errlog "$PKGNAME is not exsited!" +fi + +dockerbuild(){ + rm $SH_PATH/packages/$PKGNAME/$PKGNAME/pvebuild -rf + if [ -n "$BUILDERNAME" ];then + docker run -it -e PKGDIR=$SH_PATH/packages/$PKGNAME/$PKGNAME -v $SH_PATH/:$SH_PATH --name $PKGNAME --rm $BUILDERNAME || errlog "builderror" + else + docker run -it -e PKGDIR=$SH_PATH/packages/$PKGNAME/$PKGNAME -v $SH_PATH/:$SH_PATH --name $PKGNAME --rm pvebuilder|| errlog "builderror" + fi +} + +upload_pkg(){ + mkdir /tmp/$PKGNAME -p + for i in `ls $SH_PATH/packages/$PKGNAME/$PKGNAME/*.deb`; + do + md5sum $i > $i.md5 + cat $i.md5 + done + find "$SH_PATH/packages/$PKGNAME/$PKGNAME" -name "*.deb" -exec cp {} /tmp/$PKGNAME \; + find "$SH_PATH/packages/$PKGNAME/$PKGNAME" -name "*.deb.md5" -exec cp {} /tmp/$PKGNAME \; + find "$SH_PATH/packages/$PKGNAME/$PKGNAME" -name "*.buildinfo" -exec cp {} /tmp/$PKGNAME \; + find "$SH_PATH/packages/$PKGNAME/$PKGNAME" -name "*.changes" -exec cp {} /tmp/$PKGNAME \; +} + +update_submodues(){ + if [ -d "$SH_PATH/packages/$PKGNAME/$PKGNAME/.git/" ]; then + echo "skip submodule" + else + cd $SH_PATH/packages/$PKGNAME/ + git submodule update --init --recursive "$PKGNAME" + fi +} + +update_submodues || errlog "Failed to update submodule" + +if [ -f "$SH_PATH/packages/$PKGNAME/series" ];then + cd "$SH_PATH/packages/$PKGNAME/$PKGNAME" + QUILT_PATCHES=../ \ + QUILT_SERIES=../series \ + quilt --quiltrc /dev/null --color=always push -a || test $$? = 2 +fi + +ARCH=$(arch) + +if [ -f "$SH_PATH/packages/$PKGNAME/series.$ARCH" ];then + cd "$SH_PATH/packages/$PKGNAME/$PKGNAME" + QUILT_PATCHES=../ \ + QUILT_SERIES=../series.$ARCH \ + quilt --quiltrc /dev/null --color=always push -a || test $$? = 2 +fi + +cd $SH_PATH + +dockerbuild +upload_pkg || errlog "upload pkg failed" + diff --git a/packages/lxcfs/patches/001-fix-aarch64-lib-path.patch b/packages/lxcfs/patches/001-fix-aarch64-lib-path.patch new file mode 100644 index 0000000..0596e5b --- /dev/null +++ b/packages/lxcfs/patches/001-fix-aarch64-lib-path.patch @@ -0,0 +1,16 @@ +From 1590a0be2c1b7b238f4962d4f28ec36af91f10f4 Mon Sep 17 00:00:00 2001 +From: jiangcuo <49061187+jiangcuo@users.noreply.github.com> +Date: Wed, 30 Oct 2024 21:11:26 +0800 +Subject: [PATCH] fix lib patch + +--- + debian/lxcfs.links | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/debian/lxcfs.links b/debian/lxcfs.links +index 36e0af9..78a35d3 100644 +--- a/debian/lxcfs.links ++++ b/debian/lxcfs.links +@@ -1 +1 @@ +-usr/lib/x86_64-linux-gnu/lxcfs/liblxcfs.so usr/lib/x86_64-linux-gnu/liblxcfs.so ++usr/lib/aarch64-linux-gnu/lxcfs/liblxcfs.so usr/lib/aarch64-linux-gnu/liblxcfs.so diff --git a/packages/lxcfs/patches/other/001-fix-loongarch64-lib-path.patch b/packages/lxcfs/patches/other/001-fix-loongarch64-lib-path.patch new file mode 100644 index 0000000..a15b199 --- /dev/null +++ b/packages/lxcfs/patches/other/001-fix-loongarch64-lib-path.patch @@ -0,0 +1,16 @@ +From 1590a0be2c1b7b238f4962d4f28ec36af91f10f4 Mon Sep 17 00:00:00 2001 +From: jiangcuo <49061187+jiangcuo@users.noreply.github.com> +Date: Wed, 30 Oct 2024 21:11:26 +0800 +Subject: [PATCH] fix lib patch + +--- + debian/lxcfs.links | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/debian/lxcfs.links b/debian/lxcfs.links +index 36e0af9..78a35d3 100644 +--- a/debian/lxcfs.links ++++ b/debian/lxcfs.links +@@ -1 +1 @@ +-usr/lib/x86_64-linux-gnu/lxcfs/liblxcfs.so usr/lib/x86_64-linux-gnu/liblxcfs.so ++usr/lib/loongarch64-linux-gnu/lxcfs/liblxcfs.so usr/lib/loongarch64-linux-gnu/liblxcfs.so diff --git a/packages/lxcfs/patches/other/001-fix-riscv64-lib-path.patch b/packages/lxcfs/patches/other/001-fix-riscv64-lib-path.patch new file mode 100644 index 0000000..e3e08a0 --- /dev/null +++ b/packages/lxcfs/patches/other/001-fix-riscv64-lib-path.patch @@ -0,0 +1,16 @@ +From 1590a0be2c1b7b238f4962d4f28ec36af91f10f4 Mon Sep 17 00:00:00 2001 +From: jiangcuo <49061187+jiangcuo@users.noreply.github.com> +Date: Wed, 30 Oct 2024 21:11:26 +0800 +Subject: [PATCH] fix lib patch + +--- + debian/lxcfs.links | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/debian/lxcfs.links b/debian/lxcfs.links +index 36e0af9..78a35d3 100644 +--- a/debian/lxcfs.links ++++ b/debian/lxcfs.links +@@ -1 +1 @@ +-usr/lib/x86_64-linux-gnu/lxcfs/liblxcfs.so usr/lib/x86_64-linux-gnu/liblxcfs.so ++usr/lib/riscv64-linux-gnu/lxcfs/liblxcfs.so usr/lib/riscv64-linux-gnu/liblxcfs.so diff --git a/packages/lxcfs/series.aarch64 b/packages/lxcfs/series.aarch64 new file mode 100644 index 0000000..cce5b11 --- /dev/null +++ b/packages/lxcfs/series.aarch64 @@ -0,0 +1 @@ +patches/001-fix-aarch64-lib-path.patch diff --git a/packages/lxcfs/series.loongarch64 b/packages/lxcfs/series.loongarch64 new file mode 100644 index 0000000..6ebdcf2 --- /dev/null +++ b/packages/lxcfs/series.loongarch64 @@ -0,0 +1 @@ +patches/other/001-fix-loongarch64-lib-path.patch diff --git a/packages/lxcfs/series.riscv64 b/packages/lxcfs/series.riscv64 new file mode 100644 index 0000000..28305ee --- /dev/null +++ b/packages/lxcfs/series.riscv64 @@ -0,0 +1 @@ +patches/other/001-fix-riscv64-lib-path.patch