separate packaging and source build system
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
2
src/udev-rbd/50-rbd-pve.rules
Normal file
2
src/udev-rbd/50-rbd-pve.rules
Normal 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
21
src/udev-rbd/Makefile
Normal 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
24
src/udev-rbd/ceph-rbdnamer-pve
Executable 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
|
||||
Reference in New Issue
Block a user