first init

This commit is contained in:
Jiangcuo 2025-02-05 19:41:14 +08:00
commit 224e25eab5
14 changed files with 402 additions and 0 deletions

61
Makefile Normal file
View File

@ -0,0 +1,61 @@
include /usr/share/dpkg/pkg-info.mk
export PVERELEASE = $(shell echo $(DEB_VERSION_UPSTREAM) | cut -d. -f1-2)
export VERSION = $(DEB_VERSION_UPSTREAM_REVISION)
PACKAGE = pxvirt-spdk
SRCDIR := src
ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
DEB = $(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(ARCH).deb \
python3-spdk_$(DEB_VERSION_UPSTREAM_REVISION)_$(ARCH).deb
DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
GITVERSION:=$(shell git rev-parse --short=16 HEAD)
all: $(SUBDIRS)
set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i; done
.PHONY: submodule
submodule:
ifeq ($(shell test -f "$(SRCDIR)/configure" && echo 1 || echo 0), 0)
git submodule update --init --recursive
endif
$(BUILDDIR): submodule
rm -rf $@ $@.tmp
mkdir $@.tmp
rsync -a debian $@.tmp
rsync -a src/* $@.tmp
echo "git clone https://gitea.lierfang.com/pxcloud/pxvirt\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE
echo "REPOID_GENERATED=$(GITVERSION)" > $@.tmp/debian/rules.env
mv $@.tmp $@
.PHONY: deb
deb: $(DEB)
$(DEB): $(BUILDDIR)
cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
lintian $(DEB)
.PHONY: lintian
deb: $(DEB)
lintian $(DEB)
.PHONY: distclean
distclean: clean
.PHONY: clean
clean:
set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
rm -f $(PACKAGE)*.tar* country.dat *.deb *.dsc *.build *.buildinfo *.changes
rm -rf dest $(PACKAGE)-[0-9]*/
.PHONY: dinstall
dinstall: $(DEB)
dpkg -i $(DEB)

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
pxvirt-spdk (24.09) bookworm; urgency=medium
* init
-- Jiangcuo <Jiangcuo@lierfang.com> Mon, 03 Feb 2025 13:56:49 +0800

102
debian/control vendored Normal file
View File

@ -0,0 +1,102 @@
Source: pxvirt-spdk
Section: admin
Priority: optional
Maintainer: Lierfang <it_support@lierfang.com>
Build-Depends: debhelper-compat (= 12),
cmake,
libaio-dev,
libcunit1-dev,
libcmocka-dev,
libdpdk-dev,
libjson-c-dev,
librdmacm-dev,
libnuma-dev,
libpmem-dev,
libpmemblk-dev,
libpmemobj-dev,
liburing-dev,
libfuse3-dev,
librados-dev,
librbd-dev,
libbfio-dev,
libkeyutils-dev,
libncurses5-dev,
libncursesw5-dev,
libssl-dev,
uuid-dev,
libiscsi-dev,
python3-dev,
pkg-config,
python3,
python3-pip,
python3-pkgconfig,
python3-pytest,
python3-magic,
python3-restructuredtext-lint,
python3-pyelftools,
python3-ijson,
python3-grpcio,
python3-yaml,
python3-jinja2,
python3-tabulate,
python3-configshell-fb,
python3-pexpect,
python3-paramiko,
python3-sphinx,
valgrind,
nasm,
build-essential,
g++,
quilt,
unzip,
patchelf,
meson,
libtool,
help2man,
systemtap-sdt-dev,
astyle,
lcov,
clang,
sg3-utils,
pciutils,
shellcheck,
abigail-tools,
bash-completion,
ruby-dev,
pycodestyle,
bundler,
rake,
libibverbs-dev,
librdmacm-dev,
doxygen,
mscgen,
graphviz,
libavahi-client-dev,
liblz4-dev,
python3:any
Standards-Version: 4.5.1
Homepage: https://spdk.io
Package: pxvirt-spdk
Architecture: any
Depends: dbus,
python3:any,
python3-configshell-fb,
python3-pyparsing,
python3-grpcio,
python3-googleapi,
python3-ipy,
${misc:Depends},
${shlibs:Depends},
Description: SPDK for pxvirt
This package contains the spdk used by PXVIRT
Package: python3-spdk
Architecture: any
Depends: pxvirt-spdk,
python3:any,
${misc:Depends},
${shlibs:Depends},
Description: SPDK for pxvirt
This package contains the spdk used by PXVIRT

69
debian/copyright vendored Normal file
View File

@ -0,0 +1,69 @@
Copyright (C) 2010-2025 Lierfang
This software is written by Lierfang <itsupport@lierfang.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-------------
Ext JS - JavaScript Library
Copyright (c) 2006-2021, Sencha Inc.
All rights reserved.
licensing@sencha.com
http://www.sencha.com/license
Open Source License
----------------------------------------------------------------------------
This version of Ext JS is licensed under the terms of the
Open Source GPL 3.0 license.
http://www.gnu.org/licenses/gpl.html (/usr/share/common-licenses/GPL-3)
There are several FLOSS exceptions available for use with this release for
open source applications that are distributed under a license other than GPL.
* Open Source License Exception for Applications
http://www.sencha.com/products/floss-exception.php
* Open Source License Exception for Development
http://www.sencha.com/products/ux-exception.php
------------------------------
Bootstrap html framework:
The MIT License (MIT)
Copyright (c) 2011-2014 Twitter, Inc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

4
debian/lintian-overrides vendored Normal file
View File

@ -0,0 +1,4 @@
python3-spdk: package-installs-python-pycache-dir [usr/lib/python3.11/dist-packages/spdk/__pycache__/]
python3-spdk: shell-script-fails-syntax-check [usr/share/spdk/scripts/env_dpdk/check_dpdk_pci_api.sh]
python3-spdk: shell-script-fails-syntax-check [usr/share/spdk/scripts/perf/pm/collect-cpu-temp]
python3-spdk: shell-script-fails-syntax-check [usr/share/spdk/scripts/rxe_cfg_small.sh]

View File

@ -0,0 +1,15 @@
diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk
index 19f0192c2..9dcaac54d 100644
--- a/mk/spdk.common.mk
+++ b/mk/spdk.common.mk
@@ -7,10 +7,6 @@
# Copyright (c) 2022 Dell Inc, or its subsidiaries.
#
-ifeq ($(wildcard $(SPDK_ROOT_DIR)/mk/config.mk),)
-$(error mk/config.mk: file not found. Please run configure before make)
-endif
-
include $(SPDK_ROOT_DIR)/mk/config.mk
-include $(SPDK_ROOT_DIR)/mk/cc.flags.mk
-include $(SPDK_ROOT_DIR)/mk/cc.mk

View File

@ -0,0 +1,13 @@
diff --git a/scripts/setup.sh b/scripts/setup.sh
index 477be189d..0641182cd 100755
--- a/scripts/setup.sh
+++ b/scripts/setup.sh
@@ -13,7 +13,7 @@ if [[ $os != Linux && $os != FreeBSD ]]; then
exit 1
fi
-rootdir=$(readlink -f $(dirname $0))/..
+rootdir=$(dirname "$(realpath "$0")")/..
source "$rootdir/scripts/common.sh"
function usage() {

2
debian/patches/series vendored Normal file
View File

@ -0,0 +1,2 @@
001-fix-autoclean-on-first-build.patch
002-fix-spdk_setup-rootdir-path.patch

21
debian/postinst vendored Normal file
View File

@ -0,0 +1,21 @@
#!/bin/sh
set -e
#DEBHELPER#
case "$1" in
configure)
if [ ! -f "/etc/default/grub.d/spdk.cfg" ]; then
arch=$(uname -m)
if [ "$arch" = "x86_64" ];then
iommu="intel_iommu=on iommu=pt amd_iommu=on"
fi
echo "GRUB_CMDLINE_LINUX=\"hugepagesz=2M hugepages=1024 $iommu\"" >/etc/default/grub.d/spdk.cfg
update-grub
fi
;;
esac
exit 0

16
debian/postrm vendored Normal file
View File

@ -0,0 +1,16 @@
#!/bin/sh
set -e
#DEBHELPER#
case "$1" in
remove)
if [ -f "/etc/default/grub.d/spdk.cfg" ]; then
rm /etc/default/grub.d/spdk.cfg
fi
;;
esac
exit 0

