Initial import

This commit is contained in:
2022-08-30 15:46:53 -04:00
commit e712bb5dc2
274 changed files with 27716 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
--- configure.ac.original 2021-01-25 12:12:21.410332285 -0500
+++ configure.ac 2021-01-25 12:12:39.882925919 -0500
@@ -229,7 +229,7 @@
AC_PATH_PROG(XSLTPROC, xsltproc)
AC_PATH_PROG(CLITEST, clitest)
AC_PATH_PROG(TAR, tar)
-AC_PATH_PROG(GIT, git)
+AC_PATH_PROG(GIT, /usr/bin/git)
AC_PATH_PROG(PO4A_TRANSLATE, po4a-translate)
AC_PATH_PROG(PO4A_GETTEXTIZE, po4a-gettextize)
AC_PATH_PROG(DPKG_BUILDPACKAGE, dpkg-buildpackage)

View File

@@ -0,0 +1,13 @@
--- user/shared/drbd_buildtag.sh.original 2021-01-25 00:57:10.817492405 -0500
+++ user/shared/drbd_buildtag.sh 2021-01-25 00:57:59.501429694 -0500
@@ -4,8 +4,8 @@
local out=$1
set -e; exec > ${out}.new
echo -e "/* automatically generated. DO NOT EDIT. */"
- if test -e ../../.git && GITHEAD=$(git rev-parse HEAD); then
- GITDIFF=$(cd .. && git diff --name-only HEAD |
+ if test -e ../../.git && GITHEAD=$(/usr/bin/git rev-parse HEAD); then
+ GITDIFF=$(cd .. && /usr/bin/git diff --name-only HEAD |
tr -s '\t\n' ' ' |
sed -e 's/ *$//')
echo -e "#define GITHASH \"${GITHEAD}\""

View File

@@ -0,0 +1,13 @@
--- configure.ac.original 2021-01-25 00:37:46.050875009 -0500
+++ configure.ac 2021-01-25 00:38:26.747986868 -0500
@@ -457,8 +457,8 @@
AH_TEMPLATE(WINDRBD, [Include support for windrbd (do not use this under Linux)])
AC_SUBST(DRBD_LIB_DIR, [$localstatedir/lib/$PACKAGE_TARNAME])
-AC_SUBST(DRBD_RUN_DIR, [$localstatedir/run/$PACKAGE_TARNAME])
-AC_SUBST(DRBD_LOCK_DIR, [$localstatedir/lock])
+AC_SUBST(DRBD_RUN_DIR, [/run/$PACKAGE_TARNAME])
+AC_SUBST(DRBD_LOCK_DIR, [/run/lock])
AC_SUBST(DRBD_CONFIG_DIR, [$sysconfdir])
AC_SUBST(DRBD_BIN_DIR, [$exec_prefix/bin])

View File

@@ -0,0 +1,158 @@
#!/sbin/openrc-run
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
extra_started_commands="reload"
depend() {
use logger
need net
before heartbeat
after sshd
}
DEFAULTFILE="/etc/conf.d/drbd"
DRBDADM="/sbin/drbdadm"
PROC_DRBD="/proc/drbd"
MODPROBE="/sbin/modprobe"
RMMOD="/sbin/rmmod"
UDEV_TIMEOUT=10
ADD_MOD_PARAM=""
PATH=${PATH}:/lib/drbd:/lib64/drbd
if [ -f $DEFAULTFILE ]; then
. $DEFAULTFILE
fi
# Just in case drbdadm want to display any errors in the configuration
# file, or we need to ask the user about registering this installation
# at http://usage.drbd.org, we call drbdadm here without any IO
# redirection.
$DRBDADM sh-nop
assure_module_is_loaded() {
[ -e "$PROC_DRBD" ] && return
ebegin "Loading drbd module"
ret=0
$MODPROBE -s drbd `$DRBDADM sh-mod-parms` $ADD_MOD_PARAM || ret=20
eend $ret
return $ret
}
adjust_with_progress() {
IFS_O=$IFS
NEWLINE='
'
IFS=$NEWLINE
local D=0
local S=0
local N=0
einfon "Setting drbd parameters "
COMMANDS=`$DRBDADM -d adjust all` || {
eend 20 "Error executing drbdadm"
return 20
}
echo -n "[ "
for CMD in $COMMANDS; do
if echo $CMD | grep -q disk; then echo -n "d$D "; D=$(( D+1 ));
elif echo $CMD | grep -q syncer; then echo -n "s$S "; S=$(( S+1 ));
elif echo $CMD | grep -q net; then echo -n "n$N "; N=$(( N+1 ));
else echo -n ".. ";
fi
IFS=$IFS_O
eval $CMD || {
echo
eend 20 "cmd $CMD failed!"
return 20
}
IFS=$NEWLINE
done
echo "]"
eend 0
IFS=$IFS_O
}
start() {
einfo "Starting DRBD resources:"
eindent
assure_module_is_loaded || return $?
adjust_with_progress || return $?
# make sure udev has time to create the device files
ebegin "Waiting for udev device creation ..."
for RESOURCE in `$DRBDADM sh-resources`; do
for DEVICE in `$DRBDADM sh-dev $RESOURCE`; do
UDEV_TIMEOUT_LOCAL=$UDEV_TIMEOUT
while [ ! -e $DEVICE ] && [ $UDEV_TIMEOUT_LOCAL -gt 0 ] ; do
sleep 1
UDEV_TIMEOUT_LOCAL=$(( $UDEV_TIMEOUT_LOCAL-1 ))
done
done
done
eend 0
einfon "Waiting for connection "
$DRBDADM wait-con-int
ret=$?
echo
sleep 5
einfon "Become primary if configured "
$DRBDADM sh-b-pri all
echo
eend $ret
return $ret
}
stop() {
ebegin "Stopping all DRBD resources"
# Check for mounted drbd devices
if ! grep -q '^/dev/drbd' /proc/mounts &>/dev/null; then
if [ -e ${PROC_DRBD} ]; then
${DRBDADM} down all
ret=$?
sleep 3
if [ -e /proc/modules ] && grep -q '^drbd' /proc/modules ; then
${RMMOD} drbd
fi
fi
eend $ret
return $ret
else
einfo "drbd devices mounted, please umount them before trying to stop drbd!"
eend 1
return 1
fi
}
status() {
# NEEDS to be heartbeat friendly...
# so: put some "OK" in the output.
if [ -e $PROC_DRBD ]; then
ret=0
ebegin "drbd driver loaded OK; device status:"
eend $ret
cat $PROC_DRBD
else
ebegin "drbd not loaded"
ret=3
eend $ret
fi
return $ret
}
reload() {
ebegin "Reloading DRBD"
${DRBDADM} adjust all
ret=$?
eend $ret
return $ret
}

View File

@@ -0,0 +1,158 @@
#!/sbin/openrc-run
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License, v2 or later
extra_started_commands="reload"
depend() {
use logger
need net
before heartbeat
after sshd
}
DEFAULTFILE="/etc/conf.d/drbd"
DRBDADM="/sbin/drbdadm"
PROC_DRBD="/proc/drbd"
MODPROBE="/sbin/modprobe"
RMMOD="/sbin/rmmod"
UDEV_TIMEOUT=10
ADD_MOD_PARAM=""
PATH=${PATH}:/lib/drbd:/lib64/drbd
if [ -f $DEFAULTFILE ]; then
. $DEFAULTFILE
fi
# Just in case drbdadm want to display any errors in the configuration
# file, or we need to ask the user about registering this installation
# at http://usage.drbd.org, we call drbdadm here without any IO
# redirection.
$DRBDADM sh-nop
assure_module_is_loaded() {
[ -e "$PROC_DRBD" ] && return
ebegin "Loading drbd module"
ret=0
$MODPROBE -s drbd `$DRBDADM sh-mod-parms` $ADD_MOD_PARAM || ret=20
eend $ret
return $ret
}
adjust_with_progress() {
IFS_O=$IFS
NEWLINE='
'
IFS=$NEWLINE
local D=0
local S=0
local N=0
einfon "Setting drbd parameters "
COMMANDS=`$DRBDADM -d adjust all` || {
eend 20 "Error executing drbdadm"
return 20
}
echo -n "[ "
for CMD in $COMMANDS; do
if echo $CMD | grep -q disk; then echo -n "d$D "; D=$(( D+1 ));
elif echo $CMD | grep -q syncer; then echo -n "s$S "; S=$(( S+1 ));
elif echo $CMD | grep -q net; then echo -n "n$N "; N=$(( N+1 ));
else echo -n ".. ";
fi
IFS=$IFS_O
eval $CMD || {
echo
eend 20 "cmd $CMD failed!"
return 20
}
IFS=$NEWLINE
done
echo "]"
eend 0
IFS=$IFS_O
}
start() {
einfo "Starting DRBD resources:"
eindent
assure_module_is_loaded || return $?
adjust_with_progress || return $?
# make sure udev has time to create the device files
ebegin "Waiting for udev device creation ..."
for RESOURCE in `$DRBDADM sh-resources`; do
for DEVICE in `$DRBDADM sh-dev $RESOURCE`; do
UDEV_TIMEOUT_LOCAL=$UDEV_TIMEOUT
while [ ! -e $DEVICE ] && [ $UDEV_TIMEOUT_LOCAL -gt 0 ] ; do
sleep 1
UDEV_TIMEOUT_LOCAL=$(( $UDEV_TIMEOUT_LOCAL-1 ))
done
done
done
eend 0
einfon "Waiting for connection "
$DRBDADM wait-con-int
ret=$?
echo
sleep 5
einfon "Become primary if configured "
$DRBDADM sh-b-pri all
echo
eend $ret
return $ret
}
stop() {
ebegin "Stopping all DRBD resources"
# Check for mounted drbd devices
if ! grep -q '^/dev/drbd' /proc/mounts &>/dev/null; then
if [ -e ${PROC_DRBD} ]; then
${DRBDADM} down all
ret=$?
sleep 3
if [ -e /proc/modules ] && grep -q '^drbd' /proc/modules ; then
${RMMOD} drbd
fi
fi
eend $ret
return $ret
else
einfo "drbd devices mounted, please umount them before trying to stop drbd!"
eend 1
return 1
fi
}
status() {
# NEEDS to be heartbeat friendly...
# so: put some "OK" in the output.
if [ -e $PROC_DRBD ]; then
ret=0
ebegin "drbd driver loaded OK; device status:"
eend $ret
cat $PROC_DRBD
else
ebegin "drbd not loaded"
ret=3
eend $ret
fi
return $ret
}
reload() {
ebegin "Reloading DRBD"
${DRBDADM} adjust all
ret=$?
eend $ret
return $ret
}

View File

@@ -0,0 +1,13 @@
--- configure.ac.orig 2015-01-31 23:19:18.745021931 +0000
+++ configure.ac 2015-01-31 23:19:38.988027506 +0000
@@ -353,8 +353,8 @@
AH_TEMPLATE(DRBD_LEGACY_84, [Include support for drbd-8.4 kernel code])
AC_SUBST(DRBD_LIB_DIR, [$localstatedir/lib/$PACKAGE_TARNAME])
-AC_SUBST(DRBD_RUN_DIR, [$localstatedir/run/$PACKAGE_TARNAME])
-AC_SUBST(DRBD_LOCK_DIR, [$localstatedir/lock])
+AC_SUBST(DRBD_RUN_DIR, [/run/$PACKAGE_TARNAME])
+AC_SUBST(DRBD_LOCK_DIR, [/run/lock])
AC_SUBST(DRBD_CONFIG_DIR, [$sysconfdir])
AC_DEFINE_UNQUOTED(DRBD_LIB_DIR, ["$DRBD_LIB_DIR"])