util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] libmount: only invoke loopcxt on linux
@ 2014-09-18 23:36 Andreas Henriksson
  2014-09-18 23:36 ` [PATCH 2/5] libmount: only include context " Andreas Henriksson
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Andreas Henriksson @ 2014-09-18 23:36 UTC (permalink / raw)
  To: util-linux; +Cc: Andreas Henriksson

This is part of an attempt to make libmount buildable on non-linux.

The support for /dev/loop* is Linux-specific so just disable
it on non-linux for now.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
 libmount/src/cache.c | 2 ++
 libmount/src/tab.c   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/libmount/src/cache.c b/libmount/src/cache.c
index 8b2e656..fcd84fd 100644
--- a/libmount/src/cache.c
+++ b/libmount/src/cache.c
@@ -633,6 +633,7 @@ char *mnt_pretty_path(const char *path, struct libmnt_cache *cache)
 	if (!pretty)
 		return strdup("none");
 
+#ifdef __linux__
 	/* users assume backing file name rather than /dev/loopN in
 	 * output if the device has been initialized by mount(8).
 	 */
@@ -653,6 +654,7 @@ char *mnt_pretty_path(const char *path, struct libmnt_cache *cache)
 		loopcxt_deinit(&lc);
 
 	}
+#endif
 
 done:
 	/* don't return pointer to the cache, allocate a new string */
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index 4094fb8..011ba54 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -1439,8 +1439,10 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs)
 			} else
 				flags = LOOPDEV_FL_OFFSET;
 
+#if __linux__
 			if (loopdev_is_used(mnt_fs_get_srcpath(fs), src, offset, flags))
 				break;
+#endif
 		}
 
 		if (root) {
-- 
2.1.0.rc1


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] build-sys: link swapoff to libblkid
@ 2014-09-19  0:27 Andreas Henriksson
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Henriksson @ 2014-09-19  0:27 UTC (permalink / raw)
  To: util-linux; +Cc: Andreas Henriksson

The swapoff utility seems to need linking with libblkid otherwise
this build error occurs:

$ git describe
v2.25-180-g29607ed
$ ./autogen.sh && ./configure --without-python  && make
[....]
  CCLD     swapoff
/usr/bin/ld: sys-utils/swapoff-swapon-common.o: undefined reference to symbol 'blkid_probe_lookup_value@@BLKID_2.15'
//home/ah/opt/pkg-util-linux/util-linux/.libs/libblkid.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:5992: recipe for target 'swapoff' failed
make[2]: *** [swapoff] Error 1
make[2]: Leaving directory '/home/ah/opt/pkg-util-linux/util-linux'
Makefile:10220: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/ah/opt/pkg-util-linux/util-linux'
Makefile:4433: recipe for target 'all' failed
make: *** [all] Error 2

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
 sys-utils/Makemodule.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys-utils/Makemodule.am b/sys-utils/Makemodule.am
index 058bb62..62e26f4 100644
--- a/sys-utils/Makemodule.am
+++ b/sys-utils/Makemodule.am
@@ -275,7 +275,7 @@ swapon_LDADD = $(LDADD) \
 
 swapoff_SOURCES = sys-utils/swapoff.c sys-utils/swapon-common.c
 swapoff_CFLAGS = $(AM_CFLAGS) -I$(ul_libmount_incdir) -I$(ul_libblkid_incdir)
-swapoff_LDADD = $(LDADD) libmount.la
+swapoff_LDADD = $(LDADD) libmount.la libblkid.la
 endif
 
 if BUILD_LSCPU
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-09-22 11:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-18 23:36 [PATCH 1/5] libmount: only invoke loopcxt on linux Andreas Henriksson
2014-09-18 23:36 ` [PATCH 2/5] libmount: only include context " Andreas Henriksson
2014-09-18 23:36 ` [PATCH 3/5] build-sys: build libmount everywhere Andreas Henriksson
2014-09-18 23:36 ` [PATCH 4/5] build-sys: swaplabel needs libmount Andreas Henriksson
2014-09-22 11:27   ` Karel Zak
2014-09-18 23:36 ` [PATCH 5/5] logger: gettimeofday needs <sys/time.h> Andreas Henriksson
2014-09-22 11:21 ` [PATCH 1/5] libmount: only invoke loopcxt on linux Karel Zak
  -- strict thread matches above, loose matches on Subject: below --
2014-09-19  0:27 [PATCH] build-sys: link swapoff to libblkid Andreas Henriksson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).