Commit Graph
45 Commits
Author SHA1 Message Date
Anthony PERARD 4aa436df4b tools/libfsimage: Cleanup makefiles
Remove the need for "fs-*" targets by creating a "common.mk" which
have flags that are common to libfsimage/common/ and the other
libfsimages/*/ directories.

In common.mk, make $(PIC_OBJS) a recursively expanded variable so it
doesn't matter where $(LIB_SRCS-y) is defined, and remove the extra
$(PIC_OBJS) from libfsimage/common/Makefile.

Use a $(TARGETS) variable to list things to be built. And $(TARGETS)
can be use in the clean target in common.mk.

iso9660/:
    Remove the explicit dependency between fsys_iso9660.c and
    iso9660.h, this is handled automaticaly by the .*.d dependency files,
    and iso9660.h already exist.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
2022-08-15 08:55:21 +02:00
Andrew Cooper d828caa9ae tools/libfsimage: Fix SONAME
This gets missed on each release.  Follow the same example as libs.mk and pick
the version up dynamically.

Fixes: a5706b80f4 ("Set version to 4.17: rerun autogen.sh")
Suggested-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
2021-12-13 18:37:36 +00:00
Andrew Cooper b9005bb34f tools/libfsimage: Bump SONAME to 4.16
Fixes: a04509d34d ("Branching: Update version files etc. for newly unstable")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <iwj@xenproject.org>
2021-03-26 15:19:05 +00:00
Wei Liu 79c2d51cba tools: bump library version numbers
Signed-off-by: Wei Liu <wl@xen.org>
2020-08-14 20:21:25 +00:00
Wei Liu d93630b18c tools: bump library version numbers
Signed-off-by: Wei Liu <wl@xen.org>
2019-12-20 14:21:25 +00:00
Wei Liu 7619745071 tools: bump library version numbers
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2019-03-14 12:31:54 +00:00
Ian Jackson 2215a8b6da tools/libfsimage: Add `XEN' to environment variable name
This library, which is private to Xen and was properly namespaced in
  1a81471188
  tools/libfsimage: Add `xen' to .h names and principal .so name
honours an environment variable to override the directory where
shared objects (ie filesystem plugins) are to be loaded from.

Rename that variable from FSIMAGE_FSDIR to XEN_FSIMAGE_FSDIR, to give
it a proper namespace prefix.

Nothing in xen.git sets this variable.  The three hits for the string
`FSIMAGE_FSDIR' are this getenv, and two references to a compile-time
manifest constant which provides the default value (the -D which sets
it, and the place it is used).

I have also checked the current Debian Xen package in buster and the
variable is not set there either.

CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: George Dunlap <george.dunlap@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
2019-03-05 16:25:08 +00:00
Ian Jackson 168f9d4960 tools/libfsimage: Set soname to 4.12 not 0.4.12
This was set to 0.4.12 by accident in
  c69a6aca85
    tools/libfsimage: Bump soname to 4.12

The extra 0. is harmless but ugly.  We should be somewhat consistent.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2018-10-23 14:57:24 +01:00
Ian Jackson 1a81471188 tools/libfsimage: Add `xen' to .h names and principal .so name
`fsimage' is rather general.  And we do not expect this library to be
very useful out of tree because of its unstable ABI.

So add the word `xen'.  This will avoid naming conflicts with anyone
else's fsimage library.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2018-10-15 14:49:33 +01:00
Ian Jackson c69a6aca85 tools/libfsimage: Bump soname to 4.12
This library does not have a stable ABI promise.  As far as we know it
is used only by pygrub.  Bump its soname to the Xen version (and
intend to change it each time).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2018-10-15 14:49:33 +01:00
Ian Jackson a696f4e63c libfsimage: Honour general LDFLAGS
Do not reset LDFLAGS to empty.  Instead, append the fsimage-special
LDFLAGS.

Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2018-10-08 15:20:19 +01:00
Ian Jackson fff4aa914d DEPS handling: Use DEPS_INCLUDE everywhere
DEPS_INCLUDE is currently the same as DEPS, so no functional change.

This patch is the result of this perl rune:

  git-grep -l 'include.*DEPS' | xargs perl -i -pe 'next unless m/^-?include/; s/\bDEPS\b/DEPS_INCLUDE/'

I have verified that I haven't missed anything, with this rune:

  git-grep '\bDEPS\b'

Reported-by: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2017-09-07 16:21:54 +01:00
Petre Pircalabu f2b40dabab Makefile: Fix uninstall target
Running "make uninstall" does not remove all installed files, a
situation which might cause link related issues if xen is re-installed
in a different location.
In order to make uninstall correctly remove the files it is best
the process should be done recursively by mirroring each "install"
target with an "uninstall" who removes the installed files.

An exception to this rule is uninstalling the files produced by
"qemu-xen-dir-remote" and "qemu-xen-traditional-dir", which are external
to the project. These projects do not implement an "uninstall" target so
the files have to be removed manually.

Signed-off-by: Petre Pircalabu <ppircalabu@bitdefender.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2017-07-28 17:47:42 +01:00
Chris Patterson c2a17869d5 libfsimage: replace deprecated readdir_r() with readdir()
Replace the usage of readdir_r() with readdir() to address a
compilation error under glibc due to the deprecation of readdir_r
for their next release (2.24) [1, 2].

Add new error checking on readdir(), and fail if error occurs.

--

From the GNU libc manual [3]:
"
 It is expected that future versions of POSIX will obsolete readdir_r and
 mandate the level of thread safety for readdir which is provided by the
 GNU C Library and other implementations today.
"

There is a filed bug in the Austin Group Defect Tracker [4]  in which 'dalias'
proposes (in comment 0001632) that:
"
   I would like to propose an alternate solution. For readdir, replace the text:
    "The readdir() function need not be thread-safe."
   with:
    "If multiple threads call the readdir() function with the same directory
    stream argument and without synchronization to preclude simultaneous
    access, then the behavior is undefined."

   With this change, the clunky readdir_r function is no longer needed or
   useful, and should probably be deprecated. As the only reasonable way
   to meet the implementation requirements for readdir is to have the dirent
   buffer in the DIR structure, this change should not require any change to
   existing implementations.
"

[1] https://sourceware.org/ml/libc-alpha/2016-02/msg00093.html
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=19056
[3] https://www.gnu.org/software/libc/manual/html_node/Reading_002fClosing-Directory.html
[4] http://austingroupbugs.net/view.php?id=696

Signed-off-by: Chris Patterson <pattersonc@ainfosec.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-06-03 18:11:55 +01:00
Olaf Hering 93790b1c38 tools: replace private LIBDIR with automake libdir
Reuse automake variable instead of inventing a private variable.

The result of this command:
 git grep -wnl LIBDIR | xargs sed -i 's@LIBDIR@libdir@g'

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-05-21 15:12:11 +01:00
Olaf Hering e3dcb16398 tools: replace private INCLUDEDIR with automake includedir
Reuse automake variable instead of inventing a private variable.

The result of this command:
 git grep -wnl INCLUDEDIR | xargs sed -i 's@INCLUDEDIR@includedir@g'

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-05-21 15:12:10 +01:00
Olaf Hering c78dbe4a69 tools/libfsimage: append APPEND_LDFLAGS to link command
Required to pass -Wl,-rpath,$libdir to link command.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2014-04-23 12:21:34 +01:00
Andrew Cooper c8ed9db1fa tools: Cull more ia64 and ppc code
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
2013-08-20 15:18:29 +01:00
Daniel Kiper 667d8a84b2 tools/libfsimage: Fix clean and distclean make targets
If there is a single colon for a given target and the target
is redefined in another place (e.g. in included file) then
make executes only new target and displays following warning:

Makefile:35: warning: overriding commands for target `clean'
tools/libfsimage/common/../../../tools/libfsimage/Rules.mk:25:
warning: ignoring old commands for target `clean'

To cope with that issue define all required targets as double-colon
rules. Additionally, remove some redundant stuff.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-13 10:57:17 +01:00
Matt Wilson f9cc745642 tools: honour --libdir when it is passed to ./configure
Currently shared libraries are automatically installed into /usr/lib
or /usr/lib64, depending on the supplied --prefix value and
$(XEN_TARGET_ARCH). Some systems, like recent Debian and Ubuntu releases,
do not use /usr/lib64, but instead /usr/lib/x86_64-linux-gnu.

With this change, packagers can supply the desired location for shared
libraries on the ./configure command line. Packagers need to note that
the default behaviour on 64-bit Linux systems will be to install shared
libraries in /usr/lib, not /usr/lib64, unless a --libdir value is provided
to ./configure.

Additionally, the libfsimage plugins are now loaded explicitly from
$LIBDIR/fs, removing platform-based decision trees in code.

Signed-off-by: Matt Wilson <msw@amazon.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- resolve rejects in configure by rerunning autogen.sh. Dropped changes
to remove m4/default_lib.m4 and update m4/pkg.m4 since they cause LIBDIR=/lib
instead of /usr/lib. Reran ./autogen.sh after that too ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-07-05 11:00:28 +01:00
Ian Jackson 9c09f9dec6 tools: Use PTHREAD_CFLAGS, _LDFLAGS, _LIBS
Replace all literal occurrences of -lpthread and -pthread in Makefiles
by references to PTHREAD_CFLAGS, PTHREAD_LDFLAGS and PTHREAD_LIBS.
These are the new variables set by configure, and currently expand to
-pthread on the compilation and link lines as is required.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2012-04-11 14:14:13 +01:00
Jan Beulich dd02b58523 remove the use of -Wno-unused-value
It has been hiding actual mistakes, and there are not too many changes
necessary to make things build without suppressing this warning.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-12-13 11:36:35 +01:00
Ian Campbell 61d0fe74c6 tools: Remove $(CFLAGS) from links lines.
The relevant variable in these circumstances is called $(LDFLAGS).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-03-31 19:32:18 +01:00
Keir Fraser 547cb1849c build: Make XEN_ROOT an absolute path.
Otherwise make can search the path relative to certain standard paths
such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in
Config.mk suffers from this).

Signed-off-by: Keir Fraser <keir@xen.org>
2011-03-17 10:36:25 +00:00
Stefano Stabellini ba26a1e197 split LDLIBS from LDFLAGS to fix link errors in recent toolchains
Linker command lines are order-sensitive.
Move linker options -Lfoo -lfoo from LDFLAGS to LDLIBS and place this new
variable after the objects to link. This resolves build errors in xenpagin
and blktap with recent toolchains.

rename SHLIB_CFLAGS to SHLIB_LDFLAGS
rename LDFLAGS_* to LDLIBS_*
move LDFLAGS usage after CFLAGS in CC calls
remove stale comments in xenpaging Makefile

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-08-11 18:02:32 +01:00
Keir Fraser f426678bf2 Port latest grub zfs boot code to pygrub
Signed-off-by: Mark Johnson <mark.r.johnson@oracle.com>

Add -Werror to CFLAGS and fix numerous warnings/errors.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-04-14 11:56:54 +01:00
Keir Fraser 9f8501582f Use -MMD -MF in tools/* rather than -Wp,-M...
If you use -MMD -MF then the correct .o filename is written to the
.*.d file as the compiler driver arranges everything.  This was done
in 19010:275abe1c5d24 for the hypervisor.

In this patch we do the same elsewhere in the xen-unstable tree,
particularly tools/.  Specifically:
 * Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS.
 * Remove -Wp,-MD... from every other Makefile
 * Remove setting of DEPS from every other Makefile
 * Ensure that every Makefile says -include $(DEPS)
 * Ensure that every Makefile's clean target removes $(DEPS)

Some Makefiles were already halfway there, but often for a different
variable name eg PROG_DEP.  The variable name is now standardised in
Rules.mk as DEPS.

I have done a test build with this change, on Debian etch.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-01-12 10:16:05 +00:00
Keir Fraser 622e368758 Add ZFS libfsimage support patch
Add support to pygrub and libfsimage to boot ZFS root filesystems.
Boot argument of zfs-bootfs is set to describe ZFS root pool and
boot filesystem object number.  Boot argument bootpath is set to
describe the virtual device root mirror components.

Signed-off-by: Susan Kamm-Worrell <susan.kamm-worrell@sun.com>
2008-05-01 16:38:56 +01:00
Keir Fraser bf69b5d785 libfsimage: portability fixes for NetBSD
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-03-26 14:40:54 +00:00
Keir Fraser 2faf0fc95c Add INCLUDEDIR. Use it.
Signed-off-by: Bastian Blank <waldi@debian.org>
2008-01-22 14:30:21 +00:00
Keir Fraser c8107e1564 Apply PREFIX directly to LIBDIR.
Signed-off-by: Bastian Blank <waldi@debian.org>
2008-01-22 14:29:11 +00:00
Keir Fraser 891143e321 tools: Some fixes for 'make clean'.
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
2007-12-14 10:16:52 +00:00
Keir Fraser af3ade42b9 Revert 16560:822d4ec5cfb1.
Preference seems to be to update library versions only when the ABI
changes. Only libxenctrl/libxenguest have their version number changed
to 3.2.0, as a reminder that they change on pretty much every major
release.

libfsimage/libxenstore/libblktap have not changed substantially
recently, hence the ABI has not changed, and version number stays the
same as in Xen 3.1 (and before).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-12-08 17:32:01 +00:00
Keir Fraser 7f9e1cf31e tools: Rationalise library soname versions.
* Arrange for the sonames of libxenstore, libxc, libfsimage and
   libblktap to be set from a single place in Config.mk.
 * Bumps the soname major version number to 3.2 in preparation for
   3.2 rc1 after which we do not expect to have ABI changes.

I have not done anything about libaio and libflask.  The former is
imported from elsewhere and if we're lucky will have sane versioning
upstream.

libflask has a very small interface and I'm hoping that the XSM
authors have been keeping some ABI discipline.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2007-12-07 14:44:13 +00:00
Alex Williamson 3eeea67466 [IA64] Avoid use of kernel type in user code.
Signed-off-by: Tristan Gingold <tgingold@free.fr>
2007-06-11 11:05:27 -06:00
kfraser@localhost.localdomain a20b52e572 ia64 doesn't use /usr/lib64 on any distribution. When it's present, it's a symlink to /usr/lib
Signed-off-by: Aron Griffis <aron@hp.com>
2007-05-03 09:32:35 +01:00
john.levon@sun.com 78b20c6953 Add iso9660 support to libfsimage.
Signed-off-by: John Levon <john.levon@sun.com>
2007-02-20 14:54:04 -08:00
john.levon@sun.com ec08a094b2 Filesystem implementations may need optional arguments in terms of
what to mount. Add an options string to the libfsimage API.

Signed-off-by: John Levon <john.levon@sun.com>
2007-02-19 20:44:42 -08:00
Tim Deegan 71c1836f5c Revert 13389; libfsimage version does not need to change after all.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2007-01-18 09:24:40 +00:00
Tim Deegan d74f5aa063 [LIBFSIMAGE] Fix makefile to track version number change
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2007-01-17 10:33:13 +00:00
john.levon@sun.com 96002a7e9b Remove useless fsip_fs_free(). Delegate freeing of private data to its plugin
users. Miscellaneous tidy.

Signed-off-by: John Levon <john.levon@sun.com>
2007-01-16 10:54:20 -08:00
kfraser@localhost.localdomain 9f941deb84 [TOOLS] Provide common LFS CFLAGS/LDFLAGS additions in Rules.mk.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-17 09:54:48 +00:00
kaf24@localhost.localdomain 106e6b9de4 Fix integer overflow problem with libfsimage grub plugins.
Signed-off-by: John Levon <john.levon@sun.com>
2006-11-11 01:17:57 +00:00
Tim Deegan 9c84d2db33 [LIBFSIMAGE] Don't leak FDs or RAM when closing filesystems
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2006-11-10 12:27:56 +00:00
Tim Deegan cddc1d5a09 Add libfsimage, a C library for reading files from filesystem images.
Initial support is provided for Solaris UFS, ext2 (both using libext2fs
and not), and reiserfs.

Signed-off-by: John Levon <john.levon@sun.com>
2006-11-09 14:09:53 +00:00