separate packaging and source build system

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2023-05-24 16:20:27 +02:00
parent f5e87de606
commit a2242b41fc
213 changed files with 66 additions and 47 deletions

View File

@ -0,0 +1,2 @@
KERNEL=="rbd[0-9]*", ENV{DEVTYPE}=="disk", PROGRAM="/usr/libexec/ceph-rbdnamer-pve %k", SYMLINK+="rbd-pve/%c"
KERNEL=="rbd[0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/usr/libexec/ceph-rbdnamer-pve %k", SYMLINK+="rbd-pve/%c-part%n"

21
src/udev-rbd/Makefile Normal file
View File

@ -0,0 +1,21 @@
PACKAGE=libpve-storage-perl
DESTDIR=
PREFIX=/usr
LIBEXECDIR=${PREFIX}/libexec
LIBDIR=${PREFIX}/lib
all:
.PHONY: install
install: 50-rbd-pve.rules ceph-rbdnamer-pve
install -d ${DESTDIR}${LIBEXECDIR}
install -m 0755 ceph-rbdnamer-pve ${DESTDIR}${LIBEXECDIR}
install -d ${DESTDIR}${LIBDIR}/udev/rules.d
install -m 0644 50-rbd-pve.rules ${DESTDIR}${LIBDIR}/udev/rules.d
.PHONY: clean
clean:
.PHONY: distclean
distclean: clean

24
src/udev-rbd/ceph-rbdnamer-pve Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
DEV=$1
NUM=`echo $DEV | sed 's#p.*##g; s#[a-z]##g'`
POOL=`cat /sys/devices/rbd/$NUM/pool`
CLUSTER_FSID=`cat /sys/devices/rbd/$NUM/cluster_fsid`
if [ -f /sys/devices/rbd/$NUM/pool_ns ]; then
NAMESPACE=`cat /sys/devices/rbd/$NUM/pool_ns`
else
NAMESPACE=""
fi
IMAGE=`cat /sys/devices/rbd/$NUM/name`
SNAP=`cat /sys/devices/rbd/$NUM/current_snap`
echo -n "/$CLUSTER_FSID/$POOL"
if [ -n "$NAMESPACE" ]; then
echo -n "/$NAMESPACE"
fi
echo -n "/$IMAGE"
if [ "$SNAP" != "-" ]; then
echo -n "@$SNAP"
fi