Commit Graph
64 Commits
Author SHA1 Message Date
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
Roger Pau Monne 19459d56f4 libfsimage: add ext4 support for CentOS 5.x
CentOS 5.x forked e2fs ext4 support into a different package called
e4fs, and so headers and library names changed from ext2fs to ext4fs.
Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of
ext2fs to build libfsimage. This patch assumes that if the ext4fs
library is present it should always be used instead of ext2fs.

This patch includes a rework of the ext2fs check, a new ext4fs check
and a minor modification in libfsimage to use the correct library.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-09-14 10:02:47 +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
George Dunlap 0bf9ce4062 tools: Revert c/s 25150:b490ef93bad7 tools/libfsimage: include Rules.mk first
tools/libfsimage/Rules.mk relies on having certain variables set already; if
they're not set, the definitions dont' work right.  The result was a bunch
of empty files and pygrub failing with an uninformative error message.

It's likely that this didn't cause anyone problems becasue changing the
Makefiles didn't cause a re-build; building from a fresh repo results in
completely empty filesystem plugin binaries.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-04-13 17:13:01 +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
Olaf Hering a434834c1e tools/libfsimage: include Rules.mk first
Move the inclusion of Rules.mk up so that things like CFLAGS get initialized
properly. Currently only zfs appends CFLAGS. If CFLAGS get reset by Rules.mk
the private settings are lost and compilation of zfs support fails.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2012-03-14 17:53:56 +01:00
Ian Jackson 85896a7c4d build: add autoconf to replace custom checks in tools/check
Added autotools magic to replace custom check scripts. The previous
checks have been ported to autoconf, and some additional ones have
been added (plus the suggestions from running autoscan). Two files are
created as a result from executing configure script, config/Tools.mk
and config.h.

conf/Tools.mk is included by tools/Rules.mk, and contains most of the
options previously defined in .config, that can now be set passing
parameters or defining environment variables when executing configure
script.

config.h is only used by libxl/xl to detect yajl_version.h.

[ tools/config.sub and config.guess copied from
  autotools-dev 20100122.1 from Debian squeeze i386,
  which is GPLv2.

  tools/configure generated using the included ./autogen.sh
  which ran autoconf 2.67-2 from Debian squeeze i386.  autoconf
  is GPLv3+ but has a special exception for the autoconf output;
  this exception applies to us and exempts us from complying
  with GPLv3+ for configure, which is good as Xen is GPL2 only.

  - Ian Jackson ]

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Tested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2012-02-22 01:55:03 +00:00
Ian Campbell 321e74e4bc tools: only compile libfsimage/xfs on X86
xfs is not portable, only compile it on X86

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-02-13 17:32:21 +00: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
Roger Pau Monne 9163062a39 tools/build: Introduce {PREPEND,APPEND}_{LIB,INCLUDES}
Create two new variables called APPEND_ and PREPEND_ to add compile
flags at the beginning or at the end of the search path.

Added a new semantic for user defined compile flags, here is the list
of possible options:

PREPEND_LIB: add libraries to the search path before xen
             (before xen installation folders).
PREPEND_INCLUDES: add headers to the search path before xen
                  (before xen installation folders).
APPEND_LIB: add libraries to the search path at the end
            (after all xen installation folders have been added).
APPEND_INCLUDES: add libraries to the search path at the end
                 (after all xen installation folders have been added).

EXTRA_INCLUDES and EXTRA_LIB can still be used, and they will have the
same effect as PREPEND_INCLUDES and PREPEND_LIB.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-11-14 18:14:07 +00:00
Juergen Gross 69698ae657 tools/libfsimage: Avoid relative XEN_ROOT specification
XEN_ROOT must be set to an absolute path to avoid out of the tree
references

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
2011-10-07 09:35:12 +01:00
Christoph Egger 393375e727 tools/libfsimage: build fix (ctype macros applied to char)
Fix warning: array subscript has type 'char'

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-05-26 15:43:22 +01:00
Marco Nenciarini 5fa9d87e8f pygrub: XFS support for pygrub
Signed-off-by: Marco Nenciarini <marco.nenciarini@devise.it>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-05-24 18:11:24 +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 a5913cc17c libfsimage: zfs build fix for NetBSD
uchar_t is not defined because both FSYS_ZFS and FSIMAGE
are defined at build time.
Also fix warnings with ctype.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-04-15 12:24:16 +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 a885e77564 pygrub, reiserfs: Fix on-disk structure definition.
Without this patch pyGRUB could not read ReiserFS.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
2009-12-23 07:27:21 +00:00
Keir Fraser 79ba534b4d pygrub: add ext4 support
This is a port of the following two patches:
  http://patches.ubuntulinux.org/g/grub/extracted/ext4_support.diff
  http://patches.ubuntulinux.org/g/grub/extracted/ext4_fix_variable_sized_inodes.diff

