Patchwork Proposed util-linux split

login
register
mail settings
Submitter Thomas Petazzoni
Date Feb. 26, 2013, 7:03 p.m.
Message ID <20130226200302.31af2041@skate>
Download mbox | patch
Permalink /patch/223370/
State Superseded
Headers show

Comments

Thomas Petazzoni - Feb. 26, 2013, 7:03 p.m.
Dear Gustavo Zacarias,

On Tue, 26 Feb 2013 15:41:15 -0300, Gustavo Zacarias wrote:

> > Of course, only the util-linux programs that actually need PAM support
> > should make this library become a dependency of util-linux.
> 
> That wouldn't be hard, howerver we'll loose the busybox login
> alternative for cases without PAM.

People wanting lightweight stuff will use Busybox, so I think it's
fine. And as said on IRC, if someone wants to use login utils from
util-linux without PAM, then that someone should go upstream and fix
this.

> > Would it be possible instead that util-linux always uses the libuuid
> > from the libuuid package?
> 
> Not without heavy patching which doesn't look so simple for 2.22+ that
> did a big rewrite in the autotools fu.

Ok, then I think I would really prefer to keep a single package.

> That's what my previous util-linux patch did, however if we upgrade to
> newer (2.22+) util-linux the old trick (make -C libxxx) doesn't work any
> longer and needs patching anyway (it uses "automodules", hence no
> regular Makefile for the subdirs, those are included from the top Makefile).
> The patch isn't too straightforward since i remove the automodules
> includes, hence not very nice for dynamic patching via sed.
> The alternative would be to remove stuff we always build since
> util-linux always installs a basic set of utilities that can't be
> disabled (and remember, no install-libuuid or anything similar as
> targets, they're all pushed into a big variable with no useful naming by
> the automodules mechanism).

After:

./configure --disable-libblkid --disable-libmount
--disable-deprecated-mount --disable-mount --disable-losetup
--disable-fsck --disable-partx --disable-uuidd --disable-mountpoint
--disable-fallocate --disable-unshare --disable-arch --disable-ddate
--disable-eject --disable-agetty --disable-cramfs --disable-switch_root
--disable-pivot_root --disable-kill --disable-last --disable-utmpdump
--disable-line --disable-mesg --disable-raw --disable-rename
--disable-reset --disable-vipw --disable-newgrp --disable-chfn-chsh
--disable-sulogin --disable-su --disable-schedutils --disable-wall

The build takes:

real    0m11.406s
user    0m35.654s
sys     0m4.528s

on my laptop. It certainly builds and installs a bunch more crap than
just libuuid, but it's not too bad.

Another solution is to apply the attached patch, and use the
--disable-allprogs option. Then, it builds and installs only libuuid.
It then takes:

real	0m3.209s
user	0m8.333s
sys	0m1.196s

Best regards,

Thomas
Gustavo Zacarias - Feb. 26, 2013, 7:07 p.m.
On 02/26/2013 04:03 PM, Thomas Petazzoni wrote:

> Another solution is to apply the attached patch, and use the
> --disable-allprogs option. Then, it builds and installs only libuuid.
> It then takes:
> 
> real	0m3.209s
> user	0m8.333s
> sys	0m1.196s
> 
> Best regards,

I just kill the includes from Makefile.am, it could be a conditional
patch and likely to change less in future versions of util-linux.
Building all at once kills the libuuid without wchar posibility, how
useful that is is up in the air, i didn't try removing WCHAR depends
from apps caused by this and seeing which ones make it.
Regards.

Patch

Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -756,6 +756,12 @@ 
 UL_REQUIRES_BUILD([deprecated_mount], [libblkid])
 AM_CONDITIONAL(BUILD_DEPRECATED_MOUNT, test "x$build_deprecated_mount" = xyes)
 
