diff options
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | mount/.gitignore | 1 | ||||
-rw-r--r-- | mount/Makefile.am | 10 | ||||
-rw-r--r-- | sys-utils/.gitignore | 1 | ||||
-rw-r--r-- | sys-utils/Makefile.am | 26 | ||||
-rw-r--r-- | sys-utils/swapoff.8 (renamed from mount/swapoff.8) | 0 | ||||
-rw-r--r-- | sys-utils/swapon.8 (renamed from mount/swapon.8) | 0 | ||||
-rw-r--r-- | sys-utils/swapon.c (renamed from mount/swapon.c) | 0 |
8 files changed, 32 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac index aa4af0880..e30c8df33 100644 --- a/configure.ac +++ b/configure.ac @@ -846,6 +846,12 @@ fi AM_CONDITIONAL(BUILD_HWCLOCK, test "x$build_hwclock" = xyes) +UL_BUILD_INIT([swapon], [check]) +UL_REQUIRES_LINUX([swapon]) +UL_REQUIRES_BUILD([swapon], [libblkid]) +AM_CONDITIONAL(BUILD_SWAPON, test "x$build_swapon" = xyes) + + UL_BUILD_INIT([lsblk], [check]) UL_REQUIRES_LINUX([lsblk]) UL_REQUIRES_BUILD([lsblk], [libblkid]) diff --git a/mount/.gitignore b/mount/.gitignore index 629b07fcd..8be9aceb7 100644 --- a/mount/.gitignore +++ b/mount/.gitignore @@ -1,4 +1,3 @@ mount mtab_lock_test -swapon umount diff --git a/mount/Makefile.am b/mount/Makefile.am index 073f05545..d8bd77d17 100644 --- a/mount/Makefile.am +++ b/mount/Makefile.am @@ -1,8 +1,7 @@ include $(top_srcdir)/config/include-Makefile.am bin_PROGRAMS = mount umount -sbin_PROGRAMS = swapon -dist_man_MANS = fstab.5 mount.8 swapoff.8 swapon.8 umount.8 +dist_man_MANS = fstab.5 mount.8 umount.8 # generic sources for all programs (mount, umount) srcs_common = sundries.c $(top_srcdir)/lib/canonicalize.c sundries.h @@ -44,12 +43,6 @@ umount_CFLAGS = $(SUID_CFLAGS) $(cflags_common) umount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) umount_LDADD = $(ldadd_common) -swapon_SOURCES = swapon.c swap_constants.h $(top_srcdir)/lib/linux_version.c \ - $(top_srcdir)/lib/blkdev.c $(top_srcdir)/lib/fsprobe.c \ - $(top_srcdir)/lib/canonicalize.c $(top_srcdir)/lib/mangle.c -swapon_CFLAGS = $(cflags_common) -swapon_LDADD = $(ldadd_common) - mount_static_LDADD = if HAVE_STATIC_MOUNT @@ -95,7 +88,6 @@ mtab_lock_test_CPPFLAGS = -DMAIN_TEST_MTABLOCK $(AM_CPPFLAGS) endif install-exec-hook: - cd $(DESTDIR)$(sbindir) && ln -sf swapon swapoff if MAKEINSTALL_DO_SETUID chmod 4755 $(DESTDIR)$(bindir)/mount chmod 4755 $(DESTDIR)$(bindir)/umount diff --git a/sys-utils/.gitignore b/sys-utils/.gitignore index 3426674b0..909e7c4e4 100644 --- a/sys-utils/.gitignore +++ b/sys-utils/.gitignore @@ -39,6 +39,7 @@ sparc32.8 sparc32bash.8 sparc64.8 sparc.8 +swapon switch_root tunelp unshare diff --git a/sys-utils/Makefile.am b/sys-utils/Makefile.am index a7e1471f7..0664b2d2c 100644 --- a/sys-utils/Makefile.am +++ b/sys-utils/Makefile.am @@ -9,6 +9,10 @@ dist_man_MANS = flock.1 ipcrm.1 ipcs.1 ipcmk.1 renice.1 setsid.1 \ readprofile.8 if LINUX +# +# Linux-only utils with no another dependencies. All another dependencies have +# to be resolved in configure.ac end exported to makefiles by BUILD_*. +# bin_PROGRAMS += dmesg sbin_PROGRAMS += ctrlaltdel fsfreeze fstrim usrbin_exec_PROGRAMS += cytune setarch @@ -16,7 +20,8 @@ usrsbin_exec_PROGRAMS += ldattach tunelp rtcwake dist_man_MANS += dmesg.1 ctrlaltdel.8 cytune.8 setarch.8 \ ldattach.8 tunelp.8 rtcwake.8 fsfreeze.8 fstrim.8 -endif +endif # LINUX + if BUILD_LOSETUP sbin_PROGRAMS += losetup @@ -35,7 +40,6 @@ bin_PROGRAMS += losetup.static losetup_static_SOURCES = $(losetup_SOURCES) losetup_static_LDFLAGS = -all-static endif - endif # BUILD_LOSETUP @@ -47,6 +51,21 @@ prlimit_SOURCES = prlimit.c $(top_srcdir)/lib/strutils.c \ $(top_srcdir)/lib/tt.c endif +if BUILD_SWAPON +sbin_PROGRAMS += swapon +dist_man_MANS += swapoff.8 swapon.8 + +swapon_SOURCES = swapon.c \ + $(top_srcdir)/lib/linux_version.c \ + $(top_srcdir)/lib/blkdev.c \ + $(top_srcdir)/lib/fsprobe.c \ + $(top_srcdir)/lib/canonicalize.c \ + $(top_srcdir)/lib/mangle.c + +swapon_CFLAGS = $(AM_CFLAGS) -I$(ul_libblkid_incdir) +swapon_LDADD = $(ul_libblkid_la) +endif + if BUILD_LSCPU usrbin_exec_PROGRAMS += lscpu lscpu_SOURCES = lscpu.c $(top_srcdir)/lib/cpuset.c \ @@ -142,6 +161,9 @@ $(SETARCH_MAN_LINKS): $(AM_V_GEN)echo ".so man8/setarch.8" > $@ install-exec-hook: +if BUILD_SWAPON + cd $(DESTDIR)$(sbindir) && ln -sf swapon swapoff +endif for I in $(SETARCH_LINKS); do \ cd $(DESTDIR)$(usrbin_execdir) && ln -sf setarch $$I ; \ done diff --git a/mount/swapoff.8 b/sys-utils/swapoff.8 index 1a06b7e8d..1a06b7e8d 100644 --- a/mount/swapoff.8 +++ b/sys-utils/swapoff.8 diff --git a/mount/swapon.8 b/sys-utils/swapon.8 index ee6a2fcf6..ee6a2fcf6 100644 --- a/mount/swapon.8 +++ b/sys-utils/swapon.8 diff --git a/mount/swapon.c b/sys-utils/swapon.c index e37d8a251..e37d8a251 100644 --- a/mount/swapon.c +++ b/sys-utils/swapon.c |