summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile11
-rw-r--r--iscsiuio/.gitignore3
-rw-r--r--iscsiuio/Makefile.am7
-rw-r--r--iscsiuio/src/unix/Makefile.am2
-rw-r--r--libopeniscsiusr/Makefile37
-rw-r--r--libopeniscsiusr/docs/doc-preclean.pl28
-rwxr-xr-x[-rw-r--r--]libopeniscsiusr/docs/kernel-doc27
-rwxr-xr-xlibopeniscsiusr/docs/list-man-pages.sh21
-rw-r--r--libopeniscsiusr/docs/split-man.pl39
-rw-r--r--libopeniscsiusr/idbm.c1
-rw-r--r--libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h4
-rw-r--r--libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_node.h2
-rw-r--r--libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_session.h2
-rw-r--r--libopeniscsiusr/version.h30
-rw-r--r--sysdeps/Makefile (renamed from utils/sysdeps/Makefile)0
-rw-r--r--sysdeps/sysdeps.c (renamed from utils/sysdeps/sysdeps.c)0
-rw-r--r--usr/Makefile5
-rw-r--r--usr/fwparam_ibft/Makefile3
-rw-r--r--usr/version.h6
19 files changed, 76 insertions, 152 deletions
diff --git a/Makefile b/Makefile
index 826eb49..83db9d3 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,9 @@
# that you want everything installed into.
DESTDIR ?=
+# our VERSION String
+ISCSI_VERSION_STR ?= 2.1.7
+
prefix = /usr
exec_prefix =
mandir = $(prefix)/share/man
@@ -19,7 +22,7 @@ RULESDIR = $(etcdir)/udev/rules.d
INSTALL = /usr/bin/install
# pass these on to sub-Makefiles
-export DESTDIR prefix INSTALL SBINDIR HOMEDIR DBROOT RULESDIR
+export DESTDIR prefix INSTALL SBINDIR HOMEDIR DBROOT RULESDIR ISCSI_VERSION_STR
# Compatibility: parse old OPTFLAGS argument
ifdef OPTFLAGS
@@ -51,7 +54,7 @@ make_utils:
user: iscsiuio/Makefile
$(MAKE) $(MFLAGS) -C libopeniscsiusr
- $(MAKE) $(MFLAGS) -C utils/sysdeps
+ $(MAKE) $(MFLAGS) -C sysdeps
$(MAKE) $(MFLAGS) -C usr
$(MAKE) $(MFLAGS) -C utils
$(MAKE) $(MFLAGS) -C etc
@@ -77,7 +80,7 @@ iscsiuio/configure: iscsiuio/configure.ac iscsiuio/Makefile.am
force: ;
clean distclean:
- $(MAKE) $(MFLAGS) -C utils/sysdeps $@
+ $(MAKE) $(MFLAGS) -C sysdeps $@
$(MAKE) $(MFLAGS) -C utils $@
$(MAKE) $(MFLAGS) -C usr $@
$(MAKE) $(MFLAGS) -C etc $@
@@ -121,7 +124,7 @@ install_libopeniscsiusr:
$(MAKE) $(MFLAGS) -C libopeniscsiusr install
depend:
- for dir in usr utils utils/fwparam_ibft utils/sysdeps; do \
+ for dir in usr utils utils/fwparam_ibft sysdeps; do \
$(MAKE) $(MFLAGS) -C $$dir $@; \
done
diff --git a/iscsiuio/.gitignore b/iscsiuio/.gitignore
index ef21b5f..a6c85d6 100644
--- a/iscsiuio/.gitignore
+++ b/iscsiuio/.gitignore
@@ -22,6 +22,3 @@ install-sh
libtool
ltmain.sh
missing
-
-# generated man page
-iscsiuio.8.gz
diff --git a/iscsiuio/Makefile.am b/iscsiuio/Makefile.am
index 4f928f7..ef077a4 100644
--- a/iscsiuio/Makefile.am
+++ b/iscsiuio/Makefile.am
@@ -17,12 +17,9 @@ logdir = /etc/logrotate.d
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install-man install-log install-brcm
-install-man: $(DESTDIR)$(mandir)/man8/iscsiuio.8.gz
+install-man: $(DESTDIR)$(mandir)/man8/iscsiuio.8
-iscsiuio.8.gz: docs/iscsiuio.8
- gzip $(GZIP_ENV) -c < $? > $@
-
-$(DESTDIR)$(mandir)/man8/iscsiuio.8.gz: iscsiuio.8.gz
+$(DESTDIR)$(mandir)/man8/iscsiuio.8: docs/iscsiuio.8
$(INSTALL) -d $(DESTDIR)$(mandir)/man8/
$(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man8/
diff --git a/iscsiuio/src/unix/Makefile.am b/iscsiuio/src/unix/Makefile.am
index 4c10711..f48a1f7 100644
--- a/iscsiuio/src/unix/Makefile.am
+++ b/iscsiuio/src/unix/Makefile.am
@@ -21,7 +21,7 @@ iscsiuio_SOURCES = build_date.c \
packet.c \
iscsid_ipc.c \
ping.c \
- ${top_srcdir}/../utils/sysdeps/sysdeps.c
+ ${top_srcdir}/../sysdeps/sysdeps.c
iscsiuio_CFLAGS = $(AM_CFLAGS) \
$(LIBNL_CFLAGS) \
diff --git a/libopeniscsiusr/Makefile b/libopeniscsiusr/Makefile
index cee97a1..0d215fc 100644
--- a/libopeniscsiusr/Makefile
+++ b/libopeniscsiusr/Makefile
@@ -29,7 +29,6 @@ PKGCONF_DIR ?= $(LIB_DIR)/pkgconfig
MAN_DIR = $(prefix)/share/man
PKG_CONFIG ?= /usr/bin/pkg-config
-SED ?= sed
LIBISCSI_USR_DIR=$(TOPDIR)/libopeniscsiusr
@@ -46,7 +45,7 @@ HEADERS = libopeniscsiusr/libopeniscsiusr.h \
libopeniscsiusr/libopeniscsiusr_iface.h \
libopeniscsiusr/libopeniscsiusr_node.h
TESTS = tests/test_context tests/test_session tests/test_iface tests/test_node
-EXTRA_MAN_FILES = libopeniscsiusr.h.3
+EXTRA_MAN_FILE = libopeniscsiusr.h.3
OBJS = context.o misc.o session.o sysfs.o iface.o idbm.o node.o default.o
@@ -55,6 +54,7 @@ CFLAGS += -Wall -Werror -Wextra -fvisibility=hidden -fPIC
CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
CFLAGS += -DSBINDIR=\"$(SBINDIR)\"
CFLAGS += -DISCSI_DB_ROOT=\"$(DBROOT)\"
+CFLAGS += -DISCSI_VERSION_STR=\"$(ISCSI_VERSION_STR)\"
LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod)
@@ -70,7 +70,7 @@ $(LIBS_MAJOR): $(LIBS)
ln -sf $(LIBS) $@
clean:
- $(RM) vgcore* core *.a *.o *.gz *.so *.so.* $(TESTS)
+ $(RM) vgcore* core *.a *.o *.so *.so.* $(TESTS)
$(RM) -r docs/man
distclean: ;
@@ -95,7 +95,7 @@ install_libs: $(LIBS) $(LIBS_MAJOR)
install_docs: doc
$(INSTALL) -d $(DESTDIR)$(MAN_DIR)/man3
- $(INSTALL) -m 644 docs/man/*.gz $(DESTDIR)$(MAN_DIR)/man3/
+ $(INSTALL) -m 644 docs/man/*.3 $(DESTDIR)$(MAN_DIR)/man3/
install_pkg_files:
$(INSTALL) -m 644 -D $(PKGFILE).in $(DESTDIR)$(PKGCONF_DIR)/$(PKGFILE)
@@ -106,23 +106,20 @@ install_pkg_files:
perl -i -pe 's|__INCLUDE_DIR__|$(INCLUDE_DIR)|g' \
$(DESTDIR)$(PKGCONF_DIR)/$(PKGFILE)
-doc: docs/man/$(EXTRA_MAN_FILES).gz
-
-TEMPFILE := $(shell mktemp)
-
-docs/man/$(EXTRA_MAN_FILES).gz: $(HEADERS)
- @for file in $(EXTRA_MAN_FILES); do \
- $(INSTALL) -v -m 644 -D docs/$$file docs/man/$$file; \
- done
- cat $(HEADERS) | \
- perl docs/doc-preclean.pl > "$(TEMPFILE)"
- perl docs/kernel-doc -man "$(TEMPFILE)" | \
- perl docs/split-man.pl docs/man
- -$(RM) "$(TEMPFILE)"
- @for file in docs/man/*.3; do \
- gzip -f $$file; \
+doc: docs/man/$(EXTRA_MAN_FILE)
+
+# install the static man page, and generate lots of lib man pages
+# note: the last line just prints out the man page names
+docs/man/$(EXTRA_MAN_FILE): $(HEADERS)
+ $(INSTALL) -v -m 644 -D docs/$(EXTRA_MAN_FILE) $@
+ @echo generating library man pages ...
+ @for h in $(HEADERS); do \
+ for f in `docs/list-man-pages.sh $$h`; do \
+ docs/kernel-doc -module libopeniscsiusr \
+ -man -function $$f $$h >docs/man/$$f.3 ; \
+ done; \
done
- find docs/man -type f -name \*[0-9].gz
+ find docs/man -type f -name \*[0-9]
.PHONY: all install clean distclean doc install_pkg_files install_docs \
install_libs check
diff --git a/libopeniscsiusr/docs/doc-preclean.pl b/libopeniscsiusr/docs/doc-preclean.pl
deleted file mode 100644
index bdffe95..0000000
--- a/libopeniscsiusr/docs/doc-preclean.pl
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/perl
-# Copyright (C) 2016 Red Hat, Inc.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author: Gris Ge <fge@redhat.com>
-
-use strict;
-
-my @REMOVE_KEY_LIST=("__DLL_EXPORT");
-
-while (<>) {
- for my $key (@REMOVE_KEY_LIST) {
- (s/$key//g);
- }
- print;
-}
diff --git a/libopeniscsiusr/docs/kernel-doc b/libopeniscsiusr/docs/kernel-doc
index 7bd52b8..75b68a8 100644..100755
--- a/libopeniscsiusr/docs/kernel-doc
+++ b/libopeniscsiusr/docs/kernel-doc
@@ -1134,12 +1134,12 @@ sub output_function_xml(%) {
print "<refentry id=\"$id\">\n";
print "<refentryinfo>\n";
print " <title>LINUX</title>\n";
- print " <productname>Kernel Hackers Manual</productname>\n";
+ print " <productname>API Manual</productname>\n";
print " <date>$man_date</date>\n";
print "</refentryinfo>\n";
print "<refmeta>\n";
print " <refentrytitle><phrase>" . $args{'function'} . "</phrase></refentrytitle>\n";
- print " <manvolnum>9</manvolnum>\n";
+ print " <manvolnum>3</manvolnum>\n";
print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
@@ -1212,12 +1212,12 @@ sub output_struct_xml(%) {
print "<refentry id=\"$id\">\n";
print "<refentryinfo>\n";
print " <title>LINUX</title>\n";
- print " <productname>Kernel Hackers Manual</productname>\n";
+ print " <productname>API Manual</productname>\n";
print " <date>$man_date</date>\n";
print "</refentryinfo>\n";
print "<refmeta>\n";
print " <refentrytitle><phrase>" . $args{'type'} . " " . $args{'struct'} . "</phrase></refentrytitle>\n";
- print " <manvolnum>9</manvolnum>\n";
+ print " <manvolnum>3</manvolnum>\n";
print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
@@ -1307,12 +1307,12 @@ sub output_enum_xml(%) {
print "<refentry id=\"$id\">\n";
print "<refentryinfo>\n";
print " <title>LINUX</title>\n";
- print " <productname>Kernel Hackers Manual</productname>\n";
+ print " <productname>API Manual</productname>\n";
print " <date>$man_date</date>\n";
print "</refentryinfo>\n";
print "<refmeta>\n";
print " <refentrytitle><phrase>enum " . $args{'enum'} . "</phrase></refentrytitle>\n";
- print " <manvolnum>9</manvolnum>\n";
+ print " <manvolnum>3</manvolnum>\n";
print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
@@ -1374,12 +1374,12 @@ sub output_typedef_xml(%) {
print "<refentry id=\"$id\">\n";
print "<refentryinfo>\n";
print " <title>LINUX</title>\n";
- print " <productname>Kernel Hackers Manual</productname>\n";
+ print " <productname>API Manual</productname>\n";
print " <date>$man_date</date>\n";
print "</refentryinfo>\n";
print "<refmeta>\n";
print " <refentrytitle><phrase>typedef " . $args{'typedef'} . "</phrase></refentrytitle>\n";
- print " <manvolnum>9</manvolnum>\n";
+ print " <manvolnum>3</manvolnum>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
print " <refname>typedef " . $args{'typedef'} . "</refname>\n";
@@ -1521,13 +1521,14 @@ sub output_function_man(%) {
my ($parameter, $section);
my $count;
- print ".TH \"$args{'function'}\" 9 \"$args{'function'}\" \"$man_date\" \"Kernel Hacker's Manual\" LINUX\n";
+ print ".TH \"$args{'function'}\" 3 \"$args{'function'}\" \"$man_date\" \"API Manual\" LINUX\n";
print ".SH NAME\n";
print $args{'function'} . " \\- " . $args{'purpose'} . "\n";
print ".SH SYNOPSIS\n";
if ($args{'functiontype'} ne "") {
+ $args{'functiontype'} =~ s/__DLL_EXPORT\s*//g;
print ".B \"" . $args{'functiontype'} . "\" " . $args{'function'} . "\n";
} else {
print ".B \"" . $args{'function'} . "\n";
@@ -1572,7 +1573,7 @@ sub output_enum_man(%) {
my ($parameter, $section);
my $count;
- print ".TH \"$args{'module'}\" 9 \"enum $args{'enum'}\" \"$man_date\" \"API Manual\" LINUX\n";
+ print ".TH \"$args{'module'}\" 3 \"enum $args{'enum'}\" \"$man_date\" \"API Manual\" LINUX\n";
print ".SH NAME\n";
print "enum " . $args{'enum'} . " \\- " . $args{'purpose'} . "\n";
@@ -1612,7 +1613,7 @@ sub output_struct_man(%) {
my %args = %{$_[0]};
my ($parameter, $section);
- print ".TH \"$args{'module'}\" 9 \"" . $args{'type'} . " " . $args{'struct'} . "\" \"$man_date\" \"API Manual\" LINUX\n";
+ print ".TH \"$args{'module'}\" 3 \"" . $args{'type'} . " " . $args{'struct'} . "\" \"$man_date\" \"API Manual\" LINUX\n";
print ".SH NAME\n";
print $args{'type'} . " " . $args{'struct'} . " \\- " . $args{'purpose'} . "\n";
@@ -1667,7 +1668,7 @@ sub output_typedef_man(%) {
my %args = %{$_[0]};
my ($parameter, $section);
- print ".TH \"$args{'module'}\" 9 \"$args{'typedef'}\" \"$man_date\" \"API Manual\" LINUX\n";
+ print ".TH \"$args{'module'}\" 3 \"$args{'typedef'}\" \"$man_date\" \"API Manual\" LINUX\n";
print ".SH NAME\n";
print "typedef " . $args{'typedef'} . " \\- " . $args{'purpose'} . "\n";
@@ -1683,7 +1684,7 @@ sub output_blockhead_man(%) {
my ($parameter, $section);
my $count;
- print ".TH \"$args{'module'}\" 9 \"$args{'module'}\" \"$man_date\" \"API Manual\" LINUX\n";
+ print ".TH \"$args{'module'}\" 3 \"$args{'module'}\" \"$man_date\" \"API Manual\" LINUX\n";
foreach $section (@{$args{'sectionlist'}}) {
print ".SH \"$section\"\n";
diff --git a/libopeniscsiusr/docs/list-man-pages.sh b/libopeniscsiusr/docs/list-man-pages.sh
new file mode 100755
index 0000000..dda8277
--- /dev/null
+++ b/libopeniscsiusr/docs/list-man-pages.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# list man pages found given one or more ??? passed in
+#
+# copied from
+# https://github.com/linux-nvme/libnvme:doc/list-man-pages.sh
+#
+
+for file in $@; do
+ for func in $(sed -n 's/ \* \([a-z_][a-z_0-9]*\)() -.*/\1/p' $file); do
+ echo ${func}
+ done
+
+ for struct in $(sed -n 's/ \* struct \([a-z_]*\) -.*/\1/p' $file); do
+ echo ${struct}
+ done
+
+ for enum in $(sed -n 's/ \* enum \([a-z_]*\) -.*/\1/p' $file); do
+ echo ${enum}
+ done
+done
diff --git a/libopeniscsiusr/docs/split-man.pl b/libopeniscsiusr/docs/split-man.pl
deleted file mode 100644
index 916082d..0000000
--- a/libopeniscsiusr/docs/split-man.pl
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/perl
-# Originally From:
-# https://www.kernel.org/doc/Documentation/kernel-doc-nano-HOWTO.txt
-#
-# Changes:
-# * Create manpage section 3 instead of 9.
-# * Replace 'Kernel Hackers Manual' to
-# 'iSCSI Userspace API - libopeniscsiusr Manual'
-# * Remove LINUX from header.
-$man_sec_num = 3;
-$title = 'iSCSI Userspace API - libopeniscsiusr Manual';
-
-if ( $#ARGV < 0 ) {
- die "where do I put the results?\n";
-}
-
-mkdir $ARGV[0], 0777;
-$state = 0;
-while (<STDIN>) {
- if (/^\.TH \"[^\"]*\" 9 \"([^\"]*)\"/) {
- if ( $state == 1 ) { close OUT }
- $state = 1;
- $fn = "$ARGV[0]/$1.$man_sec_num";
- print STDERR "Creating $fn\n";
- open OUT, ">$fn" or die "can't open $fn: $!\n";
-
- # Change man page code from 9 to $man_sec_num;
- s/^\.TH (\"[^\"]*\") 9 \"([^\"]*)\"/\.TH $1 $man_sec_num \"$2\"/;
- s/Kernel Hacker's Manual/$title/g;
- s/LINUX//g;
-
- print OUT $_;
- }
- elsif ( $state != 0 ) {
- print OUT $_;
- }
-}
-
-close OUT;
diff --git a/libopeniscsiusr/idbm.c b/libopeniscsiusr/idbm.c
index 6f57e45..cb0d5c9 100644
--- a/libopeniscsiusr/idbm.c
+++ b/libopeniscsiusr/idbm.c
@@ -61,7 +61,6 @@
#include "misc.h"
#include "idbm_fields.h"
#include "iface.h"
-#include "version.h"
#include "node.h"
#include "default.h"
diff --git a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h
index a1a2552..9ac1aa5 100644
--- a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h
+++ b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h
@@ -161,7 +161,7 @@ __DLL_EXPORT const char *iscsi_iface_port_state_get(struct iscsi_iface *iface);
__DLL_EXPORT const char *iscsi_iface_port_speed_get(struct iscsi_iface *iface);
/**
- * iscsi_iface_port_speed_get() - Retrieve name of specified iSCSI interface
+ * iscsi_iface_name_get() - Retrieve name of specified iSCSI interface
*
* Retrieve the name of specified iSCSI interface.
*
@@ -195,7 +195,7 @@ __DLL_EXPORT const char *iscsi_iface_name_get(struct iscsi_iface *iface);
__DLL_EXPORT const char *iscsi_iface_dump_config(struct iscsi_iface *iface);
/**
- * iscsi_iface_dump_config() - Print all configurations of specified iSCSI
+ * iscsi_iface_print_config() - Print all configurations of specified iSCSI
* interface to STDOUT.
*
* Print all configurations of specified iSCSI interface.
diff --git a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_node.h b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_node.h
index e093d5a..4a31aa9 100644
--- a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_node.h
+++ b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_node.h
@@ -44,7 +44,7 @@ __DLL_EXPORT const char *iscsi_node_dump_config(struct iscsi_node *node,
bool show_secret);
/**
- * iscsi_node_dump_config() - Print all configurations of specified iSCSI
+ * iscsi_node_print_config() - Print all configurations of specified iSCSI
* node to STDOUT.
*
* Print all configurations of specified iSCSI node.
diff --git a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_session.h b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_session.h
index 30f8d7a..5a0c667 100644
--- a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_session.h
+++ b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_session.h
@@ -329,7 +329,7 @@ __DLL_EXPORT const char *iscsi_session_address_get
__DLL_EXPORT int32_t iscsi_session_port_get(struct iscsi_session *se);
/**
- * iscsi_session_address_get() - Retrieve iSCSI interface information of
+ * iscsi_session_iface_get() - Retrieve iSCSI interface information of
* specified session
*
* Retrieve the iSCSI interface information of specified iSCSI session.
diff --git a/libopeniscsiusr/version.h b/libopeniscsiusr/version.h
deleted file mode 100644
index fa6d502..0000000
--- a/libopeniscsiusr/version.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2017-2018 Red Hat, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * Author: Gris Ge <fge@redhat.com>
- */
-
-#ifndef __ISCSI_OPEN_USR_VERSION_H__
-#define __ISCSI_OPEN_USR_VERSION_H__
-
-/*
- * iSCSI tools version.
- * This may not be the same value as the kernel versions because
- * some other maintainer could merge a patch without going through us
- */
-#define ISCSI_VERSION_STR "2.1.7"
-
-#endif /* End of __ISCSI_OPEN_USR_VERSION_H__ */
diff --git a/utils/sysdeps/Makefile b/sysdeps/Makefile
index d419dba..d419dba 100644
--- a/utils/sysdeps/Makefile
+++ b/sysdeps/Makefile
diff --git a/utils/sysdeps/sysdeps.c b/sysdeps/sysdeps.c
index e39730d..e39730d 100644
--- a/utils/sysdeps/sysdeps.c
+++ b/sysdeps/sysdeps.c
diff --git a/usr/Makefile b/usr/Makefile
index 79840fc..84f33bc 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -46,7 +46,8 @@ PKG_CONFIG ?= /usr/bin/pkg-config
CFLAGS ?= -O2 -g
WARNFLAGS ?= -Wall -Wextra -Werror -Wstrict-prototypes -fno-common
CFLAGS += $(WARNFLAGS) -I../include -I. -D_GNU_SOURCE \
- -I$(TOPDIR)/libopeniscsiusr
+ -I$(TOPDIR)/libopeniscsiusr \
+ -DISCSI_VERSION_STR=\"$(ISCSI_VERSION_STR)\"
CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
CFLAGS += $(shell $(PKG_CONFIG) --cflags libsystemd)
ISCSI_LIB = -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr
@@ -67,7 +68,7 @@ ISCSIADM_OBJS = iscsiadm.o session_mgmt.o mntcheck.o
ISCSISTART_OBJS = iscsistart.o
# libc compat files
-SYSDEPS_DIR = $(TOPDIR)/utils/sysdeps
+SYSDEPS_DIR = $(TOPDIR)/sysdeps
SYSDEPS_OBJS = $(SYSDEPS_DIR)/sysdeps.o
# sources shared between iscsid, iscsiadm and iscsistart
ISCSI_LIB_OBJS = iscsi_util.o io.o auth.o iscsi_timer.o login.o log.o \
diff --git a/usr/fwparam_ibft/Makefile b/usr/fwparam_ibft/Makefile
index f1479db..7977491 100644
--- a/usr/fwparam_ibft/Makefile
+++ b/usr/fwparam_ibft/Makefile
@@ -37,7 +37,8 @@ CFLAGS ?= -O2 -g
WARNFLAGS ?= -Wall -Wstrict-prototypes -Wno-format-truncation
CFLAGS += -fPIC $(WARNFLAGS) -I$(TOPDIR)/include -I$(TOPDIR)/usr -D_GNU_SOURCE \
-I$(TOPDIR)/libopeniscsiusr
-CFLAGS += -DSBINDIR=\"$(SBINDIR)\"
+CFLAGS += -DSBINDIR=\"$(SBINDIR)\" \
+ -DISCSI_VERSION_STR=\"$(ISCSI_VERSION_STR)\"
all: $(OBJS)
diff --git a/usr/version.h b/usr/version.h
index 4b74514..f8be671 100644
--- a/usr/version.h
+++ b/usr/version.h
@@ -5,8 +5,12 @@
* iSCSI tools version.
* This may not be the same value as the kernel versions because
* some other maintainer could merge a patch without going through us
+ *
+ * Version string should be set by the build system, else we have problems
*/
-#define ISCSI_VERSION_STR "2.1.7"
+#ifndef ISCSI_VERSION_STR
+#error Must set ISCSI_VERSION_STR
+#endif
#define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version"
#endif