clean up unused recipes

This commit is contained in:
Bruce Leidl 2019-01-15 12:18:14 -05:00
parent 8ff96d55cb
commit 2c05f2ee9c
59 changed files with 0 additions and 7160 deletions

View File

@ -1,26 +0,0 @@
Subject: local.mk: fix cross compiling problem
We meet the following error when cross compiling.
| Makefile:3418: *** Recursive variable 'INSTALL' references itself (eventually). Stop.
This patch fixes this problem.
Upstream-Status: Pending
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/local.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/local.mk b/src/local.mk
index 36dfa4e..c5898cc 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -649,4 +649,4 @@ cu_install_program = @INSTALL_PROGRAM@
else
cu_install_program = src/ginstall
endif
-INSTALL = $(cu_install_program) -c
+INSTALL_PROGRAM = $(cu_install_program)
--
2.1.0

View File

@ -1,64 +0,0 @@
Upstream-Status: Denied
Subject: uname: report processor and hardware correctly
This patch is rejected by coreutils upstream, but distros like debian and fedora
uses this patch to make `uname -i' and `uname -p' to not report 'unknown'.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/uname.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/uname.c b/src/uname.c
index 39bd28c..c84582d 100644
--- a/src/uname.c
+++ b/src/uname.c
@@ -299,13 +299,19 @@ main (int argc, char **argv)
if (toprint & PRINT_PROCESSOR)
{
- char const *element = unknown;
+ char *element = unknown;
#if HAVE_SYSINFO && defined SI_ARCHITECTURE
{
static char processor[257];
if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
element = processor;
}
+#else
+ {
+ static struct utsname u;
+ uname(&u);
+ element = u.machine;
+ }
#endif
#ifdef UNAME_PROCESSOR
if (element == unknown)
@@ -343,7 +349,7 @@ main (int argc, char **argv)
if (toprint & PRINT_HARDWARE_PLATFORM)
{
- char const *element = unknown;
+ char *element = unknown;
#if HAVE_SYSINFO && defined SI_PLATFORM
{
static char hardware_platform[257];
@@ -361,6 +367,14 @@ main (int argc, char **argv)
if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0)
element = hardware_platform;
}
+#else
+ {
+ static struct utsname u;
+ uname(&u);
+ element = u.machine;
+ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6')
+ element[1]='3';
+ }
#endif
if (! (toprint == UINT_MAX && element == unknown))
print_element (element);
--
1.9.1

View File

@ -1,49 +0,0 @@
Subject: revert inconsistent ls quoting
This is a revert of upstream commit 109b9220cead6e979d22d16327c4d9f8350431cc.
Bug-Debian: https://bugs.debian.org/813164
Upstream-Status: Submitted
Originally-by: Adam Borowski <kilobyte@angband.pl>
[PG: patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813164#78 ]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
--- coreutils-8.25.orig/NEWS
+++ coreutils-8.25/NEWS
@@ -71,9 +71,6 @@ GNU coreutils NEWS
df now prefers sources towards the root of a device when
eliding duplicate bind mounted entries.
- ls now quotes file names unambiguously and appropriate for use in a shell,
- when outputting to a terminal.
-
join, sort, uniq with --zero-terminated, now treat '\n' as a field delimiter.
** Improvements
--- coreutils-8.25.orig/doc/coreutils.texi
+++ coreutils-8.25/doc/coreutils.texi
@@ -7750,8 +7750,8 @@ this"} in the default C locale. This lo
You can specify the default value of the @option{--quoting-style} option
with the environment variable @env{QUOTING_STYLE}@. If that environment
-variable is not set, the default value is @samp{shell-escape} when the
-output is a terminal, and @samp{literal} otherwise.
+variable is not set, the default value is @samp{literal}, but this
+default may change to @samp{shell} in a future version of this package.
@item --show-control-chars
@opindex --show-control-chars
--- coreutils-8.25.orig/src/ls.c
+++ coreutils-8.25/src/ls.c
@@ -1581,7 +1581,6 @@ decode_switches (int argc, char **argv)
if (isatty (STDOUT_FILENO))
{
format = many_per_line;
- set_quoting_style (NULL, shell_escape_quoting_style);
/* See description of qmark_funny_chars, above. */
qmark_funny_chars = true;
}

View File

@ -1,39 +0,0 @@
From a1d360509fa3a4aff57eedcd528cc0347a87531d Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com>
Date: Tue, 16 Sep 2014 01:59:08 -0700
Subject: [PATCH] gnulib-comp.m4: selinux/flask.h should respect to
with_selinux
Fixed when build with meta-selinux even when --without-selinux:
runcon.c:49:28: fatal error: selinux/flask.h: No such file or directory
# include <selinux/flask.h>
^
compilation terminated.
Upstream-Status: Pending
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
m4/gnulib-comp.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 472d3a0..5f09734 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -1730,11 +1730,11 @@ AC_DEFUN([gl_INIT],
AC_LIBOBJ([select])
fi
gl_SYS_SELECT_MODULE_INDICATOR([select])
- AC_CHECK_HEADERS([selinux/flask.h])
AC_LIBOBJ([selinux-at])
gl_HEADERS_SELINUX_SELINUX_H
gl_HEADERS_SELINUX_CONTEXT_H
if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then
+ AC_CHECK_HEADERS([selinux/flask.h])
AC_LIBOBJ([getfilecon])
fi
gl_SERVENT
--
1.7.9.5

View File

@ -1,31 +0,0 @@
We have problem using hardcoded directories like /usr/local here
which will be checked for cross builds. This is a special case which
is valid for AIX only. We do not have AIX as one of our supported
build host or target. Therefore we get rid of the hardcoded paths
and make life easier for cross compilation process.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Inappropriate [Upstream does care for AIX while we may not]
Index: coreutils-8.14/m4/getloadavg.m4
===================================================================
--- coreutils-8.14.orig/m4/getloadavg.m4 2011-09-19 08:09:24.000000000 -0700
+++ coreutils-8.14/m4/getloadavg.m4 2011-10-19 21:42:00.385533357 -0700
@@ -41,16 +41,6 @@
[LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
fi
- if test $gl_func_getloadavg_done = no; then
- # There is a commonly available library for RS/6000 AIX.
- # Since it is not a standard part of AIX, it might be installed locally.
- gl_getloadavg_LIBS=$LIBS
- LIBS="-L/usr/local/lib $LIBS"
- AC_CHECK_LIB([getloadavg], [getloadavg],
- [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
- [LIBS=$gl_getloadavg_LIBS])
- fi
-
# Set up the replacement function if necessary.
if test $gl_func_getloadavg_done = no; then
HAVE_GETLOADAVG=0

View File

@ -1,139 +0,0 @@
SUMMARY = "The basic file, shell and text manipulation utilities"
DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
manipulation utilities. These are the core utilities which are expected to exist on \
every system."
HOMEPAGE = "http://www.gnu.org/software/coreutils/"
BUGTRACKER = "http://debbugs.gnu.org/coreutils"
LICENSE = "GPLv3+"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
file://src/ls.c;beginline=1;endline=15;md5=dbe356a88b09c29232b083d1ff8ac82a"
DEPENDS = "gmp libcap"
DEPENDS_class-native = ""
inherit autotools gettext texinfo
SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
file://remove-usr-local-lib-from-m4.patch \
file://fix-selinux-flask.patch \
file://0001-uname-report-processor-and-hardware-correctly.patch \
file://disable-ls-output-quoting.patch \
file://0001-local.mk-fix-cross-compiling-problem.patch \
"
SRC_URI[md5sum] = "ab06d68949758971fe744db66b572816"
SRC_URI[sha256sum] = "e831b3a86091496cdba720411f9748de81507798f6130adeaef872d206e1b057"
EXTRA_OECONF_class-native = "--without-gmp"
EXTRA_OECONF_class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}"
EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch,hostname"
# acl and xattr are not default features
#
PACKAGECONFIG_class-target ??= "\
${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \
"
# The lib/oe/path.py requires xattr
PACKAGECONFIG_class-native ??= "xattr"
# with, without, depends, rdepends
#
PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
PACKAGECONFIG[single-binary] = "--enable-single-binary,--disable-single-binary,,"
# [ df mktemp nice printenv base64 gets a special treatment and is not included in this
bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \
env expand expr factor fmt fold groups head hostid id install \
join link logname md5sum mkfifo nl nohup nproc od paste pathchk \
pinky pr printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \
sha384sum sha512sum shred shuf sort split stdbuf sum tac tail tee test timeout \
tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
# hostname gets a special treatment and is not included in this
base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \
mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
sbindir_progs= "chroot"
# Let aclocal use the relative path for the m4 file rather than the
# absolute since coreutils has a lot of m4 files, otherwise there might
# be an "Argument list too long" error when it is built in a long/deep
# directory.
acpaths = "-I ./m4"
# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h
do_compile_prepend () {
mkdir -p ${B}/src
}
do_install_class-native() {
autotools_do_install
# remove groups to fix conflict with shadow-native
rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
# The return is a must since native doesn't need the
# do_install_append() in the below.
return
}
do_install_append() {
for i in df mktemp nice printenv base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
install -d ${D}${base_bindir}
[ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
install -d ${D}${sbindir}
[ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
# [ requires special handling because [.coreutils will cause the sed stuff
# in update-alternatives to fail, therefore use lbracket - the name used
# for the actual source file.
mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
}
inherit update-alternatives
ALTERNATIVE_PRIORITY = "100"
# Make hostname's priority higher than busybox but lower than net-tools
ALTERNATIVE_PRIORITY[hostname] = "90"
ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 nice printenv mktemp df"
ALTERNATIVE_${PN}-doc = "base64.1 nice.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1"
ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1"
ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1"
ALTERNATIVE_LINK_NAME[nice] = "${base_bindir}/nice"
ALTERNATIVE_TARGET[nice] = "${bindir}/nice.${BPN}"
ALTERNATIVE_LINK_NAME[nice.1] = "${mandir}/man1/nice.1"
ALTERNATIVE_LINK_NAME[printenv] = "${base_bindir}/printenv"
ALTERNATIVE_TARGET[printenv] = "${bindir}/printenv.${BPN}"
ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
python __anonymous() {
for prog in d.getVar('base_bindir_progs').split():
d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
for prog in d.getVar('sbindir_progs').split():
d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
}
BBCLASSEXTEND = "native nativesdk"

View File

@ -1 +0,0 @@
SRCREV_localedef = "c328777219ccc480be3112cf807217ca6b570b64"

View File

@ -1,43 +0,0 @@
From 168ba7a681be73ac024438e33e14fde1d5aea97d Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Fri, 30 Mar 2018 10:02:24 +0800
Subject: [PATCH 1/2] tic hang
Upstream-Status: Inappropriate [configuration]
'tic' of some linux distributions (e.g. fedora 11) hang in an infinite
loop when processing the original file.
Signed-off-by: anonymous
Rebase to 6.1
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
misc/terminfo.src | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/misc/terminfo.src b/misc/terminfo.src
index 84f4810..6b385ec 100644
--- a/misc/terminfo.src
+++ b/misc/terminfo.src
@@ -5562,12 +5562,11 @@ konsole-xf3x|KDE console window with keyboard for XFree86 3.x xterm,
# The value for kbs (see konsole-vt100) reflects local customization rather
# than the settings used for XFree86 xterm.
konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm,
- kend=\EOF, khome=\EOH, use=konsole+pcfkeys,
- use=konsole-vt100,
-
-konsole+pcfkeys|konsole subset of xterm+pcfkeys,
- kcbt=\E[Z, use=xterm+pcc2, use=xterm+pcf0,
- use=xterm+pce2,
+ kend=\EOF, kf1=\EOP, kf13=\EO2P, kf14=\EO2Q, kf15=\EO2R,
+ kf16=\EO2S, kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~,
+ kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~,
+ kf23=\E[23;2~, kf24=\E[24;2~, kf3=\EOR, kf4=\EOS,
+ khome=\EOH, use=konsole-vt100,
# Obsolete: vt100.keymap
# KDE's "vt100" keyboard has no relationship to any terminal that DEC made, but
--
1.8.3.1

View File

@ -1,35 +0,0 @@
From 2a53c03ffa90f0050a949fc5920f0df3e668ff42 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Wed, 16 Aug 2017 14:45:27 +0800
Subject: [PATCH 2/2] configure: reproducible
"configure" enforces -U for ar flags, breaking deterministic builds.
The flag was added to fix some vaguely specified "recent POSIX binutil
build problems" in 2015.
Upstream-Status: Pending
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Rebase to 6.1
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index adead92..fa4fdb7 100755
--- a/configure
+++ b/configure
@@ -4503,7 +4503,7 @@ if test "${cf_cv_ar_flags+set}" = set; then
else
cf_cv_ar_flags=unknown
- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
+ for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
do
# check if $ARFLAGS already contains this choice
--
1.8.3.1

View File

@ -1,4 +0,0 @@
#! /bin/sh
cf_cv_func_nanosleep=yes
cf_cv_func_mkstemp=yes

View File

@ -1,319 +0,0 @@
SUMMARY = "The New Curses library"
DESCRIPTION = "SVr4 and XSI-Curses compatible curses library and terminfo tools including tic, infocmp, captoinfo. Supports color, multiple highlights, forms-drawing characters, and automatic recognition of keypad and function-key sequences. Extensions include resizable windows and mouse support on both xterm and Linux console using the gpm library."
HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cbc180a8c44ca642e97c35452fab5f66"
SECTION = "libs"
DEPENDS = "ncurses-native"
DEPENDS_class-native = ""
BINCONFIG = "${bindir}/ncurses5-config ${bindir}/ncursesw5-config \
${bindir}/ncurses6-config ${bindir}/ncursesw6-config"
inherit autotools binconfig-disabled multilib_header pkgconfig
# Upstream has useful patches at times at ftp://invisible-island.net/ncurses/
SRC_URI = "git://salsa.debian.org/debian/ncurses.git;protocol=https"
EXTRA_AUTORECONF = "-I m4"
CONFIG_SITE =+ "${WORKDIR}/config.cache"
EXTRASITECONFIG = "CFLAGS='${CFLAGS} -I${SYSROOT_DESTDIR}${includedir}'"
# Whether to enable separate widec libraries; must be 'true' or 'false'
#
# TODO: remove this variable when widec is supported in every setup?
ENABLE_WIDEC ?= "true"
# _GNU_SOURCE is required for widec stuff and is detected automatically
# for target objects. But it must be set manually for native and sdk
# builds.
BUILD_CPPFLAGS += "-D_GNU_SOURCE"
# natives don't generally look in base_libdir
base_libdir_class-native = "${libdir}"
# Display corruption occurs on 64 bit hosts without these settings
# This was derrived from the upstream debian ncurses which uses
# these settings for 32 and 64 bit hosts.
EXCONFIG_ARGS = ""
EXCONFIG_ARGS_class-native = " \
--disable-lp64 \
--with-chtype='long' \
--with-mmask-t='long'"
EXCONFIG_ARGS_class-nativesdk = " \
--disable-lp64 \
--with-chtype='long' \
--with-mmask-t='long'"
PACKAGES_DYNAMIC = "^${PN}-lib.*"
# Fall back to the host termcap / terminfo for -nativesdk and -native
# The reality is a work around for strange problems with things like
# "bitbake -c menuconfig busybox" where it cannot find the terminfo
# because the sstate had a hard coded search path. Until this is fixed
# another way this is deemed good enough.
EX_TERMCAP = ""
EX_TERMCAP_class-native = ":/etc/termcap:/usr/share/misc/termcap"
EX_TERMCAP_class-nativesdk = ":/etc/termcap:/usr/share/misc/termcap"
EX_TERMINFO = ""
EX_TERMINFO_class-native = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo"
EX_TERMINFO_class-nativesdk = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo"
EX_TERMLIB ?= "tinfo"
# Helper function for do_configure to allow multiple configurations
# $1 the directory to run configure in
# $@ the arguments to pass to configure
ncurses_configure() {
mkdir -p $1
cd $1
shift
oe_runconf \
--without-debug \
--without-ada \
--without-gpm \
--enable-hard-tabs \
--enable-xmc-glitch \
--enable-colorfgbg \
--with-termpath='${sysconfdir}/termcap:${datadir}/misc/termcap${EX_TERMCAP}' \
--with-terminfo-dirs='${sysconfdir}/terminfo:${datadir}/terminfo${EX_TERMINFO}' \
--with-shared \
--disable-big-core \
--program-prefix= \
--with-ticlib \
--with-termlib=${EX_TERMLIB} \
--enable-sigwinch \
--enable-pc-files \
--disable-rpath-hack \
${EXCONFIG_ARGS} \
--with-manpage-format=normal \
--disable-stripping \
"$@" || return 1
cd ..
}
# Override the function from the autotools class; ncurses requires a
# patched autoconf213 to generate the configure script. This autoconf
# is not available so that the shipped script will be used.
do_configure() {
# check does not work with cross-compiling and is generally
# broken because it requires stdin to be pollable (which is
# not the case for /dev/null redirections)
export cf_cv_working_poll=yes
#Remove ${includedir} from CPPFLAGS, need for cross compile
sed -i 's#-I${cf_includedir}##g' ${S}/configure || die "sed CPPFLAGS"
# The --enable-pc-files requires PKG_CONFIG_LIBDIR existed
mkdir -p ${PKG_CONFIG_LIBDIR}
( cd ${S}; gnu-configize --force )
ncurses_configure "narrowc" || \
return 1
! ${ENABLE_WIDEC} || \
ncurses_configure "widec" "--enable-widec" "--without-progs"
}
do_compile() {
oe_runmake -C narrowc libs
oe_runmake -C narrowc/progs
! ${ENABLE_WIDEC} || \
oe_runmake -C widec libs
}
# set of expected differences between narrowc and widec header
#
# TODO: the NCURSES_CH_T difference can cause real problems :(
_unifdef_cleanup = " \
-e '\!/\* \$Id: curses.wide,v!,\!/\* \$Id: curses.tail,v!d' \
-e '/^#define NCURSES_CH_T /d' \
-e '/^#include <wchar.h>/d' \
-e '\!^/\* .* \*/!d' \
"
do_test[depends] = "unifdef-native:do_populate_sysroot"
do_test[dirs] = "${S}"
do_test() {
${ENABLE_WIDEC} || return 0
# make sure that the narrow and widec header are compatible
# and differ only in minor details.
unifdef -k narrowc/include/curses.h | \
sed ${_unifdef_cleanup} > curses-narrowc.h
unifdef -k widec/include/curses.h | \
sed ${_unifdef_cleanup} > curses-widec.h
diff curses-narrowc.h curses-widec.h
}
# Split original _install_opts to two parts.
# One is the options to install contents, the other is the parameters \
# when running command "make install"
# Note that install.libs will also implicitly install header files,
# so we do not need to explicitly specify install.includes.
# Doing so could in fact result in a race condition, as both targets
# (install.libs and install.includes) would install the same headers
# at the same time
_install_opts = " install.libs install.man "
_install_cfgs = "\
DESTDIR='${D}' \
PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \
"
do_install() {
# Order of installation is important; widec installs a 'curses.h'
# header with more definitions and must be installed last hence.
# Compatibility of these headers will be checked in 'do_test()'.
oe_runmake -C narrowc ${_install_cfgs} ${_install_opts} \
install.progs
# The install.data should run after install.libs, otherwise
# there would be a race issue in a very critical conditon, since
# tic will be run by install.data, and tic needs libtinfo.so
# which would be regenerated by install.libs.
oe_runmake -C narrowc ${_install_cfgs} \
install.data
! ${ENABLE_WIDEC} || \
oe_runmake -C widec ${_install_cfgs} ${_install_opts}
cd narrowc
# include some basic terminfo files
# stolen ;) from gentoo and modified a bit
for x in ansi console dumb linux rxvt screen screen-256color sun vt52 vt100 vt102 vt200 vt220 xterm-color xterm-xfree86 xterm-256color
do
local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)"
local basedir="$(basename $(dirname "${termfile}"))"
if [ -n "${termfile}" ]
then
install -d ${D}${sysconfdir}/terminfo/${basedir}
mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/
ln -s /etc/terminfo/${basedir}/${x} \
${D}${datadir}/terminfo/${basedir}/${x}
fi
done
# i think we can use xterm-color as default xterm
if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ]
then
ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
fi
# When changing ${libdir} to e.g. /usr/lib/myawesomelib/ ncurses
# still installs '/usr/lib/terminfo', so try to rm both
# the proper path and a slightly hardcoded one
rm -f ${D}${libdir}/terminfo ${D}${prefix}/lib/terminfo
# create linker scripts for libcurses.so and libncurses to
# link against -ltinfo when needed. Some builds might break
# else when '-Wl,--no-copy-dt-needed-entries' has been set in
# linker flags.
for i in libncurses libncursesw; do
f=${D}${libdir}/$i.so
test -h $f || continue
rm -f $f
echo '/* GNU ld script */' >$f
echo "INPUT($i.so.5 AS_NEEDED(-ltinfo))" >>$f
done
# Make sure that libcurses is linked so that it gets -ltinfo
# also, this should be addressed upstream really.
ln -sf libncurses.so ${D}${libdir}/libcurses.so
# create libtermcap.so linker script for backward compatibility
f=${D}${libdir}/libtermcap.so
echo '/* GNU ld script */' >$f
echo 'INPUT(AS_NEEDED(-ltinfo))' >>$f
if [ ! -d "${D}${base_libdir}" ]; then
# Setting base_libdir to libdir as is done in the -native
# case will skip this code
mkdir -p ${D}${base_libdir}
mv ${D}${libdir}/libncurses.so.* ${D}${base_libdir}
! ${ENABLE_WIDEC} || \
mv ${D}${libdir}/libncursesw.so.* ${D}${base_libdir}
mv ${D}${libdir}/libtinfo.so.* ${D}${base_libdir}
rm ${D}${libdir}/libtinfo.so
# Use lnr to ensure this is a relative link despite absolute paths
# (as we can't know the relationship between base_libdir and libdir).
# At some point we can rely on coreutils 8.16 which has ln -r.
lnr ${D}${base_libdir}/libtinfo.so.5 ${D}${libdir}/libtinfo.so
fi
if [ -d "${D}${includedir}/ncurses" ]; then
for f in `find ${D}${includedir}/ncurses -name "*.h"`
do
f=`basename $f`
test -e ${D}${includedir}/$f && continue
ln -sf ncurses/$f ${D}${includedir}/$f
done
fi
oe_multilib_header curses.h
}
python populate_packages_prepend () {
libdir = d.expand("${libdir}")
base_libdir = d.expand("${base_libdir}")
pnbase = d.expand("${PN}-lib%s")
do_split_packages(d, libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
if libdir is not base_libdir:
do_split_packages(d, base_libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
}
inherit update-alternatives
ALTERNATIVE_PRIORITY = "100"
ALTERNATIVE_ncurses-tools_class-target = "clear reset"
BBCLASSEXTEND = "native nativesdk"
PACKAGES += " \
${PN}-tools \
${PN}-terminfo-base \
${PN}-terminfo \
"
FILES_${PN} = "\
${bindir}/tput \
${bindir}/tset \
${bindir}/ncurses5-config \
${bindir}/ncursesw5-config \
${bindir}/ncurses6-config \
${bindir}/ncursesw6-config \
${datadir}/tabset \
"
# This keeps only tput/tset in ncurses
# clear/reset are in already busybox
FILES_${PN}-tools = "\
${bindir}/tic \
${bindir}/toe \
${bindir}/infotocap \
${bindir}/captoinfo \
${bindir}/infocmp \
${bindir}/clear${@['', '.${BPN}']['${CLASSOVERRIDE}' == 'class-target']} \
${bindir}/reset${@['', '.${BPN}']['${CLASSOVERRIDE}' == 'class-target']} \
${bindir}/tack \
${bindir}/tabs \
"
# 'reset' is a symlink to 'tset' which is in the 'ncurses' package
RDEPENDS_${PN}-tools = "${PN}"
FILES_${PN}-terminfo = "\
${datadir}/terminfo \
"
FILES_${PN}-terminfo-base = "\
${sysconfdir}/terminfo \
"
RSUGGESTS_${PN}-libtinfo = "${PN}-terminfo"
RRECOMMENDS_${PN}-libtinfo = "${PN}-terminfo-base"

View File

@ -1,11 +0,0 @@
require ncurses.inc
SRC_URI += "file://0001-tic-hang.patch \
file://0002-configure-reproducible.patch \
file://config.cache \
"
# commit id corresponds to the revision in package version
SRCREV = "518fe9f913a0bfb80f1e366c9fcccf23e79dc69b"
S = "${WORKDIR}/git"
EXTRA_OECONF += "--with-abi-version=5"
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+(\+\d+)*)"

View File

@ -1,3 +0,0 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://gnulib.patch"

View File

@ -1,21 +0,0 @@
Fix gnulib issues found with glibc 2.28 libio.h removal
see
https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: bison-3.0.4/lib/fseterr.c
===================================================================
--- bison-3.0.4.orig/lib/fseterr.c
+++ bison-3.0.4/lib/fseterr.c
@@ -29,7 +29,7 @@ fseterr (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_flags |= _IO_ERR_SEEN;
#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
fp_->_flags |= __SERR;

View File

@ -1,25 +0,0 @@
SUMMARY = "Checksec tool"
DESCRIPTION = "The checksec.sh script is designed to test what standard Linux OS and PaX security features are being used."
SECTION = "security"
LICENSE = "BSD-3-Clause"
HOMEPAGE="http://www.trapkit.de/tools/checksec.html"
LIC_FILES_CHKSUM = "file://checksec-${PV}.sh;beginline=3;endline=34;md5=6dab14470bfdf12634b866dbdd7a04b0"
SRC_URI = "http://www.trapkit.de/tools/checksec.sh;downloadfilename=checksec-${PV}.sh"
SRC_URI[md5sum] = "57cc3fbbbe48e8ebd4672c569954374d"
SRC_URI[sha256sum] = "05822cd8668589038d20650faa0e56f740911d8ad06f7005b3d12a5c76591b90"
S = "${WORKDIR}"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/checksec-${PV}.sh ${D}${bindir}/checksec.sh
sed -i 's/\r//' ${D}${bindir}/checksec.sh
}
RDEPENDS_${PN} = "bash binutils"
BBCLASSEXTEND = "native"

View File

@ -1,608 +0,0 @@
/* #define _GNU_SOURCE ** for vasprintf() */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdarg.h>
#include <errno.h>
#include <assert.h>
#define MAX_LINE 1000
#define MAX_PKGS 100
char *checksum_field=NULL;
/* exclude_field is a comma-separated list of dependencies that you want to exclude, for example:
Package: init
Pre-Depends: systemd-sysv | sysvinit-core | upstart
This will always give systemd-sysv with GETDEPS, unless you use
DEBOOTSTRAP_EXCLUDE_FIELD=systemd-sysv,sysvinit-core pkgdetails Packages init
*/
char *exclude_field=NULL;
char **exclude_array=NULL;
static void oom_die(void)
{
fputs("Out of memory!\n", stderr);
exit(1);
}
static char *xvasprintf(const char *fmt, va_list ap) {
char *ret;
if (vasprintf (&ret, fmt, ap) < 0) {
if (errno == ENOMEM)
oom_die();
return NULL;
}
return ret;
}
static char *xasprintf(const char *fmt, ...) {
va_list ap;
char *ret;
va_start(ap, fmt);
ret = xvasprintf(fmt, ap);
va_end(ap);
return ret;
}
static void parse_exclude_field(const char *str) {
char *workptr, *saveptr = NULL, *tok = NULL;
workptr = strdup(str);
int nf=0,f;
tok=workptr;
while(*tok==',') tok++;
do {
saveptr=strchr(tok,',');
tok++;
if (saveptr) tok=saveptr+1;
nf++;
} while(saveptr);
exclude_array = (char **) malloc((nf+1) * sizeof(char *));
if (exclude_array==NULL){
oom_die();
}
tok = strtok_r(workptr, ",", &saveptr);
for(f=0;f<nf;f++){
exclude_array[f] = strdup(tok);
tok = strtok_r(NULL, ",", &saveptr);
}
exclude_array[nf+1-1]=NULL;
free(workptr);
}
static void free_exclude_array(void) {
int f;
if (exclude_array==NULL) return;
f=0;
while(exclude_array[f]!=NULL){
free(exclude_array[f]);
exclude_array[f]=NULL;
f++;
}
free(exclude_array);
exclude_array=NULL;
}
/* versionclause is not used at the moment */
static int exclude_dep(const char *dep, const char *versionclause) {
int f;
if (exclude_array==NULL) return(0);
f=0;
while(exclude_array[f]){
if (!strcmp(exclude_array[f], dep)){
return(1);
}
f++;
}
return(0);
}
static char *fieldcpy(char *dst, char *fld) {
while (*fld && *fld != ':')
fld++;
if (!*(fld++))
return NULL;
while (isspace(*fld)) fld++;
return strcpy(dst, fld);
}
static void outputdeps(char *deps) {
char *pch = deps;
while (1) {
while (isspace(*pch)) pch++;
if (!*pch) break;
while (*pch && *pch != '(' && *pch != '|' && *pch != ','
&& !isspace(*pch))
{
fputc(*pch++, stdout);
}
fputc('\n', stdout);
while (*pch && *pch++ != ',') (void)NULL;
}
}
typedef struct deps_proto {
char *cur_pkg;
int nd;
/* 95% of Depends: in jessie have less than 16 entries, for the rest
we do a realloc() when necessary. */
#define DEPCHUNK 16
char ** deps;
} deps_t, *deps_p;
static deps_p deps_new(void) {
deps_p n = (deps_p) malloc(sizeof(deps_t));
if (n==NULL) oom_die();
memset(n, 0x00, sizeof(deps_t));
n->cur_pkg = NULL;
n->nd = 0;
n->deps = NULL;
return(n);
}
static void deps_free(deps_p d) {
int i;
if (d==NULL) return;
for(i=0;i<d->nd;i++){
if (d->deps[i]) {
free(d->deps[i]);
d->deps[i] = NULL;
}
}
if (d->nd) {
free(d->deps);
d->deps = NULL;
}
d->nd = 0;
if (d->cur_pkg) {
free(d->cur_pkg);
d->cur_pkg = NULL;
}
free(d);
}
static void deps_setpkgname(deps_p d, const char *cur_pkg) {
if (d->cur_pkg) free(d->cur_pkg);
d->cur_pkg = strdup(cur_pkg);
}
static void deps_add_4(deps_p d, const char *dep) {
int di;
/* Typically, a package depends on 0-10 other ones. I can't be
bothered to write a sort function for that. Slowsort it is. */
for (di=0;di<d->nd;di++){
if (!strcmp(d->deps[di], dep)) return;
}
/* extend if necessary */
if ((d->nd % DEPCHUNK) == 0) {
d->deps = (char **) realloc(d->deps, (d->nd + DEPCHUNK) * sizeof(char *));
if (d->deps == NULL) oom_die();
for(di=0;di < DEPCHUNK;di++) d->deps[d->nd + di] = NULL;
}
/* add it */
d->deps[d->nd] = strdup(dep);
if (d->deps[d->nd] == NULL) oom_die();
d->nd++;
}
static int deps_add_3(deps_p d, const char *versioneddep) {
char workptr[MAX_LINE+1], *tok3, *saveptr3, *versionclause;
int used;
strcpy(workptr,versioneddep);
tok3 = strtok_r(workptr, " (", &saveptr3);
versionclause = strtok_r(NULL, " (", &saveptr3);
/* versionclause is not used, but keep lint happy */
if (versionclause) {
while(*versionclause == ' ') versionclause++;
}
used = !exclude_dep(tok3, versionclause);
if (!used) {
fprintf(stderr,"W: pkgdetails: skip %s dependency on %s\n", d->cur_pkg, tok3);
} else {
/* add it to the list */
deps_add_4(d, tok3);
}
return(used);
}
static void deps_add_2(deps_p d, const char *depsaltlist) {
char workptr[MAX_LINE+1], *tok2, *saveptr2;
int used, chose_alternative;
/* shortcut: most dependencies don't have the alternatives syntax */
if (strchr(depsaltlist, '|')==NULL) {
(void) deps_add_3(d, depsaltlist);
return;
}
/* parse this dependency-alternatives-list A | B | C */
strcpy(workptr, depsaltlist);
tok2 = strtok_r(workptr, " |", &saveptr2);
chose_alternative = 0;
used = 0;
while(tok2){
used = deps_add_3(d, tok2);
if (used) break; // we want only the first alternative from the list
tok2 = strtok_r(NULL, " |", &saveptr2);
if (tok2) {
fprintf(stderr,"I: pkgdetails: consider %s dependency on %s\n", d->cur_pkg, tok2);
chose_alternative = 1;
}
}
if (! used) {
fprintf(stderr,"E: pkgdetails: none of the %s dependencies chosen from alternatives %s\n", d->cur_pkg, depsaltlist);
} else {
if (chose_alternative) {
fprintf(stderr,"I: pkgdetails: used %s dependency on %s\n", d->cur_pkg, tok2);
}
}
}
static void deps_add(deps_p d, const char *depslist) {
char workptr[MAX_LINE+1], *tok, *saveptr = NULL;
/* skip initial space */
while ((depslist[0])&&(isspace(depslist[0]))) depslist++;
assert(strlen(depslist) <= MAX_LINE);
strcpy(workptr, depslist);
tok = strtok_r(workptr, ",", &saveptr);
while(tok){
deps_add_2(d, tok);
tok = strtok_r(NULL, ",", &saveptr);
}
}
static void deps_output(FILE *f, const deps_p d) {
int i;
if ((f==NULL)||(d==NULL)||(d->nd==0)) return;
for(i=0;i<d->nd;i++){
fputs(d->deps[i], f);
fputs("\n", f);
}
}
/* The syntax of a Debian Depends: or Pre-Depends: line is as follows:
Depends: deps
Pre-Depends: deps
deps = dep | deps "," dep
dep = versioneddep | altdep
altdep = versioneddep "|" versioneddep | versioneddep "|" altdep
versioneddep = simpledep | simpledep "(" compareclause ")"
simpledep = packagename
It needs to be parsed accurately to properly do alternatives, if we
don't like the first choice of an altdep list (hint: init)
*/
static void dogetdeps(char *pkgsfile, char **in_pkgs, int pkgc) {
char buf[MAX_LINE+1];
char cur_pkg[MAX_LINE];
char cur_deps[MAX_LINE];
char cur_predeps[MAX_LINE];
char prev_pkg[MAX_LINE];
char *pkgs[MAX_PKGS];
int i,l;
int skip;
FILE *f;
int output_pkg = -1;
deps_p curdeps = NULL;
buf[MAX_LINE+1-1] = '\0';
cur_pkg[0] = cur_deps[0] = cur_predeps[0] = prev_pkg[0] = '\0';
for (i = 0; i < pkgc; i++) pkgs[i] = in_pkgs[i];
f = fopen(pkgsfile, "r");
if (f == NULL) {
perror(pkgsfile);
exit(1);
}
curdeps = deps_new();
skip = 1;
while (fgets(buf, MAX_LINE, f)) {
l = strlen(buf);
if (*buf && buf[l-1] == '\n') buf[l-1] = '\0';
if (strncasecmp(buf, "Package:", 8) == 0) {
int any = 0;
skip = 1;
fieldcpy(cur_pkg, buf);
deps_setpkgname(curdeps, cur_pkg);
if (strcmp(cur_pkg, prev_pkg) != 0) {
if (output_pkg != -1)
pkgs[output_pkg] = NULL;
if (cur_deps[0])
outputdeps(cur_deps);
if (cur_predeps[0])
outputdeps(cur_predeps);
strcpy(prev_pkg, cur_pkg);
}
cur_deps[0] = cur_predeps[0] = '\0';
output_pkg = -1;
for (i = 0; i < pkgc; i++) {
if (!pkgs[i]) continue;
any = 1;
if (strcmp(cur_pkg, pkgs[i]) == 0) {
skip = 0;
output_pkg = i;
break;
}
}
if (!any) break;
} else if (!skip && strncasecmp(buf, "Depends:", 8) == 0)
{
deps_add(curdeps, &buf[8]);
}
else if (!skip && strncasecmp(buf, "Pre-Depends:", 12) == 0)
{
deps_add(curdeps, &buf[12]);
}
}
deps_output(stdout, curdeps);
fclose(f);
deps_free(curdeps);
}
static void dopkgmirrorpkgs(int uniq, char *mirror, char *pkgsfile,
char *fieldname, char **in_pkgs, int pkgc)
{
char buf[MAX_LINE+1];
char cur_field[MAX_LINE];
char cur_pkg[MAX_LINE];
char cur_ver[MAX_LINE];
char cur_arch[MAX_LINE];
char cur_size[MAX_LINE];
char cur_checksum[MAX_LINE];
char cur_filename[MAX_LINE];
char prev_pkg[MAX_LINE];
char *pkgs[MAX_PKGS];
int i,l;
FILE *f;
char *output = NULL;
int output_pkg = -1;
buf[MAX_LINE+1-1] = '\0';
cur_field[0] = cur_pkg[0] = cur_ver[0] = cur_arch[0] = cur_filename[0] = prev_pkg[0] = '\0';
for (i = 0; i < pkgc; i++) pkgs[i] = in_pkgs[i];
f = fopen(pkgsfile, "r");
if (f == NULL) {
perror(pkgsfile);
exit(1);
}
while (fgets(buf, MAX_LINE, f)) {
l = strlen(buf);
if (*buf && buf[l-1] == '\n') buf[l-1] = '\0';
if (strncasecmp(buf, fieldname, strlen(fieldname)) == 0) {
fieldcpy(cur_field, buf);
}
if (strncasecmp(buf, "Package:", 8) == 0) {
fieldcpy(cur_pkg, buf);
if (strcmp(cur_pkg, prev_pkg) != 0) {
if (output)
fputs(output, stdout);
if (uniq && output_pkg != -1)
pkgs[output_pkg] = NULL;
strcpy(prev_pkg, cur_pkg);
}
free(output);
output = NULL;
output_pkg = -1;
} else if (strncasecmp(buf, "Version:", 8) == 0) {
fieldcpy(cur_ver, buf);
} else if (strncasecmp(buf, "Architecture:", 13) == 0) {
fieldcpy(cur_arch, buf);
} else if (strncasecmp(buf, "Size:", 5) == 0) {
fieldcpy(cur_size, buf);
} else if (strncasecmp(buf, checksum_field, strlen(checksum_field)) == 0
&& buf[strlen(checksum_field)] == ':') {
fieldcpy(cur_checksum, buf);
} else if (strncasecmp(buf, "Filename:", 9) == 0) {
fieldcpy(cur_filename, buf);
} else if (!*buf) {
int any = 0;
for (i = 0; i < pkgc; i++) {
if (!pkgs[i]) continue;
any = 1;
if (strcmp(cur_field, pkgs[i]) == 0) {
free(output);
output = xasprintf("%s %s %s %s %s %s %s\n", cur_pkg, cur_ver, cur_arch, mirror, cur_filename, cur_checksum, cur_size);
output_pkg = i;
break;
}
}
if (!any) break;
cur_field[0] = '\0';
}
}
if (output)
fputs(output, stdout);
if (uniq && output_pkg != -1)
pkgs[output_pkg] = NULL;
fclose(f);
/* any that weren't found are returned as "pkg -" */
if (uniq) {
for (i = 0; i < pkgc; i++) {
if (pkgs[i]) {
printf("%s -\n", pkgs[i]);
}
}
}
}
static void dopkgstanzas(char *pkgsfile, char **pkgs, int pkgc)
{
char buf[MAX_LINE+1];
char *accum;
size_t accum_size = 0, accum_alloc = MAX_LINE * 2;
char cur_pkg[MAX_LINE];
FILE *f;
int l;
buf[MAX_LINE+1-1] = '\0';
accum = malloc(accum_alloc);
if (!accum)
oom_die();
f = fopen(pkgsfile, "r");
if (f == NULL) {
perror(pkgsfile);
free(accum);
exit(1);
}
while (fgets(buf, MAX_LINE, f)) {
if (*buf) {
size_t len = strlen(buf);
if (accum_size + len + 1 > accum_alloc) {
accum_alloc = (accum_size + len + 1) * 2;
accum = realloc(accum, accum_alloc);
if (!accum)
oom_die();
}
strcpy(accum + accum_size, buf);
accum_size += len;
}
l = strlen(buf);
if (*buf && buf[l-1] == '\n') buf[l-1] = '\0';
if (strncasecmp(buf, "Package:", 8) == 0) {
fieldcpy(cur_pkg, buf);
} else if (!*buf) {
int i;
for (i = 0; i < pkgc; i++) {
if (!pkgs[i]) continue;
if (strcmp(cur_pkg, pkgs[i]) == 0) {
fputs(accum, stdout);
if (accum[accum_size - 1] != '\n')
fputs("\n\n", stdout);
else if (accum[accum_size - 2] != '\n')
fputc('\n', stdout);
break;
}
}
*accum = '\0';
accum_size = 0;
}
}
fclose(f);
free(accum);
}
static int dotranslatewgetpercent(int low, int high, int end, char *str) {
int ch;
int val, lastval;
int allow_percentage;
/* print out anything that looks like a % on its own line, appropriately
* scaled */
lastval = val = 0;
allow_percentage = 0;
while ( (ch = getchar()) != EOF ) {
if (isspace(ch)) {
allow_percentage = 1;
} else if (allow_percentage && isdigit(ch)) {
val *= 10; val += ch - '0';
} else if (allow_percentage && ch == '%') {
float f = (float) val / 100.0 * (high - low) + low;
if (str) {
printf("P: %d %d %s\n", (int) f, end, str);
} else {
printf("P: %d %d\n", (int) f, end);
}
lastval = val;
} else {
val = 0;
allow_percentage = 0;
}
}
return lastval == 100;
}
int main(int argc, char *argv[]) {
checksum_field=getenv("DEBOOTSTRAP_CHECKSUM_FIELD");
if (checksum_field == NULL) {
checksum_field="MD5sum";
}
exclude_field=getenv("DEBOOTSTRAP_EXCLUDE_FIELD");
if (exclude_field != NULL) {
parse_exclude_field(exclude_field);
} else {
exclude_array = NULL;
}
if ((argc == 6 || argc == 5) && strcmp(argv[1], "WGET%") == 0) {
if (dotranslatewgetpercent(atoi(argv[2]), atoi(argv[3]),
atoi(argv[4]), argc == 6 ? argv[5] : NULL))
{
exit(0);
} else {
exit(1);
}
} else if (argc >= 4 && strcmp(argv[1], "GETDEPS") == 0) {
int i;
for (i = 3; argc - i > MAX_PKGS; i += MAX_PKGS) {
dogetdeps(argv[2], argv+i, MAX_PKGS);
}
dogetdeps(argv[2], argv+i, argc-i);
free_exclude_array();
exit(0);
} else if (argc >= 5 && strcmp(argv[1], "PKGS") == 0) {
int i;
for (i = 4; argc - i > MAX_PKGS; i += MAX_PKGS) {
dopkgmirrorpkgs(1, argv[2], argv[3], "Package:", argv+i, MAX_PKGS);
}
dopkgmirrorpkgs(1, argv[2], argv[3], "Package:", argv+i, argc-i);
exit(0);
} else if (argc >= 6 && strcmp(argv[1], "FIELD") == 0) {
int i;
for (i = 5; argc - i > MAX_PKGS; i += MAX_PKGS) {
dopkgmirrorpkgs(0, argv[3], argv[4], argv[2], argv+i, MAX_PKGS);
}
dopkgmirrorpkgs(0, argv[3], argv[4], argv[2], argv+i, argc-i);
exit(0);
} else if (argc >= 4 && strcmp(argv[1], "STANZAS") == 0) {
int i;
for (i = 3; argc - i > MAX_PKGS; i += MAX_PKGS) {
dopkgstanzas(argv[2], argv+i, MAX_PKGS);
}
dopkgstanzas(argv[2], argv+i, argc-i);
exit(0);
} else {
fprintf(stderr, "usage: %s PKGS mirror packagesfile pkgs..\n", argv[0]);
fprintf(stderr, " or: %s FIELD field mirror packagesfile pkgs..\n",
argv[0]);
fprintf(stderr, " or: %s GETDEPS packagesfile pkgs..\n", argv[0]);
fprintf(stderr, " or: %s STANZAS packagesfile pkgs..\n", argv[0]);
fprintf(stderr, " or: %s WGET%% low high end reason\n", argv[0]);
exit(1);
}
}

View File

@ -1,35 +0,0 @@
SUMMARY = "Install a Debian system into a subdirectory"
HOMEPAGE = "https://wiki.debian.org/Debootstrap"
SECTION = "devel"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://debian/copyright;md5=1e68ced6e1689d4cd9dac75ff5225608"
inherit pkgconfig
SRC_URI = "\
http://http.debian.net/debian/pool/main/d/debootstrap/debootstrap_1.0.67.tar.gz \
file://devices.tar.gz;unpack=0 \
"
SRC_URI[md5sum] = "eacabfe2e45415af60b1d74c3a23418a"
SRC_URI[sha256sum] = "0a12e0a2bbff185d47711a716b1f2734856100e8784361203e834fed0cffa51b"
S = "${WORKDIR}/${BP}"
# All Makefile does is creation of devices.tar.gz, which fails in OE build, we use
# static devices.tar.gz as work around
# | NOTE: make -j 8 -e MAKEFLAGS=
# | rm -rf dev
# | mkdir -p dev
# | chown 0:0 dev
# | chown: changing ownership of `dev': Operation not permitted
# | make: *** [devices.tar.gz] Error 1
# | WARNING: exit code 1 from a shell command.
do_compile_prepend() {
cp ${WORKDIR}/devices.tar.gz ${B}
}
do_install() {
oe_runmake 'DESTDIR=${D}' install
chown -R root:root ${D}${datadir}/debootstrap
}

View File

@ -1,40 +0,0 @@
SUMMARY = "Install a Debian system into a subdirectory"
HOMEPAGE = "https://wiki.debian.org/Debootstrap"
SECTION = "devel"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://debian/copyright;md5=1e68ced6e1689d4cd9dac75ff5225608"
inherit pkgconfig
SRC_URI = "\
http://http.debian.net/debian/pool/main/d/debootstrap/debootstrap_${PV}.tar.gz \
file://devices.tar.gz;unpack=0 \
file://pkgdetails.c \
"
SRC_URI[md5sum] = "db30bdbf17d63d35a2cf28ba343db734"
SRC_URI[sha256sum] = "cdad4d2be155bd933acbe4f3479e1765e5f4447fb50564e30e33f7b3b84bd7db"
S = "${WORKDIR}/${BPN}"
# All Makefile does is creation of devices.tar.gz, which fails in OE build, we use
# static devices.tar.gz as work around
# | NOTE: make -j 8 -e MAKEFLAGS=
# | rm -rf dev
# | mkdir -p dev
# | chown 0:0 dev
# | chown: changing ownership of `dev': Operation not permitted
# | make: *** [devices.tar.gz] Error 1
# | WARNING: exit code 1 from a shell command.
do_compile_prepend() {
cp ${WORKDIR}/devices.tar.gz ${B}
${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/pkgdetails.c -o ${WORKDIR}/pkgdetails
}
do_install() {
oe_runmake 'DESTDIR=${D}' install
chown -R root:root ${D}${datadir}/debootstrap
install -d ${D}${libdir}/debootstrap
install -m 755 ${WORKDIR}/pkgdetails ${D}${libdir}/debootstrap
}

View File

@ -1,130 +0,0 @@
update for glibc libio.h removal in 2.28+
see
https://src.fedoraproject.org/rpms/m4/c/814d592134fad36df757f9a61422d164ea2c6c9b?branch=master
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: m4-1.4.18/lib/fflush.c
===================================================================
--- m4-1.4.18.orig/lib/fflush.c
+++ m4-1.4.18/lib/fflush.c
@@ -33,7 +33,7 @@
#undef fflush
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
/* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
static void
@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
#endif
-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
# if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
if (stream == NULL || ! freading (stream))
return fflush (stream);
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
clear_ungetc_buffer_preserving_position (stream);
Index: m4-1.4.18/lib/fpending.c
===================================================================
--- m4-1.4.18.orig/lib/fpending.c
+++ m4-1.4.18/lib/fpending.c
@@ -32,7 +32,7 @@ __fpending (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
return fp->_IO_write_ptr - fp->_IO_write_base;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
Index: m4-1.4.18/lib/fpurge.c
===================================================================
--- m4-1.4.18.orig/lib/fpurge.c
+++ m4-1.4.18/lib/fpurge.c
@@ -62,7 +62,7 @@ fpurge (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_IO_read_end = fp->_IO_read_ptr;
fp->_IO_write_ptr = fp->_IO_write_base;
/* Avoid memory leak when there is an active ungetc buffer. */
Index: m4-1.4.18/lib/freadahead.c
===================================================================
--- m4-1.4.18.orig/lib/freadahead.c
+++ m4-1.4.18/lib/freadahead.c
@@ -25,7 +25,7 @@
size_t
freadahead (FILE *fp)
{
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
if (fp->_IO_write_ptr > fp->_IO_write_base)
return 0;
return (fp->_IO_read_end - fp->_IO_read_ptr)
Index: m4-1.4.18/lib/freading.c
===================================================================
--- m4-1.4.18.orig/lib/freading.c
+++ m4-1.4.18/lib/freading.c
@@ -31,7 +31,7 @@ freading (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
return ((fp->_flags & _IO_NO_WRITES) != 0
|| ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
&& fp->_IO_read_base != NULL));
Index: m4-1.4.18/lib/fseeko.c
===================================================================
--- m4-1.4.18.orig/lib/fseeko.c
+++ m4-1.4.18/lib/fseeko.c
@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when
#endif
/* These tests are based on fpurge.c. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
if (fp->_IO_read_end == fp->_IO_read_ptr
&& fp->_IO_write_ptr == fp->_IO_write_base
&& fp->_IO_save_base == NULL)
@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when
return -1;
}
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_flags &= ~_IO_EOF_SEEN;
fp->_offset = pos;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
Index: m4-1.4.18/lib/stdio-impl.h
===================================================================
--- m4-1.4.18.orig/lib/stdio-impl.h
+++ m4-1.4.18/lib/stdio-impl.h
@@ -18,6 +18,12 @@
the same implementation of stdio extension API, except that some fields
have different naming conventions, or their access requires some casts. */
+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
+ problem by defining it ourselves. FIXME: Do not rely on glibc
+ internals. */
+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
+# define _IO_IN_BACKUP 0x100
+#endif
/* BSD stdio derived implementations. */

View File

@ -1,2 +0,0 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://m4-1.4.18-glibc-change-work-around.patch"

View File

@ -1,2 +0,0 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://m4-1.4.18-glibc-change-work-around.patch"

View File

@ -1,42 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xose Vazquez Perez <xose.vazquez@gmail.com>
Date: Wed, 11 Apr 2018 15:14:13 +0200
Subject: [PATCH] multipath-tools: add RDAC SUN/ArrayStorage to hwtable
Already in scsi_dh: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/scsi/scsi_dh.c#n70
Cc: NetApp RDAC team <ng-eseries-upstream-maintainers@netapp.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/hwtable.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index 88b4700..827e899 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -890,6 +890,18 @@ static struct hwentry default_hw[] = {
.no_path_retry = 30,
},
{
+ .vendor = "SUN",
+ .product = "ArrayStorage",
+ .bl_product = "Universal Xport",
+ .pgpolicy = GROUP_BY_PRIO,
+ .checker_name = RDAC,
+ .features = "2 pg_init_retries 50",
+ .hwhandler = "1 rdac",
+ .prio_name = PRIO_RDAC,
+ .pgfailback = -FAILBACK_IMMEDIATE,
+ .no_path_retry = 30,
+ },
+ {
/* ZFS Storage Appliances */
.vendor = "SUN",
.product = "(Sun Storage|ZFS Storage|COMSTAR)",
--
2.7.4

View File

@ -1,33 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xose Vazquez Perez <xose.vazquez@gmail.com>
Date: Tue, 24 Apr 2018 15:03:40 +0200
Subject: [PATCH] multipath-tools: remove "c" from __cpluscplus, misspelled
found by cppcheck(http://cppcheck.sf.net/):
[libmpathcmd/mpath_cmd.h:24]: (error) Invalid number of character '{' when these macros are defined: '__cpluscplus'.
Cc: Benjamin Marzinski <bmarzins@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmpathcmd/mpath_cmd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmpathcmd/mpath_cmd.h b/libmpathcmd/mpath_cmd.h
index aaa8da9..df9d938 100644
--- a/libmpathcmd/mpath_cmd.h
+++ b/libmpathcmd/mpath_cmd.h
@@ -20,7 +20,7 @@
#ifndef LIB_MPATH_CMD_H
#define LIB_MPATH_CMD_H
-#ifdef __cpluscplus
+#ifdef __cplusplus
extern "C" {
#endif
--
2.7.4

View File

@ -1,43 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xose Vazquez Perez <xose.vazquez@gmail.com>
Date: Thu, 12 Apr 2018 18:17:13 +0200
Subject: [PATCH] multipath-tools: remove emacs autoconfig of kpartx/gpt.h
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
kpartx/gpt.h | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/kpartx/gpt.h b/kpartx/gpt.h
index 66ce8f1..7bb54b7 100644
--- a/kpartx/gpt.h
+++ b/kpartx/gpt.h
@@ -109,22 +109,3 @@ int read_gpt_pt (int fd, struct slice all, struct slice *sp, int ns);
#endif
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 4
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * c-continued-statement-offset: 4
- * c-continued-brace-offset: 0
- * indent-tabs-mode: nil
- * tab-width: 8
- * End:
- */
--
2.7.4

View File

@ -1,191 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xose Vazquez Perez <xose.vazquez@gmail.com>
Date: Fri, 11 May 2018 15:42:43 +0200
Subject: [PATCH] multipath-tools: replace FSF address with a www pointer
Less prone to future modifications, new FSF licences
point exactly to this url: <http://www.gnu.org/licenses/>.
And sending a smail to FSF is outdated.
First clean up was done in 5619a39c433ac3d10a88079593cec1aa6472cbeb
Cc: Martin Wilck <mwilck@suse.com>
Cc: Benjamin Marzinski <bmarzins@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/dm-generic.c | 4 +---
libmultipath/dm-generic.h | 4 +---
libmultipath/foreign.c | 4 +---
libmultipath/foreign.h | 4 +---
libmultipath/foreign/nvme.c | 4 +---
libmultipath/generic.c | 4 +---
libmultipath/generic.h | 4 +---
tests/dmevents.c | 2 +-
tests/parser.c | 2 +-
tests/uevent.c | 2 +-
tests/util.c | 2 +-
11 files changed, 11 insertions(+), 25 deletions(-)
diff --git a/libmultipath/dm-generic.c b/libmultipath/dm-generic.c
index bdc9ca0..d752991 100644
--- a/libmultipath/dm-generic.c
+++ b/libmultipath/dm-generic.c
@@ -12,9 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA.
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <stdint.h>
diff --git a/libmultipath/dm-generic.h b/libmultipath/dm-generic.h
index 5d59724..986429f 100644
--- a/libmultipath/dm-generic.h
+++ b/libmultipath/dm-generic.h
@@ -12,9 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA.
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _DM_GENERIC_H
#define _DM_GENERIC_H
diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c
index 7217184..80b399b 100644
--- a/libmultipath/foreign.c
+++ b/libmultipath/foreign.c
@@ -12,9 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA.
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <sys/sysmacros.h>
diff --git a/libmultipath/foreign.h b/libmultipath/foreign.h
index 973f368..697f12f 100644
--- a/libmultipath/foreign.h
+++ b/libmultipath/foreign.h
@@ -12,9 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA.
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _FOREIGN_H
#define _FOREIGN_H
diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c
index 235f75d..280b6bd 100644
--- a/libmultipath/foreign/nvme.c
+++ b/libmultipath/foreign/nvme.c
@@ -12,9 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA.
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <sys/sysmacros.h>
diff --git a/libmultipath/generic.c b/libmultipath/generic.c
index 6f7a2cd..0d1e632 100644
--- a/libmultipath/generic.c
+++ b/libmultipath/generic.c
@@ -12,9 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA.
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
diff --git a/libmultipath/generic.h b/libmultipath/generic.h
index 7f7fe66..6346ffe 100644
--- a/libmultipath/generic.h
+++ b/libmultipath/generic.h
@@ -12,9 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA.
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _GENERIC_H
#define _GENERIC_H
diff --git a/tests/dmevents.c b/tests/dmevents.c
index bba51dc..3399c81 100644
--- a/tests/dmevents.c
+++ b/tests/dmevents.c
@@ -12,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
diff --git a/tests/parser.c b/tests/parser.c
index a7e7598..29859da 100644
--- a/tests/parser.c
+++ b/tests/parser.c
@@ -12,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
diff --git a/tests/uevent.c b/tests/uevent.c
index acfcb14..b0d0bfd 100644
--- a/tests/uevent.c
+++ b/tests/uevent.c
@@ -12,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
diff --git a/tests/util.c b/tests/util.c
index 113b134..839effd 100644
--- a/tests/util.c
+++ b/tests/util.c
@@ -12,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
--
2.7.4

View File

@ -1,156 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xose Vazquez Perez <xose.vazquez@gmail.com>
Date: Fri, 11 May 2018 15:43:11 +0200
Subject: [PATCH] multipath-tools: Remove trailing/leading whitespaces and
reformat code
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
Makefile.inc | 23 +++++++++++------------
kpartx/mac.h | 2 +-
kpartx/test-kpartx | 2 +-
libmpathcmd/Makefile | 2 +-
libmultipath/hwtable.c | 14 +++++++-------
libmultipath/print.h | 2 +-
multipathd/main.h | 6 +++---
7 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index 57a1835..af2f5ba 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -103,21 +103,20 @@ LDFLAGS = -Wl,-z,relro -Wl,-z,now
BIN_LDFLAGS = -pie
# Check whether a function with name $1 has been declared in header file $2.
-check_func = \
- $(shell \
+check_func = $(shell \
if grep -Eq "^[^[:blank:]]+[[:blank:]]+$1[[:blank:]]*(.*)*" "$2"; then \
- found=1; \
- status="yes"; \
- else \
- found=0; \
- status="no"; \
- fi; \
- echo 1>&2 "Checking for $1 in $2 ... $$status"; \
- echo "$$found" \
- )
+ found=1; \
+ status="yes"; \
+ else \
+ found=0; \
+ status="no"; \
+ fi; \
+ echo 1>&2 "Checking for $1 in $2 ... $$status"; \
+ echo "$$found" \
+ )
# Checker whether a file with name $1 exists
-check_file = $(shell \
+check_file = $(shell \
if [ -f "$1" ]; then \
found=1; \
status="yes"; \
diff --git a/kpartx/mac.h b/kpartx/mac.h
index a44cf38..55c3ec9 100644
--- a/kpartx/mac.h
+++ b/kpartx/mac.h
@@ -24,7 +24,7 @@ struct mac_driver_desc {
uint16_t signature; /* expected to be MAC_DRIVER_MAGIC */
uint16_t block_size;
uint32_t block_count;
- /* ... more stuff */
+ /* ... more stuff */
};
#endif
diff --git a/kpartx/test-kpartx b/kpartx/test-kpartx
index 9cee20f..d2001dc 100755
--- a/kpartx/test-kpartx
+++ b/kpartx/test-kpartx
@@ -131,7 +131,7 @@ step "create DM devices (spans)"
# They also serve as DM devices to test partition removal on those.
TABLE="\
-0 $((SIZE/SECTSIZ-OFFS)) linear $DEV1 $OFFS
+0 $((SIZE/SECTSIZ-OFFS)) linear $DEV1 $OFFS
$((SIZE/SECTSIZ-OFFS)) $((SIZE/SECTSIZ-OFFS)) linear $DEV2 $OFFS"
SPAN1=kpt
diff --git a/libmpathcmd/Makefile b/libmpathcmd/Makefile
index 53c0899..0f6b816 100644
--- a/libmpathcmd/Makefile
+++ b/libmpathcmd/Makefile
@@ -27,7 +27,7 @@ uninstall:
$(RM) $(DESTDIR)$(includedir)/mpath_cmd.h
clean: dep_clean
- $(RM) core *.a *.o *.so *.so.* *.gz
+ $(RM) core *.a *.o *.so *.so.* *.gz
include $(wildcard $(OBJS:.o=.d))
diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index 827e899..2ca6888 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -78,13 +78,13 @@
#endif
static struct hwentry default_hw[] = {
- /*
- * Generic NVMe
- *
- * Due to the parsing logic in find_hwe(), generic entries
- * have to be put on top of this list, and more specific ones
- * below.
- */
+ /*
+ * Generic NVMe devices
+ *
+ * Due to the parsing logic in find_hwe(), generic entries
+ * have to be put on top of this list, and more specific ones
+ * below.
+ */
{
.vendor = "NVME",
.product = ".*",
diff --git a/libmultipath/print.h b/libmultipath/print.h
index 7ba6438..9b5a23a 100644
--- a/libmultipath/print.h
+++ b/libmultipath/print.h
@@ -113,7 +113,7 @@ int _snprint_multipath (const struct gen_multipath *, char *, int,
const char *, int);
#define snprint_multipath(buf, len, fmt, mp, v) \
_snprint_multipath(dm_multipath_to_gen(mp), buf, len, fmt, v)
-int _snprint_multipath_topology (const struct gen_multipath *, char *, int,
+int _snprint_multipath_topology (const struct gen_multipath *, char *, int,
int verbosity);
#define snprint_multipath_topology(buf, len, mpp, v) \
_snprint_multipath_topology (dm_multipath_to_gen(mpp), buf, len, v)
diff --git a/multipathd/main.h b/multipathd/main.h
index af39558..8fd426b 100644
--- a/multipathd/main.h
+++ b/multipathd/main.h
@@ -29,11 +29,11 @@ int ev_remove_map (char *, char *, int, struct vectors *);
int set_config_state(enum daemon_status);
void * mpath_alloc_prin_response(int prin_sa);
int prin_do_scsi_ioctl(char *, int rq_servact, struct prin_resp * resp,
- int noisy);
+ int noisy);
void dumpHex(const char * , int len, int no_ascii);
int prout_do_scsi_ioctl(char * , int rq_servact, int rq_scope,
- unsigned int rq_type, struct prout_param_descriptor *param,
- int noisy);
+ unsigned int rq_type,
+ struct prout_param_descriptor *param, int noisy);
int mpath_pr_event_handle(struct path *pp);
void * mpath_pr_event_handler_fn (void * );
int update_map_pr(struct multipath *mpp);
--
2.7.4

View File

@ -1,58 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xose Vazquez Perez <xose.vazquez@gmail.com>
Date: Fri, 11 May 2018 18:39:44 +0200
Subject: [PATCH] multipath-tools: fix compilation with musl libc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In file included from alias.c:15:
file.h:9:47: error: unknown type name mode_t; did you mean time_t?
int ensure_directories_exist(const char *str, mode_t dir_mode);
^~~~~~
time_t
sysfs.c: In function sysfs_is_multipathed:
sysfs.c:304:15: error: PATH_MAX undeclared (first use in this function); did you mean PATH_UP?
char pathbuf[PATH_MAX];
^~~~~~~~
PATH_UP
Cc: Martin Wilck <mwilck@suse.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/file.h | 2 ++
libmultipath/sysfs.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/libmultipath/file.h b/libmultipath/file.h
index 29520c7..3c75c90 100644
--- a/libmultipath/file.h
+++ b/libmultipath/file.h
@@ -5,6 +5,8 @@
#ifndef _FILE_H
#define _FILE_H
+#include <sys/stat.h>
+
#define FILE_TIMEOUT 30
int ensure_directories_exist(const char *str, mode_t dir_mode);
int open_file(const char *file, int *can_write, const char *header);
diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c
index ee72e6a..16e0a73 100644
--- a/libmultipath/sysfs.c
+++ b/libmultipath/sysfs.c
@@ -28,6 +28,7 @@
#include <dirent.h>
#include <libudev.h>
#include <fnmatch.h>
+#include <limits.h>
#include "checkers.h"
#include "vector.h"
--
2.7.4

View File

@ -1,27 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xose Vazquez Perez <xose.vazquez@gmail.com>
Date: Sun, 13 May 2018 00:39:41 +0200
Subject: [PATCH] multipath-tools: add +x to doc-preclean.pl and split-man.pl
It is not strictly necessary, but it helps identify bin files.
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libdmmp/docs/doc-preclean.pl | 0
libdmmp/docs/split-man.pl | 0
2 files changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 libdmmp/docs/doc-preclean.pl
mode change 100644 => 100755 libdmmp/docs/split-man.pl
diff --git a/libdmmp/docs/doc-preclean.pl b/libdmmp/docs/doc-preclean.pl
old mode 100644
new mode 100755
diff --git a/libdmmp/docs/split-man.pl b/libdmmp/docs/split-man.pl
old mode 100644
new mode 100755
--
2.7.4

View File

@ -1,784 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xose Vazquez Perez <xose.vazquez@gmail.com>
Date: Sun, 13 May 2018 00:39:42 +0200
Subject: [PATCH] multipath-tools: refresh kernel-doc from kernel sources
Cc: Gris Ge <fge@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libdmmp/docs/kernel-doc | 671 ++++++++++++++++++++++++++----------------------
1 file changed, 368 insertions(+), 303 deletions(-)
diff --git a/libdmmp/docs/kernel-doc b/libdmmp/docs/kernel-doc
index fee8952..0057d8e 100755
--- a/libdmmp/docs/kernel-doc
+++ b/libdmmp/docs/kernel-doc
@@ -1,4 +1,5 @@
#!/usr/bin/env perl
+# SPDX-License-Identifier: GPL-2.0
use warnings;
use strict;
@@ -328,13 +329,15 @@ my $lineprefix="";
use constant {
STATE_NORMAL => 0, # normal code
STATE_NAME => 1, # looking for function name
- STATE_FIELD => 2, # scanning field start
- STATE_PROTO => 3, # scanning prototype
- STATE_DOCBLOCK => 4, # documentation block
- STATE_INLINE => 5, # gathering documentation outside main block
+ STATE_BODY_MAYBE => 2, # body - or maybe more description
+ STATE_BODY => 3, # the body of the comment
+ STATE_PROTO => 4, # scanning prototype
+ STATE_DOCBLOCK => 5, # documentation block
+ STATE_INLINE => 6, # gathering documentation outside main block
};
my $state;
my $in_doc_sect;
+my $leading_space;
# Inline documentation state
use constant {
@@ -363,7 +366,7 @@ my $doc_sect = $doc_com .
my $doc_content = $doc_com_body . '(.*)';
my $doc_block = $doc_com . 'DOC:\s*(.*)?';
my $doc_inline_start = '^\s*/\*\*\s*$';
-my $doc_inline_sect = '\s*\*\s*(@[\w\s]+):(.*)';
+my $doc_inline_sect = '\s*\*\s*(@\s*[\w][\w\.]*\s*):(.*)';
my $doc_inline_end = '^\s*\*/\s*$';
my $doc_inline_oneline = '^\s*/\*\*\s*(@[\w\s]+):\s*(.*)\s*\*/\s*$';
my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;';
@@ -553,10 +556,9 @@ sub output_highlight {
}
if ($line eq ""){
if (! $output_preformatted) {
- print $lineprefix, local_unescape($blankline);
+ print $lineprefix, $blankline;
}
} else {
- $line =~ s/\\\\\\/\&/g;
if ($output_mode eq "man" && substr($line, 0, 1) eq ".") {
print "\\&$line";
} else {
@@ -747,17 +749,73 @@ sub output_blockhead_rst(%) {
}
}
-sub output_highlight_rst {
- my $contents = join "\n",@_;
- my $line;
-
- # undo the evil effects of xml_escape() earlier
- $contents = xml_unescape($contents);
-
+#
+# Apply the RST highlights to a sub-block of text.
+#
+sub highlight_block($) {
+ # The dohighlight kludge requires the text be called $contents
+ my $contents = shift;
eval $dohighlight;
die $@ if $@;
+ return $contents;
+}
- foreach $line (split "\n", $contents) {
+#
+# Regexes used only here.
+#
+my $sphinx_literal = '^[^.].*::$';
+my $sphinx_cblock = '^\.\.\ +code-block::';
+
+sub output_highlight_rst {
+ my $input = join "\n",@_;
+ my $output = "";
+ my $line;
+ my $in_literal = 0;
+ my $litprefix;
+ my $block = "";
+
+ foreach $line (split "\n",$input) {
+ #
+ # If we're in a literal block, see if we should drop out
+ # of it. Otherwise pass the line straight through unmunged.
+ #
+ if ($in_literal) {
+ if (! ($line =~ /^\s*$/)) {
+ #
+ # If this is the first non-blank line in a literal
+ # block we need to figure out what the proper indent is.
+ #
+ if ($litprefix eq "") {
+ $line =~ /^(\s*)/;
+ $litprefix = '^' . $1;
+ $output .= $line . "\n";
+ } elsif (! ($line =~ /$litprefix/)) {
+ $in_literal = 0;
+ } else {
+ $output .= $line . "\n";
+ }
+ } else {
+ $output .= $line . "\n";
+ }
+ }
+ #
+ # Not in a literal block (or just dropped out)
+ #
+ if (! $in_literal) {
+ $block .= $line . "\n";
+ if (($line =~ /$sphinx_literal/) || ($line =~ /$sphinx_cblock/)) {
+ $in_literal = 1;
+ $litprefix = "";
+ $output .= highlight_block($block);
+ $block = ""
+ }
+ }
+ }
+
+ if ($block) {
+ $output .= highlight_block($block);
+ }
+ foreach $line (split "\n", $output) {
print $lineprefix . $line . "\n";
}
}
@@ -1062,7 +1120,7 @@ sub dump_struct($$) {
# Handle bitmaps
$arg =~ s/:\s*\d+\s*//g;
# Handle arrays
- $arg =~ s/\[\S+\]//g;
+ $arg =~ s/\[.*\]//g;
# The type may have multiple words,
# and multiple IDs can be defined, like:
# const struct foo, *bar, foobar
@@ -1422,8 +1480,6 @@ sub push_parameter($$$$) {
}
}
- $param = xml_escape($param);
-
# strip spaces from $param so that it is one continuous string
# on @parameterlist;
# this fixes a problem where check_sections() cannot find
@@ -1522,6 +1578,7 @@ sub dump_function($$) {
$prototype =~ s/__meminit +//;
$prototype =~ s/__must_check +//;
$prototype =~ s/__weak +//;
+ $prototype =~ s/__sched +//;
my $define = $prototype =~ s/^#\s*define\s+//; #ak added
$prototype =~ s/__attribute__\s*\(\(
(?:
@@ -1748,47 +1805,6 @@ sub process_proto_type($$) {
}
}
-# xml_escape: replace <, >, and & in the text stream;
-#
-# however, formatting controls that are generated internally/locally in the
-# kernel-doc script are not escaped here; instead, they begin life like
-# $blankline_html (4 of '\' followed by a mnemonic + ':'), then these strings
-# are converted to their mnemonic-expected output, without the 4 * '\' & ':',
-# just before actual output; (this is done by local_unescape())
-sub xml_escape($) {
- my $text = shift;
- if ($output_mode eq "man") {
- return $text;
- }
- $text =~ s/\&/\\\\\\amp;/g;
- $text =~ s/\</\\\\\\lt;/g;
- $text =~ s/\>/\\\\\\gt;/g;
- return $text;
-}
-
-# xml_unescape: reverse the effects of xml_escape
-sub xml_unescape($) {
- my $text = shift;
- if ($output_mode eq "man") {
- return $text;
- }
- $text =~ s/\\\\\\amp;/\&/g;
- $text =~ s/\\\\\\lt;/</g;
- $text =~ s/\\\\\\gt;/>/g;
- return $text;
-}
-
-# convert local escape strings to html
-# local escape strings look like: '\\\\menmonic:' (that's 4 backslashes)
-sub local_unescape($) {
- my $text = shift;
- if ($output_mode eq "man") {
- return $text;
- }
- $text =~ s/\\\\\\\\lt:/</g;
- $text =~ s/\\\\\\\\gt:/>/g;
- return $text;
-}
sub map_filename($) {
my $file;
@@ -1826,15 +1842,291 @@ sub process_export_file($) {
close(IN);
}
-sub process_file($) {
- my $file;
+#
+# Parsers for the various processing states.
+#
+# STATE_NORMAL: looking for the /** to begin everything.
+#
+sub process_normal() {
+ if (/$doc_start/o) {
+ $state = STATE_NAME; # next line is always the function name
+ $in_doc_sect = 0;
+ $declaration_start_line = $. + 1;
+ }
+}
+
+#
+# STATE_NAME: Looking for the "name - description" line
+#
+sub process_name($$) {
+ my $file = shift;
my $identifier;
- my $func;
my $descr;
- my $in_purpose = 0;
+
+ if (/$doc_block/o) {
+ $state = STATE_DOCBLOCK;
+ $contents = "";
+ $new_start_line = $. + 1;
+
+ if ( $1 eq "" ) {
+ $section = $section_intro;
+ } else {
+ $section = $1;
+ }
+ }
+ elsif (/$doc_decl/o) {
+ $identifier = $1;
+ if (/\s*([\w\s]+?)(\(\))?\s*-/) {
+ $identifier = $1;
+ }
+
+ $state = STATE_BODY;
+ # if there's no @param blocks need to set up default section
+ # here
+ $contents = "";
+ $section = $section_default;
+ $new_start_line = $. + 1;
+ if (/-(.*)/) {
+ # strip leading/trailing/multiple spaces
+ $descr= $1;
+ $descr =~ s/^\s*//;
+ $descr =~ s/\s*$//;
+ $descr =~ s/\s+/ /g;
+ $declaration_purpose = $descr;
+ $state = STATE_BODY_MAYBE;
+ } else {
+ $declaration_purpose = "";
+ }
+
+ if (($declaration_purpose eq "") && $verbose) {
+ print STDERR "${file}:$.: warning: missing initial short description on line:\n";
+ print STDERR $_;
+ ++$warnings;
+ }
+
+ if ($identifier =~ m/^struct/) {
+ $decl_type = 'struct';
+ } elsif ($identifier =~ m/^union/) {
+ $decl_type = 'union';
+ } elsif ($identifier =~ m/^enum/) {
+ $decl_type = 'enum';
+ } elsif ($identifier =~ m/^typedef/) {
+ $decl_type = 'typedef';
+ } else {
+ $decl_type = 'function';
+ }
+
+ if ($verbose) {
+ print STDERR "${file}:$.: info: Scanning doc for $identifier\n";
+ }
+ } else {
+ print STDERR "${file}:$.: warning: Cannot understand $_ on line $.",
+ " - I thought it was a doc line\n";
+ ++$warnings;
+ $state = STATE_NORMAL;
+ }
+}
+
+
+#
+# STATE_BODY and STATE_BODY_MAYBE: the bulk of a kerneldoc comment.
+#
+sub process_body($$) {
+ my $file = shift;
+
+ if (/$doc_sect/i) { # case insensitive for supported section names
+ $newsection = $1;
+ $newcontents = $2;
+
+ # map the supported section names to the canonical names
+ if ($newsection =~ m/^description$/i) {
+ $newsection = $section_default;
+ } elsif ($newsection =~ m/^context$/i) {
+ $newsection = $section_context;
+ } elsif ($newsection =~ m/^returns?$/i) {
+ $newsection = $section_return;
+ } elsif ($newsection =~ m/^\@return$/) {
+ # special: @return is a section, not a param description
+ $newsection = $section_return;
+ }
+
+ if (($contents ne "") && ($contents ne "\n")) {
+ if (!$in_doc_sect && $verbose) {
+ print STDERR "${file}:$.: warning: contents before sections\n";
+ ++$warnings;
+ }
+ dump_section($file, $section, $contents);
+ $section = $section_default;
+ }
+
+ $in_doc_sect = 1;
+ $state = STATE_BODY;
+ $contents = $newcontents;
+ $new_start_line = $.;
+ while (substr($contents, 0, 1) eq " ") {
+ $contents = substr($contents, 1);
+ }
+ if ($contents ne "") {
+ $contents .= "\n";
+ }
+ $section = $newsection;
+ $leading_space = undef;
+ } elsif (/$doc_end/) {
+ if (($contents ne "") && ($contents ne "\n")) {
+ dump_section($file, $section, $contents);
+ $section = $section_default;
+ $contents = "";
+ }
+ # look for doc_com + <text> + doc_end:
+ if ($_ =~ m'\s*\*\s*[a-zA-Z_0-9:\.]+\*/') {
+ print STDERR "${file}:$.: warning: suspicious ending line: $_";
+ ++$warnings;
+ }
+
+ $prototype = "";
+ $state = STATE_PROTO;
+ $brcount = 0;
+ } elsif (/$doc_content/) {
+ # miguel-style comment kludge, look for blank lines after
+ # @parameter line to signify start of description
+ if ($1 eq "") {
+ if ($section =~ m/^@/ || $section eq $section_context) {
+ dump_section($file, $section, $contents);
+ $section = $section_default;
+ $contents = "";
+ $new_start_line = $.;
+ } else {
+ $contents .= "\n";
+ }
+ $state = STATE_BODY;
+ } elsif ($state == STATE_BODY_MAYBE) {
+ # Continued declaration purpose
+ chomp($declaration_purpose);
+ $declaration_purpose .= " " . $1;
+ $declaration_purpose =~ s/\s+/ /g;
+ } else {
+ my $cont = $1;
+ if ($section =~ m/^@/ || $section eq $section_context) {
+ if (!defined $leading_space) {
+ if ($cont =~ m/^(\s+)/) {
+ $leading_space = $1;
+ } else {
+ $leading_space = "";
+ }
+ }
+ $cont =~ s/^$leading_space//;
+ }
+ $contents .= $cont . "\n";
+ }
+ } else {
+ # i dont know - bad line? ignore.
+ print STDERR "${file}:$.: warning: bad line: $_";
+ ++$warnings;
+ }
+}
+
+
+#
+# STATE_PROTO: reading a function/whatever prototype.
+#
+sub process_proto($$) {
+ my $file = shift;
+
+ if (/$doc_inline_oneline/) {
+ $section = $1;
+ $contents = $2;
+ if ($contents ne "") {
+ $contents .= "\n";
+ dump_section($file, $section, $contents);
+ $section = $section_default;
+ $contents = "";
+ }
+ } elsif (/$doc_inline_start/) {
+ $state = STATE_INLINE;
+ $inline_doc_state = STATE_INLINE_NAME;
+ } elsif ($decl_type eq 'function') {
+ process_proto_function($_, $file);
+ } else {
+ process_proto_type($_, $file);
+ }
+}
+
+#
+# STATE_DOCBLOCK: within a DOC: block.
+#
+sub process_docblock($$) {
+ my $file = shift;
+
+ if (/$doc_end/) {
+ dump_doc_section($file, $section, $contents);
+ $section = $section_default;
+ $contents = "";
+ $function = "";
+ %parameterdescs = ();
+ %parametertypes = ();
+ @parameterlist = ();
+ %sections = ();
+ @sectionlist = ();
+ $prototype = "";
+ $state = STATE_NORMAL;
+ } elsif (/$doc_content/) {
+ if ( $1 eq "" ) {
+ $contents .= $blankline;
+ } else {
+ $contents .= $1 . "\n";
+ }
+ }
+}
+
+#
+# STATE_INLINE: docbook comments within a prototype.
+#
+sub process_inline($$) {
+ my $file = shift;
+
+ # First line (state 1) needs to be a @parameter
+ if ($inline_doc_state == STATE_INLINE_NAME && /$doc_inline_sect/o) {
+ $section = $1;
+ $contents = $2;
+ $new_start_line = $.;
+ if ($contents ne "") {
+ while (substr($contents, 0, 1) eq " ") {
+ $contents = substr($contents, 1);
+ }
+ $contents .= "\n";
+ }
+ $inline_doc_state = STATE_INLINE_TEXT;
+ # Documentation block end */
+ } elsif (/$doc_inline_end/) {
+ if (($contents ne "") && ($contents ne "\n")) {
+ dump_section($file, $section, $contents);
+ $section = $section_default;
+ $contents = "";
+ }
+ $state = STATE_PROTO;
+ $inline_doc_state = STATE_INLINE_NA;
+ # Regular text
+ } elsif (/$doc_content/) {
+ if ($inline_doc_state == STATE_INLINE_TEXT) {
+ $contents .= $1 . "\n";
+ # nuke leading blank lines
+ if ($contents =~ /^\s*$/) {
+ $contents = "";
+ }
+ } elsif ($inline_doc_state == STATE_INLINE_NAME) {
+ $inline_doc_state = STATE_INLINE_ERROR;
+ print STDERR "${file}:$.: warning: ";
+ print STDERR "Incorrect use of kernel-doc format: $_";
+ ++$warnings;
+ }
+ }
+}
+
+
+sub process_file($) {
+ my $file;
my $initial_section_counter = $section_counter;
my ($orig_file) = @_;
- my $leading_space;
$file = map_filename($orig_file);
@@ -1853,250 +2145,23 @@ sub process_file($) {
}
# Replace tabs by spaces
while ($_ =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {};
+ # Hand this line to the appropriate state handler
if ($state == STATE_NORMAL) {
- if (/$doc_start/o) {
- $state = STATE_NAME; # next line is always the function name
- $in_doc_sect = 0;
- $declaration_start_line = $. + 1;
- }
- } elsif ($state == STATE_NAME) {# this line is the function name (always)
- if (/$doc_block/o) {
- $state = STATE_DOCBLOCK;
- $contents = "";
- $new_start_line = $. + 1;
-
- if ( $1 eq "" ) {
- $section = $section_intro;
- } else {
- $section = $1;
- }
- }
- elsif (/$doc_decl/o) {
- $identifier = $1;
- if (/\s*([\w\s]+?)\s*-/) {
- $identifier = $1;
- }
-
- $state = STATE_FIELD;
- # if there's no @param blocks need to set up default section
- # here
- $contents = "";
- $section = $section_default;
- $new_start_line = $. + 1;
- if (/-(.*)/) {
- # strip leading/trailing/multiple spaces
- $descr= $1;
- $descr =~ s/^\s*//;
- $descr =~ s/\s*$//;
- $descr =~ s/\s+/ /g;
- $declaration_purpose = xml_escape($descr);
- $in_purpose = 1;
- } else {
- $declaration_purpose = "";
- }
-
- if (($declaration_purpose eq "") && $verbose) {
- print STDERR "${file}:$.: warning: missing initial short description on line:\n";
- print STDERR $_;
- ++$warnings;
- }
-
- if ($identifier =~ m/^struct/) {
- $decl_type = 'struct';
- } elsif ($identifier =~ m/^union/) {
- $decl_type = 'union';
- } elsif ($identifier =~ m/^enum/) {
- $decl_type = 'enum';
- } elsif ($identifier =~ m/^typedef/) {
- $decl_type = 'typedef';
- } else {
- $decl_type = 'function';
- }
-
- if ($verbose) {
- print STDERR "${file}:$.: info: Scanning doc for $identifier\n";
- }
- } else {
- print STDERR "${file}:$.: warning: Cannot understand $_ on line $.",
- " - I thought it was a doc line\n";
- ++$warnings;
- $state = STATE_NORMAL;
- }
- } elsif ($state == STATE_FIELD) { # look for head: lines, and include content
- if (/$doc_sect/i) { # case insensitive for supported section names
- $newsection = $1;
- $newcontents = $2;
-
- # map the supported section names to the canonical names
- if ($newsection =~ m/^description$/i) {
- $newsection = $section_default;
- } elsif ($newsection =~ m/^context$/i) {
- $newsection = $section_context;
- } elsif ($newsection =~ m/^returns?$/i) {
- $newsection = $section_return;
- } elsif ($newsection =~ m/^\@return$/) {
- # special: @return is a section, not a param description
- $newsection = $section_return;
- }
-
- if (($contents ne "") && ($contents ne "\n")) {
- if (!$in_doc_sect && $verbose) {
- print STDERR "${file}:$.: warning: contents before sections\n";
- ++$warnings;
- }
- dump_section($file, $section, xml_escape($contents));
- $section = $section_default;
- }
-
- $in_doc_sect = 1;
- $in_purpose = 0;
- $contents = $newcontents;
- $new_start_line = $.;
- while (substr($contents, 0, 1) eq " ") {
- $contents = substr($contents, 1);
- }
- if ($contents ne "") {
- $contents .= "\n";
- }
- $section = $newsection;
- $leading_space = undef;
- } elsif (/$doc_end/) {
- if (($contents ne "") && ($contents ne "\n")) {
- dump_section($file, $section, xml_escape($contents));
- $section = $section_default;
- $contents = "";
- }
- # look for doc_com + <text> + doc_end:
- if ($_ =~ m'\s*\*\s*[a-zA-Z_0-9:\.]+\*/') {
- print STDERR "${file}:$.: warning: suspicious ending line: $_";
- ++$warnings;
- }
-
- $prototype = "";
- $state = STATE_PROTO;
- $brcount = 0;
-# print STDERR "end of doc comment, looking for prototype\n";
- } elsif (/$doc_content/) {
- # miguel-style comment kludge, look for blank lines after
- # @parameter line to signify start of description
- if ($1 eq "") {
- if ($section =~ m/^@/ || $section eq $section_context) {
- dump_section($file, $section, xml_escape($contents));
- $section = $section_default;
- $contents = "";
- $new_start_line = $.;
- } else {
- $contents .= "\n";
- }
- $in_purpose = 0;
- } elsif ($in_purpose == 1) {
- # Continued declaration purpose
- chomp($declaration_purpose);
- $declaration_purpose .= " " . xml_escape($1);
- $declaration_purpose =~ s/\s+/ /g;
- } else {
- my $cont = $1;
- if ($section =~ m/^@/ || $section eq $section_context) {
- if (!defined $leading_space) {
- if ($cont =~ m/^(\s+)/) {
- $leading_space = $1;
- } else {
- $leading_space = "";
- }
- }
-
- $cont =~ s/^$leading_space//;
- }
- $contents .= $cont . "\n";
- }
- } else {
- # i dont know - bad line? ignore.
- print STDERR "${file}:$.: warning: bad line: $_";
- ++$warnings;
- }
+ process_normal();
+ } elsif ($state == STATE_NAME) {
+ process_name($file, $_);
+ } elsif ($state == STATE_BODY || $state == STATE_BODY_MAYBE) {
+ process_body($file, $_);
} elsif ($state == STATE_INLINE) { # scanning for inline parameters
- # First line (state 1) needs to be a @parameter
- if ($inline_doc_state == STATE_INLINE_NAME && /$doc_inline_sect/o) {
- $section = $1;
- $contents = $2;
- $new_start_line = $.;
- if ($contents ne "") {
- while (substr($contents, 0, 1) eq " ") {
- $contents = substr($contents, 1);
- }
- $contents .= "\n";
- }
- $inline_doc_state = STATE_INLINE_TEXT;
- # Documentation block end */
- } elsif (/$doc_inline_end/) {
- if (($contents ne "") && ($contents ne "\n")) {
- dump_section($file, $section, xml_escape($contents));
- $section = $section_default;
- $contents = "";
- }
- $state = STATE_PROTO;
- $inline_doc_state = STATE_INLINE_NA;
- # Regular text
- } elsif (/$doc_content/) {
- if ($inline_doc_state == STATE_INLINE_TEXT) {
- $contents .= $1 . "\n";
- # nuke leading blank lines
- if ($contents =~ /^\s*$/) {
- $contents = "";
- }
- } elsif ($inline_doc_state == STATE_INLINE_NAME) {
- $inline_doc_state = STATE_INLINE_ERROR;
- print STDERR "${file}:$.: warning: ";
- print STDERR "Incorrect use of kernel-doc format: $_";
- ++$warnings;
- }
- }
- } elsif ($state == STATE_PROTO) { # scanning for function '{' (end of prototype)
- if (/$doc_inline_oneline/) {
- $section = $1;
- $contents = $2;
- if ($contents ne "") {
- $contents .= "\n";
- dump_section($file, $section, xml_escape($contents));
- $section = $section_default;
- $contents = "";
- }
- } elsif (/$doc_inline_start/) {
- $state = STATE_INLINE;
- $inline_doc_state = STATE_INLINE_NAME;
- } elsif ($decl_type eq 'function') {
- process_proto_function($_, $file);
- } else {
- process_proto_type($_, $file);
- }
+ process_inline($file, $_);
+ } elsif ($state == STATE_PROTO) {
+ process_proto($file, $_);
} elsif ($state == STATE_DOCBLOCK) {
- if (/$doc_end/)
- {
- dump_doc_section($file, $section, xml_escape($contents));
- $section = $section_default;
- $contents = "";
- $function = "";
- %parameterdescs = ();
- %parametertypes = ();
- @parameterlist = ();
- %sections = ();
- @sectionlist = ();
- $prototype = "";
- $state = STATE_NORMAL;
- }
- elsif (/$doc_content/)
- {
- if ( $1 eq "" )
- {
- $contents .= $blankline;
- }
- else
- {
- $contents .= $1 . "\n";
- }
- }
+ process_docblock($file, $_);
}
}
+
+ # Make sure we got something interesting.
if ($initial_section_counter == $section_counter) {
if ($output_mode ne "none") {
print STDERR "${file}:1: warning: no structured comments found\n";
--
2.7.4

View File

@ -1,56 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xose Vazquez Perez <xose.vazquez@gmail.com>
Date: Mon, 14 May 2018 17:30:17 +0200
Subject: [PATCH] multipath-tools: configure hitachi ams2000 and hus100 as full
active arrays
AMS2000 and HUS100 families are active/active arrays.
Based on https://support.hitachivantara.com/download/epcra/df818913.pdf
and internal hitachi docs.
Cc: Matthias Rudolph <Matthias.Rudolph@hitachivantara.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM-DEV ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/hwtable.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index 2ca6888..148f0ba 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -398,13 +398,13 @@ static struct hwentry default_hw[] = {
* Mail : matthias.rudolph@hds.com
*/
{
- /* USP-V, HUS VM, VSP, VSP G1X00 and VSP GX00 families */
+ /* USP-V, HUS VM, VSP, VSP G1X00 and VSP GX00 families / HP XP */
.vendor = "(HITACHI|HP)",
.product = "^OPEN-",
.pgpolicy = MULTIBUS,
},
{
- /* AMS 2000 and HUS 100 families */
+ /* AMS other than AMS 2000 */
.vendor = "HITACHI",
.product = "^DF",
.no_path_retry = NO_PATH_RETRY_QUEUE,
@@ -412,6 +412,12 @@ static struct hwentry default_hw[] = {
.pgfailback = -FAILBACK_IMMEDIATE,
.prio_name = PRIO_HDS,
},
+ {
+ /* AMS 2000 and HUS 100 families */
+ .vendor = "HITACHI",
+ .product = "^DF600F",
+ .pgpolicy = MULTIBUS,
+ },
/*
* IBM
*
--
2.7.4

View File

@ -1,42 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Wed, 21 Mar 2018 10:34:18 +0100
Subject: [PATCH] libmultipath: don't reject maps with undefined prio
libmultipath's prio routines can deal with pp->priority == PRIO_UNDEF
just fine. PRIO_UNDEF is just a very low priority. So there's
no reason to reject setting up a multipath map because paths have
undefined priority.
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/configure.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index 5796683..5c54f9b 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -1063,9 +1063,6 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid,
continue;
}
- if (pp1->priority == PRIO_UNDEF)
- mpp->action = ACT_REJECT;
-
if (!mpp->paths) {
condlog(0, "%s: skip coalesce (no paths)", mpp->alias);
remove_map(mpp, vecs, 0);
@@ -1091,8 +1088,6 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid,
mpp->size);
mpp->action = ACT_REJECT;
}
- if (pp2->priority == PRIO_UNDEF)
- mpp->action = ACT_REJECT;
}
verify_paths(mpp, vecs);
--
2.7.4

View File

@ -1,57 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Wed, 21 Mar 2018 10:34:19 +0100
Subject: [PATCH] multipathd: handle errors in uxlsnr as fatal
The ppoll() calls of the uxlsnr thread are vital for proper functioning of
multipathd. If the uxlsnr thread can't open the socket or fails to call ppoll()
for other reasons, quit the daemon. If we don't do that, multipathd may
hang in a state where it can't be terminated any more, because the uxlsnr
thread is responsible for handling all signals. This happens e.g. if
systemd's multipathd.socket is running in and multipathd is started from
outside systemd.
24f2844 "multipathd: fix signal blocking logic" has made this problem more
severe. Before that patch, the signals weren't actually blocked in any thread.
That's not to say 24f2844 was wrong. I still think it's correct, we just
need this one on top.
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipathd/uxlsnr.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c
index cdafd82..6f66666 100644
--- a/multipathd/uxlsnr.c
+++ b/multipathd/uxlsnr.c
@@ -178,7 +178,7 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, void * trigger_data)
if (ux_sock == -1) {
condlog(1, "could not create uxsock: %d", errno);
- return NULL;
+ exit_daemon();
}
pthread_cleanup_push(uxsock_cleanup, (void *)ux_sock);
@@ -187,7 +187,7 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, void * trigger_data)
polls = (struct pollfd *)MALLOC((MIN_POLLS + 1) * sizeof(struct pollfd));
if (!polls) {
condlog(0, "uxsock: failed to allocate poll fds");
- return NULL;
+ exit_daemon();
}
sigfillset(&mask);
sigdelset(&mask, SIGINT);
@@ -249,6 +249,7 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, void * trigger_data)
/* something went badly wrong! */
condlog(0, "uxsock: poll failed with %d", errno);
+ exit_daemon();
break;
}
--
2.7.4

View File

@ -1,36 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Tue, 15 May 2018 14:32:44 +0200
Subject: [PATCH] libmultipath: fix error parsing "find_multipaths strict"
If "find_multipaths strict" is set in multipath.conf, the error message
"illegal value for find_multipaths: strict" is printed. This causes no
functional problem, as "strict" happens to be the default, fallback
value. It should be fixed nonetheless. FIND_MULTIPATHS_STRICT, having
the highest numeric value, must be last in the enum.
Fixes: c36f2f42 "libmultipath: change find_multipaths option to multi-value"
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/structs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
index eb6a178..e424b15 100644
--- a/libmultipath/structs.h
+++ b/libmultipath/structs.h
@@ -122,9 +122,9 @@ enum find_multipaths_states {
FIND_MULTIPATHS_UNDEF = YNU_UNDEF,
FIND_MULTIPATHS_OFF = YNU_NO,
FIND_MULTIPATHS_ON = _FIND_MULTIPATHS_F,
- FIND_MULTIPATHS_STRICT = _FIND_MULTIPATHS_F|_FIND_MULTIPATHS_N,
FIND_MULTIPATHS_GREEDY = _FIND_MULTIPATHS_I,
FIND_MULTIPATHS_SMART = _FIND_MULTIPATHS_F|_FIND_MULTIPATHS_I,
+ FIND_MULTIPATHS_STRICT = _FIND_MULTIPATHS_F|_FIND_MULTIPATHS_N,
__FIND_MULTIPATHS_LAST,
};
--
2.7.4

View File

@ -1,40 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Mon, 7 May 2018 17:16:05 -0500
Subject: [PATCH] libmultipath: print correct default for delay_*_checks
These options default to "no", so they should display that when the
config is printed.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/dict.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index 4040611..3e7c5d6 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -1115,7 +1115,8 @@ print_off_int_undef(char * buff, int len, long v)
}
declare_def_handler(delay_watch_checks, set_off_int_undef)
-declare_def_snprint(delay_watch_checks, print_off_int_undef)
+declare_def_snprint_defint(delay_watch_checks, print_off_int_undef,
+ DEFAULT_DELAY_CHECKS)
declare_ovr_handler(delay_watch_checks, set_off_int_undef)
declare_ovr_snprint(delay_watch_checks, print_off_int_undef)
declare_hw_handler(delay_watch_checks, set_off_int_undef)
@@ -1123,7 +1124,8 @@ declare_hw_snprint(delay_watch_checks, print_off_int_undef)
declare_mp_handler(delay_watch_checks, set_off_int_undef)
declare_mp_snprint(delay_watch_checks, print_off_int_undef)
declare_def_handler(delay_wait_checks, set_off_int_undef)
-declare_def_snprint(delay_wait_checks, print_off_int_undef)
+declare_def_snprint_defint(delay_wait_checks, print_off_int_undef,
+ DEFAULT_DELAY_CHECKS)
declare_ovr_handler(delay_wait_checks, set_off_int_undef)
declare_ovr_snprint(delay_wait_checks, print_off_int_undef)
declare_hw_handler(delay_wait_checks, set_off_int_undef)
--
2.7.4

View File

@ -1,31 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 9 May 2018 14:32:59 -0500
Subject: [PATCH] multipath.conf.5: clarify property whitelist handling
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipath/multipath.conf.5 | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
index f689795..96d1b66 100644
--- a/multipath/multipath.conf.5
+++ b/multipath/multipath.conf.5
@@ -1181,10 +1181,9 @@ and
keywords. For a full description of these keywords please see the \fIdevices\fR
section description.
.LP
-The \fIproperty\fR blacklist and whitelist handling is different from the usual
-handling in the sense that the whitelist \fIhas\fR to be set, otherwise the
-device will be blacklisted. In these cases the message \fIblacklisted, udev
-property missing\fR will be displayed.
+The \fIproperty\fR whitelist handling is different from the usual
+handling in the sense that the device \fIhas\fR to have a udev property that
+matches the whitelist, otherwise the device will be blacklisted. In these cases the message \fIblacklisted, udev property missing\fR will be displayed.
.
.
.\" ----------------------------------------------------------------------------
--
2.7.4

View File

@ -1,317 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Thu, 31 May 2018 17:47:11 -0500
Subject: [PATCH] mpathpersist: add all_tg_pt option
Some arrays, such as the EMC VNX, don't follow the scsi persistent
reservations spec in making key registrations per I_T NEXUS. Instead,
the registration is shared by all target ports connected to a given
host. This causes mpathpersist to fail whenever it tries to register a
key, since it will receive a registration conflict on some of the paths.
To deal with this, mpathpersist needs to track the hosts that it has
done a registration on, and only register once per host. The new
"all_tg_pt" multipath.conf option is used to set which arrays need this
feature. I currently don't know if all EMC VNX arrays handle persistent
reservations like this, or if it is configurable. A future patch will
update the VNX built-in config, if this is indeed their default (or
only) setting.
Multipathd doesn't need to worry about this. It is often the case that
when a path device comes back, it will still have the keys registered to
it. Because of this, multipathd uses register-and-ignore, which means
that it won't cause an error if the registration has already happened
down a different target port.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmpathpersist/mpath_persist.c | 28 ++++++++++++++++++++++------
libmultipath/config.c | 2 ++
libmultipath/config.h | 2 ++
libmultipath/defaults.h | 1 +
libmultipath/dict.c | 10 ++++++++++
libmultipath/propsel.c | 15 +++++++++++++++
libmultipath/propsel.h | 1 +
libmultipath/structs.h | 7 +++++++
multipath/multipath.conf.5 | 11 +++++++++++
9 files changed, 71 insertions(+), 6 deletions(-)
diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c
index 907a17c..ca91c55 100644
--- a/libmpathpersist/mpath_persist.c
+++ b/libmpathpersist/mpath_persist.c
@@ -335,6 +335,7 @@ int mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope,
conf = get_multipath_config();
select_reservation_key(conf, mpp);
+ select_all_tg_pt(conf, mpp);
put_multipath_config(conf);
memcpy(&prkey, paramp->sa_key, 8);
@@ -456,7 +457,7 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope,
unsigned int rq_type, struct prout_param_descriptor * paramp, int noisy)
{
- int i, j;
+ int i, j, k;
struct pathgroup *pgp = NULL;
struct path *pp = NULL;
int rollback = 0;
@@ -481,11 +482,13 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope,
}
struct threadinfo thread[active_pathcount];
+ int hosts[active_pathcount];
memset(thread, 0, sizeof(thread));
/* init thread parameter */
for (i =0; i< active_pathcount; i++){
+ hosts[i] = -1;
thread[i].param.rq_servact = rq_servact;
thread[i].param.rq_scope = rq_scope;
thread[i].param.rq_type = rq_type;
@@ -514,6 +517,17 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope,
condlog (1, "%s: %s path not up. Skip.", mpp->wwid, pp->dev);
continue;
}
+ if (mpp->all_tg_pt == ALL_TG_PT_ON &&
+ pp->sg_id.host_no != -1) {
+ for (k = 0; k < count; k++) {
+ if (pp->sg_id.host_no == hosts[k]) {
+ condlog(3, "%s: %s host %d matches skip.", pp->wwid, pp->dev, pp->sg_id.host_no);
+ break;
+ }
+ }
+ if (k < count)
+ continue;
+ }
strncpy(thread[count].param.dev, pp->dev,
FILE_NAME_SIZE - 1);
@@ -531,10 +545,12 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope,
condlog (0, "%s: failed to create thread %d", mpp->wwid, rc);
thread[count].param.status = MPATH_PR_THREAD_ERROR;
}
+ else
+ hosts[count] = pp->sg_id.host_no;
count = count + 1;
}
}
- for( i=0; i < active_pathcount ; i++){
+ for( i=0; i < count ; i++){
if (thread[i].param.status != MPATH_PR_THREAD_ERROR) {
rc = pthread_join(thread[i].id, NULL);
if (rc){
@@ -557,7 +573,7 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope,
}
if (rollback && ((rq_servact == MPATH_PROUT_REG_SA) && sa_key != 0 )){
condlog (3, "%s: ERROR: initiating pr out rollback", mpp->wwid);
- for( i=0 ; i < active_pathcount ; i++){
+ for( i=0 ; i < count ; i++){
if(thread[i].param.status == MPATH_PR_SUCCESS) {
memcpy(&thread[i].param.paramp->key, &thread[i].param.paramp->sa_key, 8);
memset(&thread[i].param.paramp->sa_key, 0, 8);
@@ -571,7 +587,7 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope,
} else
thread[i].param.status = MPATH_PR_SKIP;
}
- for(i=0; i < active_pathcount ; i++){
+ for(i=0; i < count ; i++){
if (thread[i].param.status != MPATH_PR_SKIP &&
thread[i].param.status != MPATH_PR_THREAD_ERROR) {
rc = pthread_join(thread[i].id, NULL);
@@ -720,7 +736,7 @@ int mpath_prout_rel(struct multipath *mpp,int rq_servact, int rq_scope,
}
}
pthread_attr_destroy (&attr);
- for (i = 0; i < active_pathcount; i++){
+ for (i = 0; i < count; i++){
if (thread[i].param.status != MPATH_PR_THREAD_ERROR) {
rc = pthread_join (thread[i].id, NULL);
if (rc){
@@ -729,7 +745,7 @@ int mpath_prout_rel(struct multipath *mpp,int rq_servact, int rq_scope,
}
}
- for (i = 0; i < active_pathcount; i++){
+ for (i = 0; i < count; i++){
/* check thread status here and return the status */
if (thread[i].param.status == MPATH_PR_RESERV_CONFLICT)
diff --git a/libmultipath/config.c b/libmultipath/config.c
index 085a3e1..5872927 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -352,6 +352,7 @@ merge_hwe (struct hwentry * dst, struct hwentry * src)
merge_num(skip_kpartx);
merge_num(max_sectors_kb);
merge_num(ghost_delay);
+ merge_num(all_tg_pt);
snprintf(id, sizeof(id), "%s/%s", dst->vendor, dst->product);
reconcile_features_with_options(id, &dst->features,
@@ -622,6 +623,7 @@ load_config (char * file)
conf->disable_changed_wwids = DEFAULT_DISABLE_CHANGED_WWIDS;
conf->remove_retries = 0;
conf->ghost_delay = DEFAULT_GHOST_DELAY;
+ conf->all_tg_pt = DEFAULT_ALL_TG_PT;
/*
* preload default hwtable
diff --git a/libmultipath/config.h b/libmultipath/config.h
index 6e69a37..1bf708a 100644
--- a/libmultipath/config.h
+++ b/libmultipath/config.h
@@ -82,6 +82,7 @@ struct hwentry {
int skip_kpartx;
int max_sectors_kb;
int ghost_delay;
+ int all_tg_pt;
char * bl_product;
};
@@ -194,6 +195,7 @@ struct config {
char * partition_delim;
char * config_dir;
int prkey_source;
+ int all_tg_pt;
struct be64 reservation_key;
vector keywords;
diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
index d7b87b4..f076b4b 100644
--- a/libmultipath/defaults.h
+++ b/libmultipath/defaults.h
@@ -43,6 +43,7 @@
#define DEFAULT_GHOST_DELAY GHOST_DELAY_OFF
#define DEFAULT_FIND_MULTIPATHS_TIMEOUT -10
#define DEFAULT_UNKNOWN_FIND_MULTIPATHS_TIMEOUT 1
+#define DEFAULT_ALL_TG_PT ALL_TG_PT_OFF
#define DEFAULT_CHECKINT 5
#define MAX_CHECKINT(a) (a << 2)
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index 3e7c5d6..2557b8a 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -1178,6 +1178,13 @@ declare_hw_snprint(ghost_delay, print_off_int_undef)
declare_mp_handler(ghost_delay, set_off_int_undef)
declare_mp_snprint(ghost_delay, print_off_int_undef)
+declare_def_handler(all_tg_pt, set_yes_no_undef)
+declare_def_snprint_defint(all_tg_pt, print_yes_no_undef, DEFAULT_ALL_TG_PT)
+declare_ovr_handler(all_tg_pt, set_yes_no_undef)
+declare_ovr_snprint(all_tg_pt, print_yes_no_undef)
+declare_hw_handler(all_tg_pt, set_yes_no_undef)
+declare_hw_snprint(all_tg_pt, print_yes_no_undef)
+
static int
def_uxsock_timeout_handler(struct config *conf, vector strvec)
@@ -1509,6 +1516,7 @@ init_keywords(vector keywords)
install_keyword("prkeys_file", &def_prkeys_file_handler, &snprint_def_prkeys_file);
install_keyword("log_checker_err", &def_log_checker_err_handler, &snprint_def_log_checker_err);
install_keyword("reservation_key", &def_reservation_key_handler, &snprint_def_reservation_key);
+ install_keyword("all_tg_pt", &def_all_tg_pt_handler, &snprint_def_all_tg_pt);
install_keyword("retain_attached_hw_handler", &def_retain_hwhandler_handler, &snprint_def_retain_hwhandler);
install_keyword("detect_prio", &def_detect_prio_handler, &snprint_def_detect_prio);
install_keyword("detect_checker", &def_detect_checker_handler, &snprint_def_detect_checker);
@@ -1618,6 +1626,7 @@ init_keywords(vector keywords)
install_keyword("skip_kpartx", &hw_skip_kpartx_handler, &snprint_hw_skip_kpartx);
install_keyword("max_sectors_kb", &hw_max_sectors_kb_handler, &snprint_hw_max_sectors_kb);
install_keyword("ghost_delay", &hw_ghost_delay_handler, &snprint_hw_ghost_delay);
+ install_keyword("all_tg_pt", &hw_all_tg_pt_handler, &snprint_hw_all_tg_pt);
install_sublevel_end();
install_keyword_root("overrides", &overrides_handler);
@@ -1654,6 +1663,7 @@ init_keywords(vector keywords)
install_keyword("skip_kpartx", &ovr_skip_kpartx_handler, &snprint_ovr_skip_kpartx);
install_keyword("max_sectors_kb", &ovr_max_sectors_kb_handler, &snprint_ovr_max_sectors_kb);
install_keyword("ghost_delay", &ovr_ghost_delay_handler, &snprint_ovr_ghost_delay);
+ install_keyword("all_tg_pt", &ovr_all_tg_pt_handler, &snprint_ovr_all_tg_pt);
install_keyword_root("multipaths", &multipaths_handler);
install_keyword_multi("multipath", &multipath_handler, NULL);
diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
index 627d366..9ca1355 100644
--- a/libmultipath/propsel.c
+++ b/libmultipath/propsel.c
@@ -978,3 +978,18 @@ out:
pp->dev, pp->find_multipaths_timeout, origin);
return 0;
}
+
+int select_all_tg_pt (struct config *conf, struct multipath * mp)
+{
+ const char *origin;
+
+ mp_set_ovr(all_tg_pt);
+ mp_set_hwe(all_tg_pt);
+ mp_set_conf(all_tg_pt);
+ mp_set_default(all_tg_pt, DEFAULT_ALL_TG_PT);
+out:
+ condlog(3, "%s: all_tg_pt = %s %s", mp->alias,
+ (mp->all_tg_pt == ALL_TG_PT_ON)? "yes" : "no",
+ origin);
+ return 0;
+}
diff --git a/libmultipath/propsel.h b/libmultipath/propsel.h
index a022bee..ae99b92 100644
--- a/libmultipath/propsel.h
+++ b/libmultipath/propsel.h
@@ -34,3 +34,4 @@ int select_ghost_delay(struct config *conf, struct multipath * mp);
void reconcile_features_with_options(const char *id, char **features,
int* no_path_retry,
int *retain_hwhandler);
+int select_all_tg_pt (struct config *conf, struct multipath * mp);
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
index e424b15..0194b1e 100644
--- a/libmultipath/structs.h
+++ b/libmultipath/structs.h
@@ -217,6 +217,12 @@ enum prkey_sources {
PRKEY_SOURCE_FILE,
};
+enum all_tg_pt_states {
+ ALL_TG_PT_UNDEF = YNU_UNDEF,
+ ALL_TG_PT_OFF = YNU_NO,
+ ALL_TG_PT_ON = YNU_YES,
+};
+
struct sg_id {
int host_no;
int channel;
@@ -362,6 +368,7 @@ struct multipath {
int prkey_source;
struct be64 reservation_key;
unsigned char prflag;
+ int all_tg_pt;
struct gen_multipath generic_mp;
};
diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
index 96d1b66..0c1f174 100644
--- a/multipath/multipath.conf.5
+++ b/multipath/multipath.conf.5
@@ -743,6 +743,17 @@ The default is: \fB<unset>\fR
.
.
.TP
+.B all_tg_pt
+This must be set to \fByes\fR to successfully use mpathpersist on arrays that
+automatically set and clear registration keys on all target ports from a
+host, instead of per target port per host.
+.RS
+.TP
+The default is: \fBno\fR
+.RE
+.
+.
+.TP
.B retain_attached_hw_handler
(Obsolete for kernels >= 4.3) If set to
.I yes
--
2.7.4

View File

@ -1,543 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Mon, 4 Jun 2018 22:04:44 -0500
Subject: [PATCH] mpathpersist: fix aptpl support
The "Active Persist Through Power Loss" flag must be set whenever a key
is registered. However, there is no way for multipathd to know if this
was set by mpathpersist. The result is that if a path goes down and
comes back up (or if it wasn't up when mpathpersist was first run)
multipathd will clear the aptpl flag when it reregisters the key on it.
To fix this, multipath.conf now accepts an optional ":aptpl" appended
on the reservation_key value. If this is added to the reservation_key
multipathd will set the aptpl flag when it reregisters the key. If
reservation_key is set to "file", this will automatically be tracked
in the /etc/multipath/prkeys file.
To track this flag in the prkeys file, without changing the format
I've made "0x<key>" stand for non-aptpl keys, and "0X<key>" stand
for aptpl keys. Since previously, all keys used a lower-case x, this
will default to the current behavior for existing keys. Obviously, the
next time mpathpersist is run, this will be changed if --param-aptpl
is used. Since there are no more flags that are in sg_persist that
multipathd needs to care about in mpathpersist, there shouldn't need
to be any more flags added to the prkeys file.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmpathpersist/mpath_persist.c | 3 ++-
libmpathpersist/mpath_updatepr.c | 11 +++++++----
libmpathpersist/mpathpr.h | 3 ++-
libmultipath/Makefile | 2 +-
libmultipath/config.h | 2 ++
libmultipath/dict.c | 23 +++++++++++++++++++----
libmultipath/dict.h | 3 ++-
libmultipath/prkey.c | 27 ++++++++++++++++++++++++---
libmultipath/prkey.h | 6 ++++--
libmultipath/propsel.c | 6 ++++--
libmultipath/structs.h | 1 +
libmultipath/util.c | 16 ++++++++++++++++
libmultipath/util.h | 1 +
multipath/multipath.conf.5 | 7 +++++--
multipathd/cli_handlers.c | 15 ++++++++++-----
multipathd/main.c | 1 +
16 files changed, 101 insertions(+), 26 deletions(-)
diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c
index ca91c55..6e9e67f 100644
--- a/libmpathpersist/mpath_persist.c
+++ b/libmpathpersist/mpath_persist.c
@@ -344,7 +344,8 @@ int mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope,
rq_servact == MPATH_PROUT_REG_SA) ||
rq_servact == MPATH_PROUT_REG_IGN_SA)) {
memcpy(&mpp->reservation_key, paramp->sa_key, 8);
- if (update_prkey(alias, get_be64(mpp->reservation_key))) {
+ if (update_prkey_flags(alias, get_be64(mpp->reservation_key),
+ paramp->sa_flags)) {
condlog(0, "%s: failed to set prkey for multipathd.",
alias);
ret = MPATH_PR_DMMP_ERROR;
diff --git a/libmpathpersist/mpath_updatepr.c b/libmpathpersist/mpath_updatepr.c
index 8063e90..0aca28e 100644
--- a/libmpathpersist/mpath_updatepr.c
+++ b/libmpathpersist/mpath_updatepr.c
@@ -1,7 +1,5 @@
#include <stdio.h>
#include <unistd.h>
-#include <errno.h>
-
#include <stdlib.h>
#include <stdarg.h>
#include <fcntl.h>
@@ -11,6 +9,8 @@
#include <sys/un.h>
#include <poll.h>
#include <errno.h>
+#include <libudev.h>
+#include <mpath_persist.h>
#include "debug.h"
#include "mpath_cmd.h"
#include "uxsock.h"
@@ -59,11 +59,14 @@ int update_prflag(char *mapname, int set) {
return do_update_pr(mapname, (set)? "setprstatus" : "unsetprstatus");
}
-int update_prkey(char *mapname, uint64_t prkey) {
+int update_prkey_flags(char *mapname, uint64_t prkey, uint8_t sa_flags) {
char str[256];
+ char *flagstr = "";
+ if (sa_flags & MPATH_F_APTPL_MASK)
+ flagstr = ":aptpl";
if (prkey)
- sprintf(str, "setprkey key %" PRIx64, prkey);
+ sprintf(str, "setprkey key %" PRIx64 "%s", prkey, flagstr);
else
sprintf(str, "unsetprkey");
return do_update_pr(mapname, str);
diff --git a/libmpathpersist/mpathpr.h b/libmpathpersist/mpathpr.h
index 72feb60..5ea8cd6 100644
--- a/libmpathpersist/mpathpr.h
+++ b/libmpathpersist/mpathpr.h
@@ -46,7 +46,8 @@ int send_prout_activepath(char * dev, int rq_servact, int rq_scope,
unsigned int rq_type, struct prout_param_descriptor * paramp, int noisy);
int update_prflag(char *mapname, int set);
-int update_prkey(char *mapname, uint64_t prkey);
+int update_prkey_flags(char *mapname, uint64_t prkey, uint8_t sa_flags);
+#define update_prkey(mapname, prkey) update_prkey_flags(mapname, prkey, 0)
void * mpath_alloc_prin_response(int prin_sa);
int update_map_pr(struct multipath *mpp);
diff --git a/libmultipath/Makefile b/libmultipath/Makefile
index f51786d..33f5269 100644
--- a/libmultipath/Makefile
+++ b/libmultipath/Makefile
@@ -7,7 +7,7 @@ SONAME = 0
DEVLIB = libmultipath.so
LIBS = $(DEVLIB).$(SONAME)
-CFLAGS += $(LIB_CFLAGS) -I$(mpathcmddir)
+CFLAGS += $(LIB_CFLAGS) -I$(mpathcmddir) -I$(mpathpersistdir)
LIBDEPS += -lpthread -ldl -ldevmapper -ludev -L$(mpathcmddir) -lmpathcmd -lurcu -laio
diff --git a/libmultipath/config.h b/libmultipath/config.h
index 1bf708a..fcbe3fc 100644
--- a/libmultipath/config.h
+++ b/libmultipath/config.h
@@ -98,6 +98,7 @@ struct mpentry {
char * prio_args;
int prkey_source;
struct be64 reservation_key;
+ uint8_t sa_flags;
int pgpolicy;
int pgfailback;
int rr_weight;
@@ -197,6 +198,7 @@ struct config {
int prkey_source;
int all_tg_pt;
struct be64 reservation_key;
+ uint8_t sa_flags;
vector keywords;
vector mptable;
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index 2557b8a..7ad0f5a 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -22,6 +22,8 @@
#include "util.h"
#include <errno.h>
#include <inttypes.h>
+#include <libudev.h>
+#include <mpath_persist.h>
#include "mpath_cmd.h"
#include "dict.h"
@@ -1012,10 +1014,12 @@ snprint_def_log_checker_err (struct config *conf, char * buff, int len,
}
static int
-set_reservation_key(vector strvec, struct be64 *be64_ptr, int *source_ptr)
+set_reservation_key(vector strvec, struct be64 *be64_ptr, uint8_t *flags_ptr,
+ int *source_ptr)
{
char *buff;
uint64_t prkey;
+ uint8_t sa_flags;
buff = set_value(strvec);
if (!buff)
@@ -1023,35 +1027,43 @@ set_reservation_key(vector strvec, struct be64 *be64_ptr, int *source_ptr)
if (strcmp(buff, "file") == 0) {
*source_ptr = PRKEY_SOURCE_FILE;
+ *flags_ptr = 0;
put_be64(*be64_ptr, 0);
FREE(buff);
return 0;
}
- if (parse_prkey(buff, &prkey) != 0) {
+ if (parse_prkey_flags(buff, &prkey, &sa_flags) != 0) {
FREE(buff);
return 1;
}
*source_ptr = PRKEY_SOURCE_CONF;
+ *flags_ptr = sa_flags;
put_be64(*be64_ptr, prkey);
FREE(buff);
return 0;
}
int
-print_reservation_key(char * buff, int len, struct be64 key, int source)
+print_reservation_key(char * buff, int len, struct be64 key, uint8_t flags,
+ int source)
{
+ char *flagstr = "";
if (source == PRKEY_SOURCE_NONE)
return 0;
if (source == PRKEY_SOURCE_FILE)
return snprintf(buff, len, "file");
- return snprintf(buff, len, "0x%" PRIx64, get_be64(key));
+ if (flags & MPATH_F_APTPL_MASK)
+ flagstr = ":aptpl";
+ return snprintf(buff, len, "0x%" PRIx64 "%s", get_be64(key),
+ flagstr);
}
static int
def_reservation_key_handler(struct config *conf, vector strvec)
{
return set_reservation_key(strvec, &conf->reservation_key,
+ &conf->sa_flags,
&conf->prkey_source);
}
@@ -1060,6 +1072,7 @@ snprint_def_reservation_key (struct config *conf, char * buff, int len,
const void * data)
{
return print_reservation_key(buff, len, conf->reservation_key,
+ conf->sa_flags,
conf->prkey_source);
}
@@ -1070,6 +1083,7 @@ mp_reservation_key_handler(struct config *conf, vector strvec)
if (!mpe)
return 1;
return set_reservation_key(strvec, &mpe->reservation_key,
+ &mpe->sa_flags,
&mpe->prkey_source);
}
@@ -1079,6 +1093,7 @@ snprint_mp_reservation_key (struct config *conf, char * buff, int len,
{
const struct mpentry * mpe = (const struct mpentry *)data;
return print_reservation_key(buff, len, mpe->reservation_key,
+ mpe->sa_flags,
mpe->prkey_source);
}
diff --git a/libmultipath/dict.h b/libmultipath/dict.h
index 7564892..a40ac66 100644
--- a/libmultipath/dict.h
+++ b/libmultipath/dict.h
@@ -15,6 +15,7 @@ int print_pgpolicy(char *buff, int len, long v);
int print_no_path_retry(char *buff, int len, long v);
int print_fast_io_fail(char *buff, int len, long v);
int print_dev_loss(char *buff, int len, unsigned long v);
-int print_reservation_key(char * buff, int len, struct be64 key, int source);
+int print_reservation_key(char * buff, int len, struct be64 key, uint8_t
+ flags, int source);
int print_off_int_undef(char *buff, int len, long v);
#endif /* _DICT_H */
diff --git a/libmultipath/prkey.c b/libmultipath/prkey.c
index 89b90ed..d645f81 100644
--- a/libmultipath/prkey.c
+++ b/libmultipath/prkey.c
@@ -11,6 +11,8 @@
#include <string.h>
#include <inttypes.h>
#include <errno.h>
+#include <libudev.h>
+#include <mpath_persist.h>
#define PRKEY_READ 0
#define PRKEY_WRITE 1
@@ -108,7 +110,8 @@ static int do_prkey(int fd, char *wwid, char *keystr, int cmd)
return 0;
}
-int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey)
+int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey,
+ uint8_t *sa_flags)
{
int fd;
int unused;
@@ -124,6 +127,9 @@ int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey)
ret = do_prkey(fd, mpp->wwid, keystr, PRKEY_READ);
if (ret)
goto out_file;
+ *sa_flags = 0;
+ if (strchr(keystr, 'X'))
+ *sa_flags = MPATH_F_APTPL_MASK;
ret = !!parse_prkey(keystr, prkey);
out_file:
close(fd);
@@ -131,7 +137,8 @@ out:
return ret;
}
-int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey)
+int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey,
+ uint8_t sa_flags)
{
int fd;
int can_write = 1;
@@ -141,6 +148,12 @@ int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey)
if (!strlen(mpp->wwid))
goto out;
+ if (sa_flags & ~MPATH_F_APTPL_MASK) {
+ condlog(0, "unsupported pr flags, 0x%x",
+ sa_flags & ~MPATH_F_APTPL_MASK);
+ sa_flags &= MPATH_F_APTPL_MASK;
+ }
+
fd = open_file(conf->prkeys_file, &can_write, PRKEYS_FILE_HEADER);
if (fd < 0)
goto out;
@@ -149,7 +162,15 @@ int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey)
goto out_file;
}
if (prkey) {
- snprintf(keystr, PRKEY_SIZE, "0x%016" PRIx64, prkey);
+ /* using the capitalization of the 'x' is a hack, but
+ * it's unlikely that mpath_persist will support more options
+ * since sg_persist doesn't, and this lets us keep the
+ * same file format as before instead of needing to change
+ * the format of the prkeys file */
+ if (sa_flags)
+ snprintf(keystr, PRKEY_SIZE, "0X%016" PRIx64, prkey);
+ else
+ snprintf(keystr, PRKEY_SIZE, "0x%016" PRIx64, prkey);
keystr[PRKEY_SIZE - 1] = '\0';
ret = do_prkey(fd, mpp->wwid, keystr, PRKEY_WRITE);
}
diff --git a/libmultipath/prkey.h b/libmultipath/prkey.h
index 4028e70..6739191 100644
--- a/libmultipath/prkey.h
+++ b/libmultipath/prkey.h
@@ -13,7 +13,9 @@
"# prkey wwid\n" \
"#\n"
-int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey);
-int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey);
+int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey,
+ uint8_t sa_flags);
+int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey,
+ uint8_t *sa_flags);
#endif /* _PRKEY_H */
diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
index 9ca1355..62a6893 100644
--- a/libmultipath/propsel.c
+++ b/libmultipath/propsel.c
@@ -106,6 +106,7 @@ do { \
if (src && src->prkey_source != PRKEY_SOURCE_NONE) { \
mp->prkey_source = src->prkey_source; \
mp->reservation_key = src->reservation_key; \
+ mp->sa_flags = src->sa_flags; \
origin = msg; \
goto out; \
} \
@@ -703,18 +704,19 @@ int select_reservation_key(struct config *conf, struct multipath *mp)
do_prkey_set(mp->mpe, multipaths_origin);
do_prkey_set(conf, conf_origin);
put_be64(mp->reservation_key, 0);
+ mp->sa_flags = 0;
mp->prkey_source = PRKEY_SOURCE_NONE;
return 0;
out:
if (mp->prkey_source == PRKEY_SOURCE_FILE) {
from_file = " (from prkeys file)";
- if (get_prkey(conf, mp, &prkey) != 0)
+ if (get_prkey(conf, mp, &prkey, &mp->sa_flags) != 0)
put_be64(mp->reservation_key, 0);
else
put_be64(mp->reservation_key, prkey);
}
print_reservation_key(buff, PRKEY_SIZE, mp->reservation_key,
- mp->prkey_source);
+ mp->sa_flags, mp->prkey_source);
condlog(3, "%s: reservation_key = %s %s%s", mp->alias, buff, origin,
from_file);
return 0;
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
index 0194b1e..987479f 100644
--- a/libmultipath/structs.h
+++ b/libmultipath/structs.h
@@ -367,6 +367,7 @@ struct multipath {
/* persistent management data*/
int prkey_source;
struct be64 reservation_key;
+ uint8_t sa_flags;
unsigned char prflag;
int all_tg_pt;
struct gen_multipath generic_mp;
diff --git a/libmultipath/util.c b/libmultipath/util.c
index 7251ad0..8d8fcc8 100644
--- a/libmultipath/util.c
+++ b/libmultipath/util.c
@@ -10,6 +10,8 @@
#include <dirent.h>
#include <unistd.h>
#include <errno.h>
+#include <libudev.h>
+#include <mpath_persist.h>
#include "util.h"
#include "debug.h"
@@ -435,6 +437,20 @@ int parse_prkey(char *ptr, uint64_t *prkey)
return 0;
}
+int parse_prkey_flags(char *ptr, uint64_t *prkey, uint8_t *flags)
+{
+ char *flagstr;
+
+ flagstr = strchr(ptr, ':');
+ *flags = 0;
+ if (flagstr) {
+ *flagstr++ = '\0';
+ if (strlen(flagstr) == 5 && strcmp(flagstr, "aptpl") == 0)
+ *flags = MPATH_F_APTPL_MASK;
+ }
+ return parse_prkey(ptr, prkey);
+}
+
int safe_write(int fd, const void *buf, size_t count)
{
while (count > 0) {
diff --git a/libmultipath/util.h b/libmultipath/util.h
index a3ab894..56cec76 100644
--- a/libmultipath/util.h
+++ b/libmultipath/util.h
@@ -19,6 +19,7 @@ void setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached);
int systemd_service_enabled(const char *dev);
int get_linux_version_code(void);
int parse_prkey(char *ptr, uint64_t *prkey);
+int parse_prkey_flags(char *ptr, uint64_t *prkey, uint8_t *flags);
int safe_write(int fd, const void *buf, size_t count);
#define KERNEL_VERSION(maj, min, ptc) ((((maj) * 256) + (min)) * 256 + (ptc))
diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
index 31f4585..30d8598 100644
--- a/multipath/multipath.conf.5
+++ b/multipath/multipath.conf.5
@@ -726,14 +726,17 @@ This is the service action reservation key used by mpathpersist. It must be
set for all multipath devices using persistent reservations, and it must be
the same as the RESERVATION KEY field of the PERSISTENT RESERVE OUT parameter
list which contains an 8-byte value provided by the application client to the
-device server to identify the I_T nexus.
+device server to identify the I_T nexus. If the \fI--param-aptpl\fR option is
+used when registering the key with mpathpersist, \fB:aptpl\fR must be appended
+to the end of the reservation key.
.RS
.PP
Alternatively, this can be set to \fBfile\fR, which will store the RESERVATION
KEY registered by mpathpersist in the \fIprkeys_file\fR. multipathd will then
use this key to register additional paths as they appear. When the
registration is removed, the RESERVATION KEY is removed from the
-\fIprkeys_file\fR.
+\fIprkeys_file\fR. The prkeys file will automatically keep track of whether
+the key was registered with \fI--param-aptpl\fR.
.TP
The default is: \fB<unset>\fR
.RE
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index ba50fb8..6452796 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -21,6 +21,7 @@
#include "sysfs.h"
#include <errno.h>
#include <libudev.h>
+#include <mpath_persist.h>
#include "util.h"
#include "prkey.h"
#include "propsel.h"
@@ -1463,6 +1464,7 @@ cli_getprkey(void * v, char ** reply, int * len, void * data)
struct multipath * mpp;
struct vectors * vecs = (struct vectors *)data;
char *mapname = get_keyparam(v, MAP);
+ char *flagstr = "";
mapname = convert_dev(mapname, 0);
condlog(3, "%s: get persistent reservation key (operator)", mapname);
@@ -1478,8 +1480,10 @@ cli_getprkey(void * v, char ** reply, int * len, void * data)
*len = strlen(*reply) + 1;
return 0;
}
- snprintf(*reply, 20, "0x%" PRIx64 "\n",
- get_be64(mpp->reservation_key));
+ if (mpp->sa_flags & MPATH_F_APTPL_MASK)
+ flagstr = ":aptpl";
+ snprintf(*reply, 20, "0x%" PRIx64 "%s\n",
+ get_be64(mpp->reservation_key), flagstr);
(*reply)[19] = '\0';
*len = strlen(*reply) + 1;
return 0;
@@ -1503,7 +1507,7 @@ cli_unsetprkey(void * v, char ** reply, int * len, void * data)
conf = get_multipath_config();
pthread_cleanup_push(put_multipath_config, conf);
- ret = set_prkey(conf, mpp, 0);
+ ret = set_prkey(conf, mpp, 0, 0);
pthread_cleanup_pop(1);
return ret;
@@ -1517,6 +1521,7 @@ cli_setprkey(void * v, char ** reply, int * len, void * data)
char *mapname = get_keyparam(v, MAP);
char *keyparam = get_keyparam(v, KEY);
uint64_t prkey;
+ uint8_t flags;
int ret;
struct config *conf;
@@ -1527,14 +1532,14 @@ cli_setprkey(void * v, char ** reply, int * len, void * data)
if (!mpp)
return 1;
- if (parse_prkey(keyparam, &prkey) != 0) {
+ if (parse_prkey_flags(keyparam, &prkey, &flags) != 0) {
condlog(0, "%s: invalid prkey : '%s'", mapname, keyparam);
return 1;
}
conf = get_multipath_config();
pthread_cleanup_push(put_multipath_config, conf);
- ret = set_prkey(conf, mpp, prkey);
+ ret = set_prkey(conf, mpp, prkey, flags);
pthread_cleanup_pop(1);
return ret;
diff --git a/multipathd/main.c b/multipathd/main.c
index d40c416..6b1e782 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -3089,6 +3089,7 @@ void * mpath_pr_event_handler_fn (void * pathp )
param= malloc(sizeof(struct prout_param_descriptor));
memset(param, 0 , sizeof(struct prout_param_descriptor));
+ param->sa_flags = mpp->sa_flags;
memcpy(param->sa_key, &mpp->reservation_key, 8);
param->num_transportid = 0;
--
2.7.4

View File

@ -1,34 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Tue, 5 Jun 2018 15:31:55 -0500
Subject: [PATCH] multipath: don't check timestamps without a path
If a path was blacklisted, pathvec could exist but have no path in it.
print_cmd_valid wasn't checking this before calling
find_multipaths_check_timeout(). This was causing it to dereference a
NULL pointer in these cases.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipath/main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/multipath/main.c b/multipath/main.c
index c69e996..3f0a6aa 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -482,10 +482,8 @@ static int print_cmd_valid(int k, const vector pathvec,
pp, pp->find_multipaths_timeout, &until);
if (wait != FIND_MULTIPATHS_WAITING)
k = 1;
- } else if (pathvec != NULL) {
- pp = VECTOR_SLOT(pathvec, 0);
+ } else if (pathvec != NULL && (pp = VECTOR_SLOT(pathvec, 0)))
wait = find_multipaths_check_timeout(pp, 0, &until);
- }
if (wait == FIND_MULTIPATHS_WAITING)
printf("FIND_MULTIPATHS_WAIT_UNTIL=\"%ld.%06ld\"\n",
until.tv_sec, until.tv_nsec/1000);
--
2.7.4

View File

@ -1,35 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Fri, 8 Jun 2018 17:12:37 -0500
Subject: [PATCH] libmultipath: fix detect alua corner case
If retain_attach_hw_handler = no, then the paths tpgs state will never
be checked, and the multipath device will always select the alua
handler, if no other handler is selected. the paths tpgs state
should be checked, regardless of the retain_hwhandler value.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/propsel.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
index 62a6893..f626c74 100644
--- a/libmultipath/propsel.c
+++ b/libmultipath/propsel.c
@@ -403,9 +403,11 @@ int select_hwhandler(struct config *conf, struct multipath *mp)
bool all_tpgs = true;
dh_state = &handler[2];
+
+ vector_foreach_slot(mp->paths, pp, i)
+ all_tpgs = all_tpgs && (pp->tpgs > 0);
if (mp->retain_hwhandler != RETAIN_HWHANDLER_OFF) {
vector_foreach_slot(mp->paths, pp, i) {
- all_tpgs = all_tpgs && (pp->tpgs > 0);
if (get_dh_state(pp, dh_state, sizeof(handler) - 2) > 0
&& strcmp(dh_state, "detached")) {
memcpy(handler, "1 ", 2);
--
2.7.4

View File

@ -1,39 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Fri, 8 Jun 2018 17:23:07 -0500
Subject: [PATCH] multipath: fix setting conf->version
Commit d3b71498 stopped multipath from setting conf->version. Instead,
it was always being set to 0.0.0. Multipathd was still setting this
correctly.
Fixes: d3b71498 "multipath: fix rcu thread cancellation hang"
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/devmapper.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index f2befad..8136d15 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -245,13 +245,13 @@ void libmp_dm_init(void)
int verbosity;
unsigned int version[3];
+ if (dm_prereq(version))
+ exit(1);
conf = get_multipath_config();
verbosity = conf->verbosity;
- memcpy(version, conf->version, sizeof(version));
+ memcpy(conf->version, version, sizeof(version));
put_multipath_config(conf);
dm_init(verbosity);
- if (dm_prereq(version))
- exit(1);
dm_udev_set_sync_support(libmp_dm_udev_sync);
}
--
2.7.4

View File

@ -1,82 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Thu, 13 Apr 2017 07:22:23 -0500
Subject: [PATCH] RH: fixup udev rules for redhat
The multipath rules need to run after scsi_id is run. This means moving
them after 60-persistent-storage.rules for redhat. Redhat also uses a
different naming scheme for partitions than SuSE. Also, there are some
false warnings that gcc throws because of the changed options. Fix these
too.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
Makefile.inc | 2 +-
kpartx/kpartx.rules | 2 +-
multipath/Makefile | 4 ++--
multipath/main.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index af2f5ba..0b271ea 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -51,7 +51,7 @@ endif
prefix =
exec_prefix = $(prefix)
usr_prefix = $(prefix)
-bindir = $(exec_prefix)/sbin
+bindir = $(exec_prefix)/usr/sbin
libudevdir = $(prefix)/$(SYSTEMDPATH)/udev
udevrulesdir = $(libudevdir)/rules.d
multipathdir = $(TOPDIR)/libmultipath
diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules
index 8f99049..8a3a171 100644
--- a/kpartx/kpartx.rules
+++ b/kpartx/kpartx.rules
@@ -32,6 +32,6 @@ LABEL="mpath_kpartx_end"
GOTO="kpartx_end"
LABEL="run_kpartx"
-RUN+="/sbin/kpartx -un -p -part /dev/$name"
+RUN+="/sbin/kpartx -un /dev/$name"
LABEL="kpartx_end"
diff --git a/multipath/Makefile b/multipath/Makefile
index 0828a8f..b9bbb3c 100644
--- a/multipath/Makefile
+++ b/multipath/Makefile
@@ -24,7 +24,7 @@ install:
$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/
$(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir)
$(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir)
- $(INSTALL_PROGRAM) -m 644 $(EXEC).rules $(DESTDIR)$(libudevdir)/rules.d/56-multipath.rules
+ $(INSTALL_PROGRAM) -m 644 $(EXEC).rules $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules
$(INSTALL_PROGRAM) -d $(DESTDIR)$(man8dir)
$(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(man8dir)
$(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
@@ -33,7 +33,7 @@ install:
uninstall:
$(RM) $(DESTDIR)$(bindir)/$(EXEC)
$(RM) $(DESTDIR)$(udevrulesdir)/11-dm-mpath.rules
- $(RM) $(DESTDIR)$(libudevdir)/rules.d/56-multipath.rules
+ $(RM) $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules
$(RM) $(DESTDIR)$(man8dir)/$(EXEC).8.gz
$(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz
diff --git a/multipath/main.c b/multipath/main.c
index 3f0a6aa..6fdde03 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -389,7 +389,7 @@ static int find_multipaths_check_timeout(const struct path *pp, long tmo,
struct timespec now, ftimes[2], tdiff;
struct stat st;
long fd;
- int r, err, retries = 0;
+ int r, err = 0, retries = 0;
clock_gettime(CLOCK_REALTIME, &now);
--
2.7.4

View File

@ -1,87 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 2 Jul 2014 12:49:53 -0500
Subject: [PATCH] RH: Remove the property blacklist exception builtin
Multipath set the default property blacklist exceptions to
(ID_SCSI_VPD|ID_WWN). This has the effect of blacklisting some internal
devices. These devices may never have multiple paths, but it is nice
to be able to set multipath up on them all the same. This patch simply
removes the default, and makes it so that if no property
blacklist_exception is given, then devices aren't failed for not matching
it.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/blacklist.c | 15 ++++++---------
multipath/multipath.conf.5 | 14 ++++++++------
2 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c
index ee396e2..19d4697 100644
--- a/libmultipath/blacklist.c
+++ b/libmultipath/blacklist.c
@@ -181,12 +181,6 @@ setup_default_blist (struct config * conf)
if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT))
return 1;
- str = STRDUP("(SCSI_IDENT_|ID_WWN)");
- if (!str)
- return 1;
- if (store_ble(conf->elist_property, str, ORIGIN_DEFAULT))
- return 1;
-
vector_foreach_slot (conf->hwtable, hwe, i) {
if (hwe->bl_product) {
if (_blacklist_device(conf->blist_device, hwe->vendor,
@@ -390,9 +384,12 @@ filter_property(struct config * conf, struct udev_device * udev)
* This is the inverse of the 'normal' matching;
* the environment variable _has_ to match.
*/
- log_filter(devname, NULL, NULL, NULL, NULL,
- MATCH_PROPERTY_BLIST_MISSING);
- return MATCH_PROPERTY_BLIST_MISSING;
+ if (VECTOR_SIZE(conf->elist_property)) {
+ log_filter(devname, NULL, NULL, NULL, NULL,
+ MATCH_PROPERTY_BLIST_MISSING);
+ return MATCH_PROPERTY_BLIST_MISSING;
+ }
+ return 0;
}
void
diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
index 30d8598..c45da9f 100644
--- a/multipath/multipath.conf.5
+++ b/multipath/multipath.conf.5
@@ -1179,10 +1179,6 @@ The \fIWorld Wide Identification\fR of a device.
.TP
.B property
Regular expression of the udev property to be whitelisted.
-.RS
-.TP
-The default is: \fB(SCSI_IDENT_|ID_WWN)\fR
-.RE
.TP
.B device
Subsection for the device description. This subsection recognizes the
@@ -1193,8 +1189,14 @@ keywords. For a full description of these keywords please see the \fIdevices\fR
section description.
.LP
The \fIproperty\fR whitelist handling is different from the usual
-handling in the sense that the device \fIhas\fR to have a udev property that
-matches the whitelist, otherwise the device will be blacklisted. In these cases the message \fIblacklisted, udev property missing\fR will be displayed.
+handling in the sense that if the propery whitelist is set, the device
+\fIhas\fR to have a udev property that matches the whitelist, otherwise the
+device will be blacklisted. In these cases the message \fIblacklisted, udev
+property missing\fR will be displayed. For example settting the
+property blacklist_exception to \fB(SCSI_IDENT_|ID_WWN)\fR will blacklist
+all devices that have no udev property whose name regex matches either
+\fBSCSI_IDENT_\fR or \fBID_WWN\fR. This works to exclude most
+non-multipathable devices.
.
.
.\" ----------------------------------------------------------------------------
--
2.7.4

View File

@ -1,106 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 15 Oct 2014 10:39:30 -0500
Subject: [PATCH] RH: don't start without a config file
If /etc/multipath.conf doesn't exist, don't start multipathd and blacklist
all devices when running multipath. A completely blank configuration file
is almost never what users want. Also, people may have the multipath
packages installed but don't want to use them. This patch provides a
simple way to disable multipath. Simply removing or renaming
/etc/multipath.conf will keep multipath from doing anything.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/config.c | 15 +++++++++++++++
libmultipath/config.h | 1 +
multipath/multipath.rules | 1 +
multipathd/multipathd.8 | 2 ++
multipathd/multipathd.service | 1 +
5 files changed, 20 insertions(+)
diff --git a/libmultipath/config.c b/libmultipath/config.c
index 5872927..0607403 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -26,6 +26,7 @@
#include "devmapper.h"
#include "mpath_cmd.h"
#include "propsel.h"
+#include "version.h"
static int
hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2)
@@ -658,6 +659,20 @@ load_config (char * file)
factorize_hwtable(conf->hwtable, builtin_hwtable_size);
}
+ } else {
+ condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices.");
+ if (conf->blist_devnode == NULL) {
+ conf->blist_devnode = vector_alloc();
+ if (!conf->blist_devnode) {
+ condlog(0, "cannot allocate blacklist\n");
+ goto out;
+ }
+ }
+ if (store_ble(conf->blist_devnode, strdup(".*"),
+ ORIGIN_NO_CONFIG)) {
+ condlog(0, "cannot store default no-config blacklist\n");
+ goto out;
+ }
}
conf->processed_main_config = 1;
diff --git a/libmultipath/config.h b/libmultipath/config.h
index fcbe3fc..3a42435 100644
--- a/libmultipath/config.h
+++ b/libmultipath/config.h
@@ -9,6 +9,7 @@
#define ORIGIN_DEFAULT 0
#define ORIGIN_CONFIG 1
+#define ORIGIN_NO_CONFIG 2
/*
* In kernel, fast_io_fail == 0 means immediate failure on rport delete.
diff --git a/multipath/multipath.rules b/multipath/multipath.rules
index d658073..b3f54d7 100644
--- a/multipath/multipath.rules
+++ b/multipath/multipath.rules
@@ -9,6 +9,7 @@ IMPORT{cmdline}="nompath"
ENV{nompath}=="?*", GOTO="end_mpath"
IMPORT{cmdline}="multipath"
ENV{multipath}=="off", GOTO="end_mpath"
+TEST!="/etc/multipath.conf", GOTO="end_mpath"
ENV{DEVTYPE}!="partition", GOTO="test_dev"
IMPORT{parent}="DM_MULTIPATH_DEVICE_PATH"
diff --git a/multipathd/multipathd.8 b/multipathd/multipathd.8
index e78ac9e..09cdead 100644
--- a/multipathd/multipathd.8
+++ b/multipathd/multipathd.8
@@ -38,6 +38,8 @@ map regains its maximum performance and redundancy.
This daemon executes the external \fBmultipath\fR tool when events occur.
In turn, the multipath tool signals the multipathd daemon when it is done with
devmap reconfiguration, so that it can refresh its failed path list.
+
+In this Linux distribution, multipathd does not run unless a /etc/multipath.conf file exists.
.
.
.\" ----------------------------------------------------------------------------
diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service
index ba24983..17434ce 100644
--- a/multipathd/multipathd.service
+++ b/multipathd/multipathd.service
@@ -4,6 +4,7 @@ Wants=systemd-udev-trigger.service systemd-udev-settle.service
Before=iscsi.service iscsid.service lvm2-activation-early.service
Before=local-fs-pre.target blk-availability.service
After=multipathd.socket systemd-udev-trigger.service systemd-udev-settle.service
+ConditionPathExists=/etc/multipath.conf
DefaultDependencies=no
Conflicts=shutdown.target
ConditionKernelCommandLine=!nompath
--
2.7.4

View File

@ -1,52 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 19 Apr 2017 06:10:01 -0500
Subject: [PATCH] RH: use rpm optflags if present
Use the passed in optflags when compiling as an RPM, and keep the
default flags as close as possible to the current fedora flags, while
still being generic.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
Makefile.inc | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index 0b271ea..5ff69a3 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -85,14 +85,22 @@ TEST_CC_OPTION = $(shell \
echo "$(2)"; \
fi)
-STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector)
-
-OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \
- -Werror=implicit-function-declaration -Werror=format-security \
- -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered \
- -Werror=cast-qual -Werror=discarded-qualifiers \
- -Wp,-D_FORTIFY_SOURCE=2 $(STACKPROT) \
- --param=ssp-buffer-size=4
+ifndef RPM_OPT_FLAGS
+ STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector)
+ OPTFLAGS = -O2 -g -pipe -Wall -Werror=format-security \
+ -Wp,-D_FORTIFY_SOURCE=2 -fexceptions \
+ $(STACKPROT) --param=ssp-buffer-size=4 \
+ -grecord-gcc-switches
+ ifeq ($(shell test -f /usr/lib/rpm/redhat/redhat-hardened-cc1 && echo 1),1)
+ OPTFLAGS += -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
+ endif
+else
+ OPTFLAGS = $(RPM_OPT_FLAGS)
+endif
+OPTFLAGS += -Wextra -Wstrict-prototypes -Wformat=2 -Werror=implicit-int \
+ -Werror=implicit-function-declaration -Wno-sign-compare \
+ -Wno-unused-parameter -Werror=cast-qual \
+ -Werror=discarded-qualifiers
CFLAGS := $(OPTFLAGS) -DBIN_DIR=\"$(bindir)\" -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" \
-MMD -MP $(CFLAGS)
--
2.7.4

View File

@ -1,648 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Thu, 16 Oct 2014 15:49:01 -0500
Subject: [PATCH] RH: add mpathconf
mpathconf is a program (largely based on lvmcomf) to help users
configure /etc/multipath.conf and enable or disable multipathing. It
has a couple of built-in options that can be set directly from the
command line. But, mostly it is used to get a multipath.conf file
with the OS defaults, and to enable and disable multipathing via
a single command.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/config.c | 1 +
multipath/Makefile | 5 +
multipath/mpathconf | 464 ++++++++++++++++++++++++++++++++++++++++++++++++++
multipath/mpathconf.8 | 101 +++++++++++
4 files changed, 571 insertions(+)
create mode 100644 multipath/mpathconf
create mode 100644 multipath/mpathconf.8
diff --git a/libmultipath/config.c b/libmultipath/config.c
index 0607403..5c98e48 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -661,6 +661,7 @@ load_config (char * file)
} else {
condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices.");
+ condlog(0, "You can run /sbin/mpathconf to create or modify /etc/multipath.conf");
if (conf->blist_devnode == NULL) {
conf->blist_devnode = vector_alloc();
if (!conf->blist_devnode) {
diff --git a/multipath/Makefile b/multipath/Makefile
index b9bbb3c..e720c7f 100644
--- a/multipath/Makefile
+++ b/multipath/Makefile
@@ -18,10 +18,12 @@ $(EXEC): $(OBJS) $(multipathdir)/libmultipath.so $(mpathcmddir)/libmpathcmd.so
$(CC) $(CFLAGS) $(OBJS) -o $(EXEC) $(LDFLAGS) $(LIBDEPS)
$(GZIP) $(EXEC).8 > $(EXEC).8.gz
$(GZIP) $(EXEC).conf.5 > $(EXEC).conf.5.gz
+ $(GZIP) mpathconf.8 > mpathconf.8.gz
install:
$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/
+ $(INSTALL_PROGRAM) -m 755 mpathconf $(DESTDIR)$(bindir)/
$(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir)
$(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir)
$(INSTALL_PROGRAM) -m 644 $(EXEC).rules $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules
@@ -29,13 +31,16 @@ install:
$(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(man8dir)
$(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
$(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5.gz $(DESTDIR)$(man5dir)
+ $(INSTALL_PROGRAM) -m 644 mpathconf.8.gz $(DESTDIR)$(man8dir)
uninstall:
$(RM) $(DESTDIR)$(bindir)/$(EXEC)
$(RM) $(DESTDIR)$(udevrulesdir)/11-dm-mpath.rules
$(RM) $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules
+ $(RM) $(DESTDIR)$(bindir)/mpathconf
$(RM) $(DESTDIR)$(man8dir)/$(EXEC).8.gz
$(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz
+ $(RM) $(DESTDIR)$(man8dir)/mpathconf.8.gz
clean: dep_clean
$(RM) core *.o $(EXEC) *.gz
diff --git a/multipath/mpathconf b/multipath/mpathconf
new file mode 100644
index 0000000..e839134
--- /dev/null
+++ b/multipath/mpathconf
@@ -0,0 +1,464 @@
+#!/bin/bash
+#
+# Copyright (C) 2010 Red Hat, Inc. All rights reserved.
+#
+# This file is part of the device-mapper-multipath package.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+#
+# Simple editting of /etc/multipath.conf
+# This program was largely ripped off from lvmconf
+#
+
+unset ENABLE FIND FRIENDLY MODULE MULTIPATHD HAVE_DISABLE HAVE_WWID_DISABLE HAVE_FIND HAVE_BLACKLIST HAVE_EXCEPTIONS HAVE_DEFAULTS HAVE_FRIENDLY HAVE_MULTIPATHD HAVE_MODULE HAVE_OUTFILE SHOW_STATUS CHANGED_CONFIG WWID_LIST
+
+DEFAULT_CONFIG="# device-mapper-multipath configuration file
+
+# For a complete list of the default configuration values, run either:
+# # multipath -t
+# or
+# # multipathd show config
+
+# For a list of configuration options with descriptions, see the
+# multipath.conf man page.
+
+defaults {
+ user_friendly_names yes
+ find_multipaths yes
+}
+
+blacklist_exceptions {
+ property \"(SCSI_IDENT_|ID_WWN)\"
+}"
+
+CONFIGFILE="/etc/multipath.conf"
+OUTPUTFILE="/etc/multipath.conf"
+MULTIPATHDIR="/etc/multipath"
+TMPFILE="/etc/multipath/.multipath.conf.tmp"
+WWIDS=0
+
+function usage
+{
+ echo "usage: $0 <command>"
+ echo ""
+ echo "Commands:"
+ echo "Enable: --enable "
+ echo "Disable: --disable"
+ echo "Only allow certain wwids (instead of enable): --allow <WWID>"
+ echo "Set user_friendly_names (Default y): --user_friendly_names <y|n>"
+ echo "Set find_multipaths (Default y): --find_multipaths <y|n>"
+ echo "Load the dm-multipath modules on enable (Default y): --with_module <y|n>"
+ echo "start/stop/reload multipathd (Default n): --with_multipathd <y|n>"
+ echo "select output file (Default /etc/multipath.conf): --outfile <FILE>"
+ echo ""
+}
+
+function add_wwid
+{
+ INDEX=0
+ while [ "$INDEX" -lt "$WWIDS" ] ; do
+ if [ "$1" = "${WWID_LIST[$INDEX]}" ] ; then
+ return
+ fi
+ ((INDEX++))
+ done
+ WWID_LIST[$WWIDS]="$1"
+ ((WWIDS++))
+}
+
+function get_dm_deps
+{
+ shift 3
+ while [ -n "$1" -a -n "$2" ]; do
+ MAJOR=$(echo $1 | tr -d '(,')
+ MINOR=$(echo $2 | tr -d ')')
+ UUID=`dmsetup info -c --noheadings -o uuid -j $MAJOR -m $MINOR 2> /dev/null`
+ if [ -n "$UUID" ] ; then
+ set_dm_wwid $UUID
+ fi
+ shift 2
+ done
+}
+
+function set_dm_wwid
+{
+ if [[ "$1" =~ ^part[[:digit:]]+-mpath- ]] ; then
+ add_wwid "${1##part*-mpath-}"
+ elif [[ "$1" =~ ^mpath- ]] ; then
+ add_wwid "${1##mpath-}"
+ else
+ get_dm_deps `dmsetup deps -u $1`
+ fi
+}
+
+function set_wwid
+{
+ UUID=""
+ if [[ "$1" =~ ^[[:digit:]]+:[[:digit:]]+$ ]] ; then
+ MAJOR=${1%%:*}
+ MINOR=${1##*:}
+ UUID=`dmsetup info -c --noheadings -o uuid -j $MAJOR -m $MINOR 2> /dev/null`
+ else
+ UUID=`dmsetup info -c --noheadings -o uuid $1 2> /dev/null`
+ fi
+ if [ -n "$UUID" ] ; then
+ set_dm_wwid $UUID
+ else
+ add_wwid "$1"
+ fi
+}
+
+function parse_args
+{
+ while [ -n "$1" ]; do
+ case $1 in
+ --enable)
+ ENABLE=1
+ shift
+ ;;
+ --disable)
+ ENABLE=0
+ shift
+ ;;
+ --allow)
+ ENABLE=2
+ if [ -n "$2" ]; then
+ set_wwid $2
+ shift 2
+ else
+ usage
+ exit 1
+ fi
+ ;;
+ --user_friendly_names)
+ if [ -n "$2" ]; then
+ FRIENDLY=$2
+ shift 2
+ else
+ usage
+ exit 1
+ fi
+ ;;
+ --find_multipaths)
+ if [ -n "$2" ]; then
+ FIND=$2
+ shift 2
+ else
+ usage
+ exit 1
+ fi
+ ;;
+ --with_module)
+ if [ -n "$2" ]; then
+ MODULE=$2
+ shift 2
+ else
+ usage
+ exit 1
+ fi
+ ;;
+ --with_multipathd)
+ if [ -n "$2" ]; then
+ MULTIPATHD=$2
+ shift 2
+ else
+ usage
+ exit 1
+ fi
+ ;;
+ --outfile)
+ if [ -n "$2" ]; then
+ OUTPUTFILE=$2
+ HAVE_OUTFILE=1
+ shift 2
+ else
+ usage
+ exit 1
+ fi
+ ;;
+ *)
+ usage
+ exit
+ esac
+ done
+}
+
+function validate_args
+{
+ if [ "$ENABLE" = "0" ] && [ -n "$FRIENDLY" -o -n "$FIND" -o -n "$MODULE" ]; then
+ echo "ignoring extra parameters on disable"
+ FRIENDLY=""
+ FIND=""
+ MODULE=""
+ fi
+ if [ -n "$FRIENDLY" ] && [ "$FRIENDLY" != "y" -a "$FRIENDLY" != "n" ]; then
+ echo "--user_friendly_names must be either 'y' or 'n'"
+ exit 1
+ fi
+ if [ -n "$FIND" ] && [ "$FIND" != "y" -a "$FIND" != "n" ]; then
+ echo "--find_multipaths must be either 'y' or 'n'"
+ exit 1
+ fi
+ if [ -z "$ENABLE" -a -z "$FIND" -a -z "$FRIENDLY" ]; then
+ SHOW_STATUS=1
+ fi
+ if [ -n "$MODULE" ] && [ "$MODULE" != "y" -a "$MODULE" != "n" ]; then
+ echo "--with_module must be either 'y' or 'n'"
+ exit 1
+ fi
+ if [ -n "$MULTIPATHD" ] && [ "$MULTIPATHD" != "y" -a "$MULTIPATHD" != "n" ]; then
+ echo "--with_multipathd must be either 'y' or 'n'"
+ exit 1
+ fi
+ if [ "$ENABLE" = 2 -a -z "$HAVE_OUTFILE" ]; then
+ echo "Because --allow makes changes that cannot be automatically reversed,"
+ echo "you must set --outfile when you set --allow"
+ exit 1
+ fi
+}
+
+function add_blacklist_exceptions
+{
+ INDEX=0
+ while [ "$INDEX" -lt "$WWIDS" ] ; do
+ sed -i '/^blacklist_exceptions[[:space:]]*{/ a\
+ wwid '"\"${WWID_LIST[$INDEX]}\""'
+' $TMPFILE
+ ((INDEX++))
+ done
+}
+
+umask 0077
+
+parse_args "$@"
+
+validate_args
+
+if [ ! -d "$MULTIPATHDIR" ]; then
+ echo "/etc/multipath/ does not exist. failing"
+ exit 1
+fi
+
+rm $TMPFILE 2> /dev/null
+echo "$DEFAULT_CONFIG" > $TMPFILE
+if [ -f "$CONFIGFILE" ]; then
+ cp $CONFIGFILE $TMPFILE
+fi
+
+if grep -q "^blacklist[[:space:]]*{" $TMPFILE ; then
+ HAVE_BLACKLIST=1
+fi
+
+if grep -q "^blacklist_exceptions[[:space:]]*{" $TMPFILE ; then
+ HAVE_EXCEPTIONS=1
+fi
+
+if grep -q "^defaults[[:space:]]*{" $TMPFILE ; then
+ HAVE_DEFAULTS=1
+fi
+
+if [ -z "$MODULE" -o "$MODULE" = "y" ]; then
+ if lsmod | grep -q "dm_multipath" ; then
+ HAVE_MODULE=1
+ else
+ HAVE_MODULE=0
+ fi
+fi
+
+if [ "$MULTIPATHD" = "y" ]; then
+ if /bin/systemctl status multipathd.service > /dev/null 2>&1 ; then
+ HAVE_MULTIPATHD=1
+ else
+ HAVE_MULTIPATHD=0
+ fi
+fi
+
+if [ "$HAVE_BLACKLIST" = "1" ]; then
+ if sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*devnode \"\.\?\*\"" ; then
+ HAVE_DISABLE=1
+ elif sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[[:space:]]*devnode \"\.\?\*\"" ; then
+ HAVE_DISABLE=0
+ fi
+fi
+
+if [ "$HAVE_BLACKLIST" = "1" ]; then
+ if sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*wwid \"\.\?\*\"" ; then
+ HAVE_WWID_DISABLE=1
+ elif sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[[:space:]]*wwid \"\.\?\*\"" ; then
+ HAVE_WWID_DISABLE=0
+ fi
+fi
+
+if [ "$HAVE_DEFAULTS" = "1" ]; then
+ if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*find_multipaths[[:space:]]*\(yes\|1\)" ; then
+ HAVE_FIND=1
+ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*find_multipaths[[:space:]]*\(no\|0\)" ; then
+ HAVE_FIND=0
+ fi
+ if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*user_friendly_names[[:space:]]*\(yes\|1\)" ; then
+ HAVE_FRIENDLY=1
+ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*user_friendly_names[[:space:]]*\(no\|0\)" ; then
+ HAVE_FRIENDLY=0
+ fi
+fi
+
+if [ -n "$SHOW_STATUS" ]; then
+ if [ -z "$HAVE_DISABLE" -o "$HAVE_DISABLE" = 0 ]; then
+ echo "multipath is enabled"
+ else
+ echo "multipath is disabled"
+ fi
+ if [ -z "$HAVE_FIND" -o "$HAVE_FIND" = 0 ]; then
+ echo "find_multipaths is disabled"
+ else
+ echo "find_multipaths is enabled"
+ fi
+ if [ -z "$HAVE_FRIENDLY" -o "$HAVE_FRIENDLY" = 0 ]; then
+ echo "user_friendly_names is disabled"
+ else
+ echo "user_friendly_names is enabled"
+ fi
+ if [ -n "$HAVE_MODULE" ]; then
+ if [ "$HAVE_MODULE" = 1 ]; then
+ echo "dm_multipath module is loaded"
+ else
+ echo "dm_multipath module is not loaded"
+ fi
+ fi
+ if [ -z "$HAVE_MULTIPATHD" ]; then
+ if /bin/systemctl status multipathd.service > /dev/null 2>&1 ; then
+ HAVE_MULTIPATHD=1
+ else
+ HAVE_MULTIPATHD=0
+ fi
+ fi
+ if [ "$HAVE_MULTIPATHD" = 1 ]; then
+ echo "multipathd is running"
+ else
+ echo "multipathd is not running"
+ fi
+ exit 0
+fi
+
+if [ -z "$HAVE_BLACKLIST" ]; then
+ cat >> $TMPFILE <<- _EOF_
+
+blacklist {
+}
+_EOF_
+fi
+
+if [ -z "$HAVE_DEFAULTS" ]; then
+ cat >> $TMPFILE <<- _EOF_
+
+defaults {
+}
+_EOF_
+fi
+
+if [ "$ENABLE" = 2 ]; then
+ if [ "$HAVE_DISABLE" = 1 ]; then
+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*devnode \"\.\?\*\"/# devnode ".*"/' $TMPFILE
+ fi
+ if [ -z "$HAVE_WWID_DISABLE" ]; then
+ sed -i '/^blacklist[[:space:]]*{/ a\
+ wwid ".*"
+' $TMPFILE
+ elif [ "$HAVE_WWID_DISABLE" = 0 ]; then
+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*#[[:space:]]*wwid \"\.\?\*\"/ wwid ".*"/' $TMPFILE
+ fi
+ if [ "$HAVE_EXCEPTIONS" = 1 ]; then
+ sed -i '/^blacklist_exceptions[[:space:]]*{/,/^}/ {/^[[:space:]]*wwid/ d}' $TMPFILE
+ else
+ cat >> $TMPFILE <<- _EOF_
+
+blacklist_exceptions {
+}
+_EOF_
+ fi
+ add_blacklist_exceptions
+elif [ "$ENABLE" = 1 ]; then
+ if [ "$HAVE_DISABLE" = 1 ]; then
+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*devnode \"\.\?\*\"/# devnode ".*"/' $TMPFILE
+ fi
+elif [ "$ENABLE" = 0 ]; then
+ if [ -z "$HAVE_DISABLE" ]; then
+ sed -i '/^blacklist[[:space:]]*{/ a\
+ devnode ".*"
+' $TMPFILE
+ elif [ "$HAVE_DISABLE" = 0 ]; then
+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*#[[:space:]]*devnode \"\.\?\*\"/ devnode ".*"/' $TMPFILE
+ fi
+fi
+
+if [ "$FIND" = "n" ]; then
+ if [ "$HAVE_FIND" = 1 ]; then
+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*find_multipaths[[:space:]]*\(yes\|1\)/ find_multipaths no/' $TMPFILE
+ CHANGED_CONFIG=1
+ fi
+elif [ "$FIND" = "y" ]; then
+ if [ -z "$HAVE_FIND" ]; then
+ sed -i '/^defaults[[:space:]]*{/ a\
+ find_multipaths yes
+' $TMPFILE
+ CHANGED_CONFIG=1
+ elif [ "$HAVE_FIND" = 0 ]; then
+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*find_multipaths[[:space:]]*\(no\|0\)/ find_multipaths yes/' $TMPFILE
+ CHANGED_CONFIG=1
+ fi
+fi
+
+if [ "$FRIENDLY" = "n" ]; then
+ if [ "$HAVE_FRIENDLY" = 1 ]; then
+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*user_friendly_names[[:space:]]*\(yes\|1\)/ user_friendly_names no/' $TMPFILE
+ CHANGED_CONFIG=1
+ fi
+elif [ "$FRIENDLY" = "y" ]; then
+ if [ -z "$HAVE_FRIENDLY" ]; then
+ sed -i '/^defaults[[:space:]]*{/ a\
+ user_friendly_names yes
+' $TMPFILE
+ CHANGED_CONFIG=1
+ elif [ "$HAVE_FRIENDLY" = 0 ]; then
+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*user_friendly_names[[:space:]]*\(no\|0\)/ user_friendly_names yes/' $TMPFILE
+ CHANGED_CONFIG=1
+ fi
+fi
+
+if [ -f "$OUTPUTFILE" ]; then
+ cp $OUTPUTFILE $OUTPUTFILE.old
+ if [ $? != 0 ]; then
+ echo "failed to backup old config file, $OUTPUTFILE not updated"
+ exit 1
+ fi
+fi
+
+cp $TMPFILE $OUTPUTFILE
+if [ $? != 0 ]; then
+ echo "failed to copy new config file into place, check $OUTPUTFILE is still OK"
+ exit 1
+fi
+
+rm -f $TMPFILE
+
+if [ "$ENABLE" = 1 ]; then
+ if [ "$HAVE_MODULE" = 0 ]; then
+ modprobe dm_multipath
+ fi
+ if [ "$HAVE_MULTIPATHD" = 0 ]; then
+ systemctl start multipathd.service
+ fi
+elif [ "$ENABLE" = 0 ]; then
+ if [ "$HAVE_MULTIPATHD" = 1 ]; then
+ systemctl stop multipathd.service
+ fi
+elif [ -n "$CHANGED_CONFIG" -a "$HAVE_MULTIPATHD" = 1 ]; then
+ systemctl reload multipathd.service
+fi
diff --git a/multipath/mpathconf.8 b/multipath/mpathconf.8
new file mode 100644
index 0000000..4cd3267
--- /dev/null
+++ b/multipath/mpathconf.8
@@ -0,0 +1,101 @@
+.TH MPATHCONF 8 "June 2010" "" "Linux Administrator's Manual"
+.SH NAME
+mpathconf - A tool for configuring device-mapper-multipath
+.SH SYNOPSIS
+.B mpathconf
+.RB [\| commands \|]
+.RB [\| options \|]
+.SH DESCRIPTION
+.B mpathconf
+is a utility that creates or modifies
+.B /etc/multipath.conf.
+It can enable or disable multipathing and configure some common options.
+.B mpathconf
+can also load the
+.B dm_multipath
+module, start and stop the
+.B multipathd
+daemon, and configure the
+.B multipathd
+service to start automatically or not. If
+.B mpathconf
+is called with no commands, it will display the current configuration.
+
+The default options for mpathconf are
+.B --with_module
+The
+.B --with_multipathd
+option is not set by default. Enabling multipathing will load the
+.B dm_multipath
+module but it will not immediately start it. This is so
+that users can manually edit their config file if necessary, before starting
+.B multipathd.
+
+If
+.B /etc/multipath.conf
+already exists, mpathconf will edit it. If it does not exist, mpathconf will
+create a default file with
+.B user_friendly_names
+and
+.B find_multipaths
+set. To disable these, use the
+.B --user_friendly_names n
+and
+.B --find_multipaths n
+options
+.SH COMMANDS
+.TP
+.B --enable
+Removes any line that blacklists all device nodes from the
+.B /etc/multipath.conf
+blacklist section.
+.TP
+.B --disable
+Adds a line that blacklists all device nodes to the
+.B /etc/multipath.conf
+blacklist section. If no blacklist section exists, it will create one.
+.TP
+.B --user_friendly_name \fP { \fBy\fP | \fBn\fP }
+If set to \fBy\fP, this adds the line
+.B user_friendly_names yes
+to the
+.B /etc/multipath.conf
+defaults section. If set to \fBn\fP, this removes the line, if present. This
+command can be used along with any other command.
+.TP
+.B --find_multipaths\fP { \fBy\fP | \fBn\fP }
+If set to \fBy\fP, this adds the line
+.B find_multipaths yes
+to the
+.B /etc/multipath.conf
+defaults section. If set to \fBn\fP, this removes the line, if present. This
+command can be used aldong with any other command.
+.SH OPTIONS
+.TP
+.B --with_module\fP { \fBy\fP | \fBn\fP }
+If set to \fBy\fP, this runs
+.B modprobe dm_multipath
+to install the multipath modules. This option only works with the
+.B --enable
+command. This option is set to \fBy\fP by default.
+.TP
+.B --with_multipathd { \fBy\fP | \fBn\fP }
+If set to \fBy\fP, this runs
+.B service multipathd start
+to start the multipathd daemon on \fB--enable\fP,
+.B service multipathd stop
+to stop the multipathd daemon on \fB--disable\fP, and
+.B service multipathd reload
+to reconfigure multipathd on \fB--user_frindly_names\fP and
+\fB--find_multipaths\fP.
+This option is set to \fBn\fP by default.
+.SH FILES
+.BR /etc/multipath.conf
+.SH "SEE ALSO"
+.BR multipath.conf (5),
+.BR modprobe (8),
+.BR multipath (8),
+.BR multipathd (8),
+.BR service (8),
+.SH AUTHOR
+Benjamin Marzinski <bmarzins@redhat.com>
--
2.7.4

View File

@ -1,167 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Fri, 17 Oct 2014 11:20:34 -0500
Subject: [PATCH] RH: add wwids from kernel cmdline mpath.wwids with -A
This patch adds another option to multipath, "-A", which reads
/proc/cmdline for mpath.wwid=<WWID> options, and adds any wwids it finds
to /etc/multipath/wwids. While this isn't usually important during
normal operation, since these wwids should already be added, it can be
helpful during installation, to make sure that multipath can claim
devices as its own, before LVM or something else makes use of them. The
patch also execs "/sbin/multipath -A" before running multipathd in
multipathd.service
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/wwids.c | 44 +++++++++++++++++++++++++++++++++++++++++++
libmultipath/wwids.h | 1 +
multipath/main.c | 10 ++++++++--
multipath/multipath.8 | 5 ++++-
multipathd/multipathd.service | 1 +
5 files changed, 58 insertions(+), 3 deletions(-)
diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c
index 53e7951..39e08cd 100644
--- a/libmultipath/wwids.c
+++ b/libmultipath/wwids.c
@@ -443,3 +443,47 @@ int op ## _wwid(const char *wwid) \
declare_failed_wwid_op(is_failed, false)
declare_failed_wwid_op(mark_failed, true)
declare_failed_wwid_op(unmark_failed, true)
+
+int remember_cmdline_wwid(void)
+{
+ FILE *f = NULL;
+ char buf[LINE_MAX], *next, *ptr;
+ int ret = 0;
+
+ f = fopen("/proc/cmdline", "re");
+ if (!f) {
+ condlog(0, "can't open /proc/cmdline : %s", strerror(errno));
+ return -1;
+ }
+
+ if (!fgets(buf, sizeof(buf), f)) {
+ if (ferror(f))
+ condlog(0, "read of /proc/cmdline failed : %s",
+ strerror(errno));
+ else
+ condlog(0, "couldn't read /proc/cmdline");
+ fclose(f);
+ return -1;
+ }
+ fclose(f);
+ next = buf;
+ while((ptr = strstr(next, "mpath.wwid="))) {
+ ptr += 11;
+ next = strpbrk(ptr, " \t\n");
+ if (next) {
+ *next = '\0';
+ next++;
+ }
+ if (strlen(ptr)) {
+ if (remember_wwid(ptr) != 0)
+ ret = -1;
+ }
+ else {
+ condlog(0, "empty mpath.wwid kernel command line option");
+ ret = -1;
+ }
+ if (!next)
+ break;
+ }
+ return ret;
+}
diff --git a/libmultipath/wwids.h b/libmultipath/wwids.h
index 0c6ee54..e32a0b0 100644
--- a/libmultipath/wwids.h
+++ b/libmultipath/wwids.h
@@ -17,6 +17,7 @@ int remember_wwid(char *wwid);
int check_wwids_file(char *wwid, int write_wwid);
int remove_wwid(char *wwid);
int replace_wwids(vector mp);
+int remember_cmdline_wwid(void);
enum {
WWID_IS_NOT_FAILED = 0,
diff --git a/multipath/main.c b/multipath/main.c
index 6fdde03..7bac232 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -109,7 +109,7 @@ usage (char * progname)
{
fprintf (stderr, VERSION_STRING);
fprintf (stderr, "Usage:\n");
- fprintf (stderr, " %s [-a|-c|-w|-W] [-d] [-r] [-i] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname);
+ fprintf (stderr, " %s [-a|-A|-c|-w|-W] [-d] [-r] [-i] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname);
fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [-R num] [dev]\n", progname);
fprintf (stderr, " %s -F [-v lvl] [-R num]\n", progname);
fprintf (stderr, " %s -t\n", progname);
@@ -123,6 +123,8 @@ usage (char * progname)
" -f flush a multipath device map\n"
" -F flush all multipath device maps\n"
" -a add a device wwid to the wwids file\n"
+ " -A add devices from kernel command line mpath.wwids\n"
+ " parameters to wwids file\n"
" -c check if a device should be a path in a multipath device\n"
" -C check if a multipath device has usable paths\n"
" -q allow queue_if_no_path when multipathd is not running\n"
@@ -907,7 +909,7 @@ main (int argc, char *argv[])
exit(1);
multipath_conf = conf;
conf->retrigger_tries = 0;
- while ((arg = getopt(argc, argv, ":adcChl::FfM:v:p:b:BrR:itquUwW")) != EOF ) {
+ while ((arg = getopt(argc, argv, ":aAdcChl::FfM:v:p:b:BrR:itquUwW")) != EOF ) {
switch(arg) {
case 1: printf("optarg : %s\n",optarg);
break;
@@ -974,6 +976,10 @@ main (int argc, char *argv[])
case 't':
r = dump_config(conf);
goto out_free_config;
+ case 'A':
+ if (remember_cmdline_wwid() != 0)
+ exit(1);
+ exit(0);
case 'h':
usage(argv[0]);
exit(0);
diff --git a/multipath/multipath.8 b/multipath/multipath.8
index 914a8cb..8c6a4c1 100644
--- a/multipath/multipath.8
+++ b/multipath/multipath.8
@@ -25,7 +25,7 @@ multipath \- Device mapper target autoconfig.
.RB [\| \-b\ \c
.IR bindings_file \|]
.RB [\| \-d \|]
-.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-C | \-q | \-r | \-i | \-a | \-u | \-U | \-w | \-W \|]
+.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-C | \-q | \-r | \-i | \-a | \-A | \-u | \-U | \-w | \-W \|]
.RB [\| \-p\ \c
.IR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|]
.RB [\| \-R\ \c
@@ -135,6 +135,9 @@ Add the WWID for the specified device to the WWIDs file.
Check if the device specified in the program environment should be
a path in a multipath device.
.
+.B \-A
+add wwids from any kernel command line mpath.wwid parameters to the wwids file
+.
.TP
.B \-U
Check if the device specified in the program environment is a multipath device
diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service
index 17434ce..0fbcc46 100644
--- a/multipathd/multipathd.service
+++ b/multipathd/multipathd.service
@@ -15,6 +15,7 @@ Type=notify
NotifyAccess=main
LimitCORE=infinity
ExecStartPre=-/sbin/modprobe -a scsi_dh_alua scsi_dh_emc scsi_dh_rdac dm-multipath
+ExecStartPre=-/sbin/multipath -A
ExecStart=/sbin/multipathd -d -s
ExecReload=/sbin/multipathd reconfigure
TasksMax=infinity
--
2.7.4

View File

@ -1,121 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Mon, 6 Nov 2017 21:39:28 -0600
Subject: [PATCH] RH: warn on invalid regex instead of failing
multipath.conf used to allow "*" as a match everything regular expression,
instead of requiring ".*". Instead of erroring when the old style
regular expressions are used, it should print a warning and convert
them.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/dict.c | 27 +++++++++++++++++++++------
libmultipath/parser.c | 13 +++++++++++++
libmultipath/parser.h | 1 +
3 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index 7ad0f5a..ab808d6 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -55,6 +55,21 @@ set_str(vector strvec, void *ptr)
}
static int
+set_regex(vector strvec, void *ptr)
+{
+ char **str_ptr = (char **)ptr;
+
+ if (*str_ptr)
+ FREE(*str_ptr);
+ *str_ptr = set_regex_value(strvec);
+
+ if (!*str_ptr)
+ return 1;
+
+ return 0;
+}
+
+static int
set_yes_no(vector strvec, void *ptr)
{
char * buff;
@@ -1271,7 +1286,7 @@ ble_ ## option ## _handler (struct config *conf, vector strvec) \
if (!conf->option) \
return 1; \
\
- buff = set_value(strvec); \
+ buff = set_regex_value(strvec); \
if (!buff) \
return 1; \
\
@@ -1287,7 +1302,7 @@ ble_ ## option ## _ ## name ## _handler (struct config *conf, vector strvec) \
if (!conf->option) \
return 1; \
\
- buff = set_value(strvec); \
+ buff = set_regex_value(strvec); \
if (!buff) \
return 1; \
\
@@ -1388,16 +1403,16 @@ device_handler(struct config *conf, vector strvec)
return 0;
}
-declare_hw_handler(vendor, set_str)
+declare_hw_handler(vendor, set_regex)
declare_hw_snprint(vendor, print_str)
-declare_hw_handler(product, set_str)
+declare_hw_handler(product, set_regex)
declare_hw_snprint(product, print_str)
-declare_hw_handler(revision, set_str)
+declare_hw_handler(revision, set_regex)
declare_hw_snprint(revision, print_str)
-declare_hw_handler(bl_product, set_str)
+declare_hw_handler(bl_product, set_regex)
declare_hw_snprint(bl_product, print_str)
declare_hw_handler(hwhandler, set_str)
diff --git a/libmultipath/parser.c b/libmultipath/parser.c
index b8b7e0d..34b4ad2 100644
--- a/libmultipath/parser.c
+++ b/libmultipath/parser.c
@@ -380,6 +380,19 @@ set_value(vector strvec)
return alloc;
}
+void *
+set_regex_value(vector strvec)
+{
+ char *buff = set_value(strvec);
+
+ if (buff && strcmp("*", buff) == 0) {
+ condlog(0, "Invalid regular expression \"*\" in multipath.conf. Using \".*\"");
+ FREE(buff);
+ return strdup(".*");
+ }
+ return buff;
+}
+
/* non-recursive configuration stream handler */
static int kw_level = 0;
diff --git a/libmultipath/parser.h b/libmultipath/parser.h
index 62906e9..b791705 100644
--- a/libmultipath/parser.h
+++ b/libmultipath/parser.h
@@ -77,6 +77,7 @@ extern void dump_keywords(vector keydump, int level);
extern void free_keywords(vector keywords);
extern vector alloc_strvec(char *string);
extern void *set_value(vector strvec);
+extern void *set_regex_value(vector strvec);
extern int process_file(struct config *conf, char *conf_file);
extern struct keyword * find_keyword(vector keywords, vector v, char * name);
int snprint_keyword(char *buff, int len, char *fmt, struct keyword *kw,
--
2.7.4

View File

@ -1,29 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Thu, 7 Jun 2018 17:43:52 -0500
Subject: [PATCH] RH: reset default find_mutipaths value to off
Upstream has changed to default find_multipaths to "strict". For now
Redhat will retain the previous default of "off".
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/defaults.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
index f076b4b..70ba98a 100644
--- a/libmultipath/defaults.h
+++ b/libmultipath/defaults.h
@@ -17,7 +17,7 @@
#define DEFAULT_NO_PATH_RETRY NO_PATH_RETRY_UNDEF
#define DEFAULT_VERBOSITY 2
#define DEFAULT_REASSIGN_MAPS 0
-#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_STRICT
+#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_OFF
#define DEFAULT_FAST_IO_FAIL 5
#define DEFAULT_DEV_LOSS_TMO 600
#define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_ON
--
2.7.4

View File

@ -1,49 +0,0 @@
From 8bdd4481d822b6625d8bf719431ca74ed1b5e021 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Mon, 16 Jul 2018 15:56:37 +0800
Subject: [PATCH] multipath-tools: modify Makefile.inc for cross-compilation
Do not look for systemd info on the host, and allow us to pass in CFLAGS
using the OPTFLAGS variable.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Joe Slater <joe.slater@windriver.com>
Update for version 0.5.0-144-g770e6d0
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Update for version 0.7.1
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
update for version 0.7.7
remove change about CFLAGS part, since patch 0024 already have similar function.
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
Makefile.inc | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index 57a1835..0c403c7 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -38,12 +38,6 @@ ifndef RUN
endif
endif
-ifndef SYSTEMD
- ifeq ($(shell systemctl --version > /dev/null 2>&1 && echo 1), 1)
- SYSTEMD = $(shell systemctl --version 2> /dev/null | sed -n 's/systemd \([0-9]*\)/\1/p')
- endif
-endif
-
ifndef SYSTEMDPATH
SYSTEMDPATH=usr/lib
endif
--
2.7.4

View File

@ -1,57 +0,0 @@
From d929a1ea5e42ecbe30c990644ed4ada2817c6439 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Mon, 16 Jul 2018 16:00:14 +0800
Subject: [PATCH] Always use devmapper
Do not try to compute several _API_ make variables
from host information when cross-compiling.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
Signed-off-by: Joe Slater <joe.slater@windriver.com>
Rebase to 0.7.1
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Rebase to 0.7.7
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
libmultipath/Makefile | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/libmultipath/Makefile b/libmultipath/Makefile
index f51786d..3ad9c48 100644
--- a/libmultipath/Makefile
+++ b/libmultipath/Makefile
@@ -20,21 +20,10 @@ ifdef SYSTEMD
endif
endif
-ifneq ($(call check_func,dm_task_no_flush,/usr/include/libdevmapper.h),0)
- CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE
-endif
-
-ifneq ($(call check_func,dm_task_set_cookie,/usr/include/libdevmapper.h),0)
- CFLAGS += -DLIBDM_API_COOKIE
-endif
-
-ifneq ($(call check_func,udev_monitor_set_receive_buffer_size,/usr/include/libudev.h),0)
- CFLAGS += -DLIBUDEV_API_RECVBUF
-endif
-
-ifneq ($(call check_func,dm_task_deferred_remove,/usr/include/libdevmapper.h),0)
- CFLAGS += -DLIBDM_API_DEFERRED
-endif
+CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE
+CFLAGS += -DLIBDM_API_COOKIE
+CFLAGS += -DLIBUDEV_API_RECVBUF
+CFLAGS += -DLIBDM_API_DEFERRED
OBJS = memory.o parser.o vector.o devmapper.o callout.o \
hwtable.o blacklist.o util.o dmparser.o config.o \
--
2.7.4

View File

@ -1,40 +0,0 @@
From 145f2b829e5362cda975bebafd7fe4d00ff56d1c Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Mon, 16 Jul 2018 16:02:07 +0800
Subject: [PATCH] Always use devmapper for kpartx
Do not try to compute the LIBDM_API_COOKIE make variable
from host information when cross-compiling.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
Signed-off-by: Joe Slater <joe.slater@windriver.com>
Rebase to 0.7.1
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Rebase to 0.7.7
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
kpartx/Makefile | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kpartx/Makefile b/kpartx/Makefile
index 7eb467e..c143321 100644
--- a/kpartx/Makefile
+++ b/kpartx/Makefile
@@ -8,9 +8,7 @@ LDFLAGS += $(BIN_LDFLAGS)
LIBDEPS += -ldevmapper
-ifneq ($(call check_func,dm_task_set_cookie,/usr/include/libdevmapper.h),0)
- CFLAGS += -DLIBDM_API_COOKIE
-endif
+CFLAGS += -DLIBDM_API_COOKIE
OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \
gpt.o mac.o ps3.o crc32.o lopart.o xstrncpy.o devmapper.o
--
2.7.4

View File

@ -1,90 +0,0 @@
# This is a basic configuration file with some examples, for device mapper
# multipath.
# For a complete list of the default configuration values, see
# /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.defaults
# For a list of configuration options with descriptions, see
# /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.annotated
## By default, devices with vendor = "IBM" and product = "S/390.*" are
## blacklisted. To enable mulitpathing on these devies, uncomment the
## following lines.
#blacklist_exceptions {
# device {
# vendor "IBM"
# product "S/390.*"
# }
#}
## Use user friendly names, instead of using WWIDs as names.
defaults {
user_friendly_names yes
}
##
## Here is an example of how to configure some standard options.
##
#
#defaults {
# udev_dir /dev
# polling_interval 10
# selector "round-robin 0"
# path_grouping_policy multibus
# getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
# prio alua
# path_checker readsector0
# rr_min_io 100
# max_fds 8192
# rr_weight priorities
# failback immediate
# no_path_retry fail
# user_friendly_names yes
#}
##
## The wwid line in the following blacklist section is shown as an example
## of how to blacklist devices by wwid. The 2 devnode lines are the
## compiled in default blacklist. If you want to blacklist entire types
## of devices, such as all scsi devices, you should use a devnode line.
## However, if you want to blacklist specific devices, you should use
## a wwid line. Since there is no guarantee that a specific device will
## not change names on reboot (from /dev/sda to /dev/sdb for example)
## devnode lines are not recommended for blacklisting specific devices.
##
#blacklist {
# wwid 26353900f02796769
# devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
# devnode "^hd[a-z]"
#}
#multipaths {
# multipath {
# wwid 3600508b4000156d700012000000b0000
# alias yellow
# path_grouping_policy multibus
# path_checker readsector0
# path_selector "round-robin 0"
# failback manual
# rr_weight priorities
# no_path_retry 5
# }
# multipath {
# wwid 1DEC_____321816758474
# alias red
# }
#}
#devices {
# device {
# vendor "COMPAQ "
# product "HSV110 (C)COMPAQ"
# path_grouping_policy multibus
# getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
# path_checker readsector0
# path_selector "round-robin 0"
# hardware_handler "0"
# failback 15
# rr_weight priorities
# no_path_retry queue
# }
# device {
# vendor "COMPAQ "
# product "MSA1000 "
# path_grouping_policy multibus
# }
#}

View File

@ -1,146 +0,0 @@
#!/bin/bash
#
# multipathd Starts the multipath daemon
#
# chkconfig: - 06 87
# description: Manages device-mapper multipath devices
### BEGIN INIT INFO
# Provides: multipathd
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Control multipathd
# Description: This service monitors and manages
# device-mapper multipath devices
### END INIT INFO
DAEMON=/sbin/multipathd
prog=`basename $DAEMON`
initdir=/etc/init.d
lockdir=/var/lock/subsys
sysconfig=/etc/sysconfig
syspath=/sys/block
RETVAL=0
teardown_slaves()
{
pushd $1 > /dev/null
if [ -d "slaves" ]; then
for slave in slaves/*;
do
if [ "$slave" = "slaves/*" ]; then
read dev < $1/dev
tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"`
if ! [ -z $tablename ]; then
echo "Root is on a multipathed device, multipathd can not be stopped"
exit 1
fi
else
local_slave=`readlink -f $slave`;
teardown_slaves $local_slave;
fi
done
else
read dev < $1/dev
tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"`
if ! [ -z $tablename ]; then
echo "Root is on a multipathed device, multipathd can not be stopped"
exit 1
fi
fi
popd > /dev/null
}
#
# See how we were called.
#
start() {
test -x $DAEMON || exit 5
echo -n $"Starting $prog daemon: "
start-stop-daemon --start --quiet --exec $DAEMON
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $lockdir/$prog
echo
}
force_stop() {
echo -n $"Stopping $prog daemon: "
killall $DAEMON
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f $lockdir/$prog
echo
}
stop() {
root_dev=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/mtab)
dm_num=`dmsetup info -c --noheadings -o minor $root_dev 2> /dev/null`
if [ $? -eq 0 ]; then
root_dm_device="dm-$dm_num"
[ -d $syspath/$root_dm_device ] && teardown_slaves $syspath/$root_dm_device
fi
force_stop
}
restart() {
stop
start
}
force_restart() {
force_stop
start
}
reload() {
echo -n "Reloading $prog: "
trap "" SIGHUP
killall $DAEMON -s SIGHUP -v
RETVAL=$?
echo
}
case "$1" in
start)
start
;;
stop)
stop
;;
force-stop)
force_stop
;;
force-reload|reload)
reload
;;
restart)
restart
;;
force-restart)
force_restart
;;
condrestart|try-restart)
if [ -f $lockdir/$prog ]; then
restart
fi
;;
status)
if pidof -o %PPID $DAEMON > /dev/null; then
echo "Running"
RETVAL=0
else
echo "Not running"
RETVAL=1
fi
;;
*)
echo $"Usage: $0 {start|stop|force-stop|status|restart|force-restart|condrestart|reload}"
RETVAL=2
esac
exit $RETVAL

View File

@ -1,131 +0,0 @@
SUMMARY = "The upstream project used to drive the Device Mapper multipathing driver"
DESCRIPTION = "It provides tools to manage multipath devices \
by instructing the device-mapper kernel module what to do. These \
tools include: \
1. multipath - Scan the system for multipath devices and assemble them.\
2. multipathd - Detects when paths fail and execs multipath to update \
things.\
3. mpathpersist - Persistent reservation management feature allows \
cluster management software to manage persistent reservation through \
mpath device. It processes management requests from callers and hides \
the management task details. It also handles persistent reservation \
management of data path life cycle and state changes.\
4. kpartx - This tool, derived from util-linux's partx, reads partition \
tables on specified device and create device maps over partitions \
segments detected. It is called from hotplug upon device maps creation \
and deletion"
HOMEPAGE = "http://christophe.varoqui.free.fr/"
DEPENDS = "libdevmapper \
libaio \
liburcu \
readline \
udev \
json-c \
"
LICENSE = "GPLv2"
SRC_URI = "git://git.opensvc.com/multipath-tools/.git;protocol=http \
file://multipathd.oe \
file://multipath.conf.example \
file://0001-multipath-tools-add-RDAC-SUN-ArrayStorage-to-hwtable.patch \
file://0002-multipath-tools-remove-c-from-__cpluscplus-misspelle.patch \
file://0003-multipath-tools-remove-emacs-autoconfig-of-kpartx-gp.patch \
file://0004-multipath-tools-replace-FSF-address-with-a-www-point.patch \
file://0005-multipath-tools-Remove-trailing-leading-whitespaces-.patch \
file://0006-multipath-tools-fix-compilation-with-musl-libc.patch \
file://0007-multipath-tools-add-x-to-doc-preclean.pl-and-split-m.patch \
file://0008-multipath-tools-refresh-kernel-doc-from-kernel-sourc.patch \
file://0009-multipath-tools-configure-hitachi-ams2000-and-hus100.patch \
file://0010-libmultipath-don-t-reject-maps-with-undefined-prio.patch \
file://0011-multipathd-handle-errors-in-uxlsnr-as-fatal.patch \
file://0012-libmultipath-fix-error-parsing-find_multipaths-stric.patch \
file://0013-libmultipath-print-correct-default-for-delay_-_check.patch \
file://0014-multipath.conf.5-clarify-property-whitelist-handling.patch \
file://0015-mpathpersist-add-all_tg_pt-option.patch \
file://0016-libmultipath-remove-rbd-code.patch \
file://0017-mpathpersist-fix-aptpl-support.patch \
file://0018-multipath-don-t-check-timestamps-without-a-path.patch \
file://0019-libmultipath-fix-detect-alua-corner-case.patch \
file://0020-multipath-fix-setting-conf-version.patch \
file://0021-RH-fixup-udev-rules-for-redhat.patch \
file://0022-RH-Remove-the-property-blacklist-exception-builtin.patch \
file://0023-RH-don-t-start-without-a-config-file.patch \
file://0024-RH-use-rpm-optflags-if-present.patch \
file://0025-RH-add-mpathconf.patch \
file://0026-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch \
file://0027-RH-warn-on-invalid-regex-instead-of-failing.patch \
file://0028-RH-reset-default-find_mutipaths-value-to-off.patch \
file://0029-multipath-tools-modify-Makefile.inc-for-cross-compil.patch \
file://0030-Always-use-devmapper.patch \
file://0031-Always-use-devmapper-for-kpartx.patch \
"
LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
SRCREV = "386d288b5595fc2c01dffe698b6eb306c6674908"
S = "${WORKDIR}/git"
inherit systemd pkgconfig
SYSTEMD_SERVICE_${PN} = "multipathd.service"
SYSTEMD_AUTO_ENABLE = "disable"
TARGET_CC_ARCH += "${LDFLAGS}"
# multipath-tools includes a copy of the valgrind.h header
# file and uses the macros to suppress some false positives. However,
# that only works on ARM when thumb is disabled. Otherwise one gets:
# Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r12,r12,ror#3'
# ../Makefile.inc:66: recipe for target 'debug.o' failed
ARM_INSTRUCTION_SET_armv4 = "arm"
ARM_INSTRUCTION_SET_armv5 = "arm"
# The exact version of SYSTEMD does not matter but should be greater than 209.
#
EXTRA_OEMAKE = 'MULTIPATH_VERSION=${PV} DESTDIR=${D} syslibdir=${base_libdir} \
OPTFLAGS="${CFLAGS}" \
bindir=${base_sbindir} \
LIB=${base_libdir} libdir=${base_libdir}/multipath \
unitdir=${systemd_system_unitdir} \
${@bb.utils.contains("DISTRO_FEATURES", "systemd", "SYSTEMD=216", "", d)} \
'
do_install() {
oe_runmake install
# We copy an initscript, but do not start multipathd at init time.
#
if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)};then
install -d ${D}${sysconfdir}/init.d
cp ${WORKDIR}/multipathd.oe ${D}${sysconfdir}/init.d/multipathd
fi
install -d ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/multipath.conf.example \
${D}${sysconfdir}/multipath.conf.example
}
FILES_${PN}-dbg += "${base_libdir}/multipath/.debug"
PACKAGES =+ "${PN}-libs"
FILES_${PN}-libs = "${base_libdir}/lib*.so.* \
${base_libdir}/multipath/lib*.so*"
RDEPENDS_${PN} += "${PN}-libs bash"
PROVIDES += "device-mapper-multipath"
RPROVIDES_${PN} += "device-mapper-multipath"
RPROVIDES_${PN}-libs += "device-mapper-multipath-libs"
FILES_${PN}-dev += "${base_libdir}/pkgconfig"
PACKAGES =+ "kpartx"
FILES_kpartx = "${base_sbindir}/kpartx \
${nonarch_libdir}/udev/kpartx_id \
"
RDEPENDS_${PN} += "bash kpartx"

View File

@ -1,25 +0,0 @@
From f1b77e89867d2856bdfe38ca34771e27c2c1d26a Mon Sep 17 00:00:00 2001
From: brl <bruce@subgraph.com>
Date: Fri, 8 Dec 2017 22:31:23 -0500
Subject: [PATCH] Fix CC in makefile
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 7a9cc3e..1f5f278 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
PREFIX=/usr/local
setcolors: setcolors.c
- gcc -Wall setcolors.c -o setcolors
+ $(CC) $(CFLAGS) $(LDFLAGS) -Wall setcolors.c -o setcolors
install: setcolors setcolors.1
install -Dm 755 setcolors "${DESTDIR}${PREFIX}/bin/setcolors"
--
2.14.3

View File

@ -1,25 +0,0 @@
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c9aca5676b62f802a1f83ad9be3359d4"
SRC_URI = "https://github.com/EvanPurkhiser/linux-vt-setcolors/archive/v${PV}.tar.gz \
file://0001-Fix-CC-in-makefile.patch \
"
SRC_URI[md5sum] = "789b4dc02d1c4f509b3b01450c7ef980"
SRC_URI[sha256sum] = "ccad9aac5732faab749e8f6f6b40746ce44afec5633374aa77c8e3ac2a8eef42"
S = "${WORKDIR}/linux-vt-${PN}-${PV}"
do_configure () {
:
}
EXTRA_OEMAKE = "PREFIX=/usr"
do_compile () {
oe_runmake
}
do_install () {
install -Dm 755 setcolors ${D}/${bindir}/setcolors
install -d ${D}/${datadir}/setcolors
cp -R --no-preserve=ownership example-colors/ ${D}/${datadir}/setcolors
}

View File

@ -1,21 +0,0 @@
SUMMARY = "A recursive directory listing command"
HOMEPAGE = "http://mama.indstate.edu/users/ice/tree/"
SECTION = "console/utils"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833"
SRC_URI = "ftp://mama.indstate.edu/linux/${BPN}/${BP}.tgz"
SRC_URI[md5sum] = "abe3e03e469c542d8e157cdd93f4d8a6"
SRC_URI[sha256sum] = "6957c20e82561ac4231638996e74f4cfa4e6faabc5a2f511f0b4e3940e8f7b12"
# tree's default CFLAGS for Linux
CFLAGS += "-Wall -DLINUX -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
EXTRA_OEMAKE = "CC='${CC}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
do_configure[noexec] = "1"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${S}/${BPN} ${D}${bindir}/
}