2
debian/pxvirt-spdk.links vendored Normal file
View File

@ -0,0 +1,2 @@
usr/share/spdk/scripts/setup.sh usr/bin/spdk_setup
usr/include /usr/share/spdk/include

15
debian/pxvirt-spdk.service vendored Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description=PXVirt SPDK Service
After=pvestatd.service
StartLimitBurst=10
StartLimitIntervalSec=60
[Service]
Environment=HUGEMEM=1024
ExecStart=/usr/bin/vhost -S /var/tmp -s $HUGEMEM -m 0x3
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target

76
debian/rules vendored Executable file
View File

@ -0,0 +1,76 @@
#!/usr/bin/make -f
export DH_VERBOSE=1
export CONFIG_PREFIX=/usr
export PYDIST=$(shell python3 -c "import site; print(site.getsitepackages()[2])")
%:
dh $@ --with quilt
override_dh_auto_configure:
./configure \
--libdir=/usr/lib/"$(DEB_HOST_MULTIARCH)"/spdk \
--prefix=/usr \
--disable-examples \
--disable-tests \
--disable-unit-tests \
--with-xnvme \
--with-vhost \
--with-virtio \
--with-vbdev-compress \
--with-rbd \
--with-rdma \
--with-iscsi-initiator \
--with-uring \
--with-fuse \
--with-nvme-cuse \
--with-raid5f \
--with-crypto \
--without-sma
override_dh_auto_build:
dh_auto_build -- PREFIX=/usr
override_dh_auto_install:
dh_auto_install -- DESTDIR=$(CURDIR)/debian/pxvirt-spdk
# delete dpdk
rm -rf $(CURDIR)/debian/pxvirt-spdk/usr/bin/dpdk*
rm -rf $(CURDIR)/debian/pxvirt-spdk/usr/lib/dpdk
rm -rf $(CURDIR)/debian/pxvirt-spdk/usr/share/dpdk
rm -rf $(CURDIR)/debian/pxvirt-spdk/usr/share/docs/dpdk
# delete static
find $(CURDIR)/debian/pxvirt-spdk/ -name "*.a" -exec rm {} \;
# delete libisal-dev libdpdk-dev
find $(CURDIR)/debian/pxvirt-spdk/usr/include/ -name "rte*" -exec rm {} \;
find $(CURDIR)/debian/pxvirt-spdk/usr/include/ -name "librte*" -exec rm {} \;
find $(CURDIR)/debian/pxvirt-spdk/usr/lib/ -name "librte*" -exec rm {} \;
rm $(CURDIR)/debian/pxvirt-spdk/usr/lib/pkgconfig/libdpdk-libs.pc
rm $(CURDIR)/debian/pxvirt-spdk/usr/lib/pkgconfig/libdpdk.pc
rm $(CURDIR)/debian/pxvirt-spdk/usr/lib/pkgconfig/libisal.pc
rm $(CURDIR)/debian/pxvirt-spdk/usr/lib/pkgconfig/libisal_crypto.pc
# install python
rm -rf $(CURDIR)/debian/pxvirt-spdk/usr/local
rm -rf $(CURDIR)/debian/python3-spdk/usr/local
mkdir $(CURDIR)/debian/python3-spdk/$(PYDIST) -p
cp -r $(CURDIR)/python/spdk $(CURDIR)/debian/python3-spdk/$(PYDIST)
# install spdk scripts
mkdir $(CURDIR)/debian/python3-spdk/usr/share/spdk -p
cp -r $(CURDIR)/scripts $(CURDIR)/debian/python3-spdk/usr/share/spdk/
# install spdk_setup
install -Dm644 "scripts/bash-completion/spdk" $(CURDIR)/debian/pxvirt-spdk/usr/share/bash-completion/completions/spdk
install -Dm644 "LICENSE" $(CURDIR)/debian/pxvirt-spdk/usr/share/licenses/pxvirt-spdk/LICENSE
override_dh_usrlocal:
override_dh_dwz:
override_dh_auto_clean:

1
src Submodule

@ -0,0 +1 @@
Subproject commit 19524ad45373e35d5fdc06f4e081444d87ceed80