Commit b95b38cf authored by 杨文 陈's avatar 杨文 陈

main/zfs-lts: add virt flavor

parent ea9ea293
Pipeline #18392 passed with stages
in 5 minutes and 39 seconds
......@@ -6,12 +6,23 @@ _name=zfs
_ver=0.8.3
_rel=0
_flavor=${FLAVOR:-lts}
_kpkg=linux-$_flavor
# kernel version
_kver=5.4.41
_krel=0
_kpkgver="$_kver-r$_krel"
# for custom kernels set $FLAVOR
_extra_flavors=
if [ -z "$FLAVOR" ]; then
_flavor=lts
case $CARCH in
x86|x86_64|aarch64) _extra_flavors="virt";;
esac
else
_flavor=$FLAVOR
fi
_kpkg=linux-$_flavor
_kabi="$_kver-$_krel-$_flavor"
pkgname=$_name-$_flavor
......@@ -32,6 +43,11 @@ subpackages="$pkgname-dev"
source="https://github.com/zfsonlinux/zfs/releases/download/zfs-$_ver/zfs-$_ver.tar.gz"
builddir="$srcdir/$_name-$_ver"
for f in $_extra_flavors; do
makedepends="$makedepends linux-$f-dev=$_kpkgver"
subpackages="$subpackages zfs-$f:_extra"
done
prepare() {
default_prepare
# verify the kernel version
......@@ -49,16 +65,20 @@ prepare() {
build() {
cd "$builddir"
./configure --prefix=/usr \
--with-tirpc \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--with-config=kernel \
--with-linux=/usr/src/linux-headers-${_kabi}
local flavor= kabi=
for flavor in $_flavor $_extra_flavors; do
kabi="$_kver-$_krel-$flavor"
./configure --prefix=/usr \
--with-tirpc \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--with-config=kernel \
--with-linux=/usr/src/linux-headers-$kabi
make
make
done
}
package() {
......@@ -66,6 +86,16 @@ package() {
make DESTDIR="$pkgdir" install
}
_extra() {
flavor=${subpkgname##*-}
depends="linux-$flavor=$_kpkgver"
install_if="linux-$flavor=$_kpkgver"
pkgdesc="ZFS for Linux: kernel modules for $flavor"
cd "$builddir"
make DESTDIR="$subpkgdir" install
}
dev() {
mkdir -p "$subpkgdir"/usr
mv "$pkgdir"/usr/src "$subpkgdir"/usr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment