libmount: only invoke loopcxt on linux
PATCH 1/5 libmount: only invoke loopcxt on linux
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.
--- libmount/src/cache.c | 2 ++ libmount/src/tab.c | 2 ++ 2 files changed, 4 insertions(+)
libmount/src/cache.c +2 -0
@@ -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 */
libmount/src/tab.c +2 -0
@@ -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) {
Signature · 1 line
2.1.0.rc1
PATCH 2/5 libmount: only include context on linux
This is part of an attempt to make libmount buildable on non-linux.
The parts that need architecture specific porting is under the context*.c files and the rest of libmount is useful/used by for example fsck.
--- libmount/src/Makemodule.am | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
libmount/src/Makemodule.am +8 -4
@@ -8,10 +8,6 @@ libmount_la_SOURCES = \ include/list.h \ \ libmount/src/cache.c \ - libmount/src/context.c \ - libmount/src/context_loopdev.c \ - libmount/src/context_mount.c \ - libmount/src/context_umount.c \ libmount/src/fs.c \ libmount/src/init.c \ libmount/src/iter.c \
@@ -28,6 +24,14 @@ libmount_la_SOURCES = \ libmount/src/version.c \ $(nodist_mountinc_HEADERS) +if LINUX +libmount_la_SOURCES += \ + libmount/src/context.c \ + libmount/src/context_loopdev.c \ + libmount/src/context_mount.c \ + libmount/src/context_umount.c +endif + nodist_libmount_la_SOURCES = libmount/src/mountP.h libmount_la_LIBADD = libcommon.la libblkid.la $(SELINUX_LIBS)
Signature · 1 line
2.1.0.rc1
PATCH 3/5 build-sys: build libmount everywhere
In reply to Andreas HenrikssonThis enables libmount to build on non-linux, which also means we can build fsck on non-linux again. (Since the context part of libmount still needs porting, building the mount utility has instead been restricted to only build on Linux.)
This has been build-tested on Debian GNU/kFreeBSD.
--- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +1 -1
@@ -799,7 +799,6 @@ AC_ARG_ENABLE([libmount], [], [UL_DEFAULT_ENABLE([libmount], [check])] ) UL_BUILD_INIT([libmount]) -UL_REQUIRES_LINUX([libmount]) UL_REQUIRES_BUILD([libmount], [libblkid]) UL_REQUIRES_HAVE([libmount], [scanf_alloc_modifier], [scanf string alloc modifier]) AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes])
@@ -856,6 +855,7 @@ AC_ARG_ENABLE([mount], [], [UL_DEFAULT_ENABLE([mount], [check])] ) UL_BUILD_INIT([mount]) +UL_REQUIRES_LINUX([mount]) UL_REQUIRES_BUILD([mount], [libmount]) AM_CONDITIONAL([BUILD_MOUNT], [test "x$build_mount" = xyes])
Signature · 1 line
2.1.0.rc1
PATCH 4/5 build-sys: swaplabel needs libmount
In reply to Andreas HenrikssonThe swaplabel utility uses libmount functionality and thus libmount has to be available if we want to build swaplabel. This change makes swaplabel be automatically disabled when we don't.
--- configure.ac | 1 + 1 file changed, 1 insertion(+)
configure.ac +1 -0
@@ -1143,6 +1143,7 @@ AM_CONDITIONAL([BUILD_WDCTL], [test "x$build_wdctl" = xyes]) UL_BUILD_INIT([swaplabel], [check]) UL_REQUIRES_BUILD([swaplabel], [libblkid]) +UL_REQUIRES_BUILD([swaplabel], [libmount]) AM_CONDITIONAL([BUILD_SWAPLABEL], [test "x$build_swaplabel" = xyes])
Signature · 1 line
2.1.0.rc1
PATCH 5/5 logger: gettimeofday needs <sys/time.h>
In reply to Andreas HenrikssonEither works on linux, but kfreebsd build fails
if we don't use the <sys/time.h> include.
According to man gettimeofday the correct include is <sys/time.h>
--- misc-utils/logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
misc-utils/logger.c +1 -1
@@ -40,7 +40,7 @@#include <limits.h> #include <unistd.h> #include <stdlib.h> -#include <time.h> +#include <sys/time.h> #include <stdio.h> #include <ctype.h> #include <string.h>
Signature · 1 line
2.1.0.rc1
Karel Zak
maintainerQuoted 3 lines · Andreas Henriksson
libmount/src/cache.c | 2 ++ libmount/src/tab.c | 2 ++ 2 files changed, 4 insertions(+)
Quoted 2 lines · Andreas Henriksson
libmount/src/Makemodule.am | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
Quoted 2 lines · Andreas Henriksson
configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 2 lines · Andreas Henriksson
misc-utils/logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
All applied, thanks.
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com