+AC_ARG_ENABLE([allprogs],
+  AS_HELP_STRING([--disable-allprogs], [don't build any programs]),
+  [], enable_all_progs=yes
+)
+UL_BUILD_INIT([allprogs])
+AM_CONDITIONAL(BUILD_ALLPROGS, test "x$build_allprogs" = xyes)
 
 AC_ARG_ENABLE([mount],
   AS_HELP_STRING([--disable-mount], [do not build mount(8) and umount(8)]),
Index: b/sys-utils/Makemodule.am
===================================================================
--- a/sys-utils/Makemodule.am
+++ b/sys-utils/Makemodule.am
@@ -1,4 +1,4 @@ 
-
+if BUILD_ALLPROGS
 usrbin_exec_PROGRAMS += flock
 dist_man_MANS += sys-utils/flock.1
 flock_SOURCES = sys-utils/flock.c
@@ -300,3 +300,4 @@ 
 hwclock_LDADD += -laudit
 endif
 endif # BUILD_HWCLOCK
+endif # BUILD_ALLPROGS
\ No newline at end of file
Index: b/fdisks/Makemodule.am
===================================================================
--- a/fdisks/Makemodule.am
+++ b/fdisks/Makemodule.am
@@ -1,4 +1,4 @@ 
-
+if BUILD_ALLPROGS
 fdisk_common_sources = \
 	fdisks/common.h \
 	fdisks/gpt.c \
@@ -85,3 +85,4 @@ 
 
 endif # !ARCH_SPARC
 endif # !ARCH_M68K
+endif # BUILD_ALLPROGS
Index: b/misc-utils/Makemodule.am
===================================================================
--- a/misc-utils/Makemodule.am
+++ b/misc-utils/Makemodule.am
@@ -1,4 +1,4 @@ 
-
+if BUILD_ALLPROGS
 usrbin_exec_PROGRAMS += cal
 dist_man_MANS += misc-utils/cal.1
 cal_SOURCES = \
@@ -173,3 +173,4 @@ 
 dist_getoptexample_SCRIPTS = \
 	misc-utils/getopt-parse.bash \
 	misc-utils/getopt-parse.tcsh
+endif # BUILD_ALLPROGS
\ No newline at end of file
Index: b/term-utils/Makemodule.am
===================================================================
--- a/term-utils/Makemodule.am
+++ b/term-utils/Makemodule.am
@@ -1,4 +1,4 @@ 
-
+if BUILD_ALLPROGS
 usrbin_exec_PROGRAMS += script
 dist_man_MANS += term-utils/script.1
 script_SOURCES = term-utils/script.c
@@ -92,3 +92,4 @@ 
 endif
 endif
 endif # BUILD_WRITE
+endif # BUILD_ALLPROGS
Index: b/text-utils/Makemodule.am
===================================================================
--- a/text-utils/Makemodule.am
+++ b/text-utils/Makemodule.am
@@ -1,4 +1,4 @@ 
-
+if BUILD_ALLPROGS
 usrbin_exec_PROGRAMS += \
 	col \
 	colcrt \
@@ -79,3 +79,4 @@ 
 dist_man_MANS += text-utils/more.1
 endif
 endif # !HAVE_NCURSES
+endif # BUILD_ALLPROGS
Index: b/disk-utils/Makemodule.am
===================================================================
--- a/disk-utils/Makemodule.am
+++ b/disk-utils/Makemodule.am
@@ -1,4 +1,4 @@ 
-
+if BUILD_ALLPROGS
 sbin_PROGRAMS += fsck.minix
 dist_man_MANS += disk-utils/fsck.minix.8
 fsck_minix_SOURCES = \
@@ -142,3 +142,4 @@ 
 partx_LDADD = $(LDADD) libblkid.la libcommon.la
 
 endif # BUILD_PARTX
+endif # BUILD_ALLPROGS
Index: b/login-utils/Makemodule.am
===================================================================
--- a/login-utils/Makemodule.am
+++ b/login-utils/Makemodule.am
@@ -1,4 +1,4 @@ 
-
+if BUILD_ALLPROGS
 if BUILD_LAST
 usrbin_exec_PROGRAMS += last
 dist_man_MANS += login-utils/last.1
@@ -144,3 +144,4 @@ 
 if BUILD_VIPW
 	cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
 endif
+endif