Signed-off-by: Mark Johnson <mark.johnson@sun.com>
2009-12-16 16:42:44 +00:00
Keir Fraser 674801b080 libfsimage: Support for zfs version 16.
Remove version checks to support boot of ZFS root filesystem version
16.

Signed-off-by: Susan Kamm-Worrell <susan.kamm-worrell@sun.com>
2009-07-06 11:42:05 +01:00
Keir Fraser 4696ce5d87 libfsimage: Support for zfs version 14.
Signed-off-by: Susan Kamm-Worrell <susan.kamm-worrell@sun.com>
2009-03-12 10:58:47 +00: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 c20060b5e0 tools: Make functions static which should not be exported.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-07-15 15:03:58 +01:00
Keir Fraser 461990971f tools: replace sprintf with snprintf where applicable
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-06-12 15:41:15 +01:00
Keir Fraser e6d9351170 libfsimage: make pygrub work on ufs
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-06-09 15:06:26 +01:00
Keir Fraser 5ad74c5fb2 libfsimage: Build fix for NetBSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-06-05 10:33:01 +01:00
Keir Fraser df3a8c6434 [libfsimage/zfs] compilation fix ZFS libfsimage support.
Depending on environments, zfs libfsimage support doesn't compile.
This patch fixes it.

ia64-linux-gnu-gcc  -DPIC -O2 -fomit-frame-pointer
-fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes
-Wno-unused-value -Wdeclaration-after-statement
-I/usr/ia64-linux-gnu/
sys-root/usr/include -D__XEN_TOOLS__  -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE  -I../../../tools/libfsimage/common/ -Werror
-Wp,-MD,.zfs_lzjb.opic.d -fPIC -c -o zfs_lzjb.opic zfs_
lzjb.c
In file included from fsys_zfs.h:41,
                 from zfs_lzjb.c:25:
zfs-include/zfs_acl.h:29: error: redefinition of typedef uid_t
/usr/ia64-linux-gnu/sys-root/usr/include/sys/types.h:82: error:
previous declaration of uid_t was here

This depends on how __uid_t is defined in the system header.
No file under the zfs directory uses uid_t so that just removing
the definition in the zfs_acl.h looks reasonable.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-05-02 13:47:01 +01: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 bb475a64ea [LIBFSIMAGE] Support 256 byte inodes on ext3
Patch taken from Debian grub package version 0.97-32.
See http://bugs.debian.org/463236 & http://bugs.debian.org/463123

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2008-04-16 09:45:44 +01:00
Keir Fraser 22b0cb305b libfsimage: Build check script needs only /bin/sh.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-03-27 16:20:25 +00:00
Keir Fraser 3b01829e42 libfsimage: Revert broken parts of portability changes to the build system.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-03-27 15:13:55 +00: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 6ab58a7ed9 tools build: Fix build after subdir rules cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-03-25 10:17:22 +00:00
Keir Fraser dcaa724bbe tools/libfsimage build: Use generic subdirs rules.
Signed-off-by: Bastian Blank <waldi@debian.org>
2008-03-25 09:50:45 +00:00
Keir Fraser b124770528 Make check-libext2fs cross-friendly
check-libext2fs was calling host gcc; pass $CC from Makefile
so it can call the cross-compiler instead.

Signed-off-by: Aron Griffis <aron@hp.com>
2008-01-28 09:33:57 +00:00
Keir Fraser 26bf63427f Fix libfsimage build on Solaris
The Solaris installation dirs were missing $(PREFIX)

Signed-off-by: John Levon <john.levon@sun.com>
2008-01-24 14:35:52 +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
Keir Fraser d6f6960a00 Fix libfsimage build on NetBSD.
Fixes a number of these errors:
 cc1: warnings being treated as errors
 fsys_fat.c: In function 'fat_dir':
 fsys_fat.c:304: warning: array subscript has type 'char'

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

These ugly casts are needed according to the ISO C spec.

Acked-by: Keir Fraser <keir@xensource.com>
2007-09-23 12:18:36 +01:00
Tim Deegan 52c3a7596e [TOOLS] Avoid unaligned accesses in libfsimage FAT16 code
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2007-08-08 12:26:21 +01: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
kfraser@localhost.localdomain 94ffc9e546 libfsimage: Fix data types for 64-bit architectures.
In particular __u32 instead of ulong.

Signed-off-by: Tomohiro Takahashi <takatom@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-04-11 15:17:17 +01:00
kfraser@localhost.localdomain 01beb86388 libfs: Fix build with gcc4.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-02-21 18:54:48 +00:00