Dynamic root: Build /bin and /sbin dynamically
authorFrançois Tigeot <ftigeot@wolfpond.org>
Sun, 13 Apr 2014 07:01:55 +0000 (09:01 +0200)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Sun, 13 Apr 2014 07:08:08 +0000 (09:08 +0200)
* Introduce a NO_DYNAMICROOT variable for people wanting to keep
  fully static /bin and /sbin directories

* Keep building /sbin/init statically

* Keep a few other binaries static to avoid moving too many libraries
  to /lib and/or creating many symlinks.
  Those few binaries do not handle user names and thus don't need to be
  NSS aware/dynamically linked.

* In particular, keeping udevd static allow us to avoid moving libpthread
  and its associated links to libc_r or libthread_xu

bin/Makefile.inc
sbin/Makefile.inc
sbin/cryptdisks/Makefile
sbin/init/Makefile
sbin/mount_cd9660/Makefile
sbin/mount_msdos/Makefile
sbin/mount_ntfs/Makefile
sbin/udevd/Makefile

index 6492a9d..cf5f210 100644 (file)
@@ -1,7 +1,8 @@
 #      @(#)Makefile.inc        8.1 (Berkeley) 5/31/93
 # $FreeBSD: src/bin/Makefile.inc,v 1.11.2.1 2001/12/13 09:58:12 ru Exp $
-# $DragonFly: src/bin/Makefile.inc,v 1.3 2005/02/06 06:12:32 okumoto Exp $
 
 BINDIR?=       /bin
+.if defined(NO_DYNAMICROOT)
 NOSHARED?=     YES
+.endif
 WARNS?=                6
index 49b73d4..ee49891 100644 (file)
@@ -3,5 +3,7 @@
 # $DragonFly: src/sbin/Makefile.inc,v 1.3 2006/10/17 00:55:39 pavalos Exp $
 
 BINDIR?=       /sbin
+.if defined(NO_DYNAMICROOT)
 NOSHARED?=     YES
+.endif
 WARNS?=                6
index 7437335..1ec09af 100644 (file)
@@ -1,5 +1,6 @@
 PROG=          cryptdisks
 MAN=           cryptdisks.8
+NOSHARED=      YES
 
 SRCS+=         cryptdisks.c safe_mem.c
 
index 1aae303..1d92ee2 100644 (file)
@@ -14,4 +14,6 @@ CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT -DSUPPORT_UTMPX
 DPADD= ${LIBUTIL} ${LIBCRYPT}
 LDADD= -lutil -lcrypt
 
+NOSHARED=yes
+
 .include <bsd.prog.mk>
index fbf02dd..a933a9a 100644 (file)
@@ -1,6 +1,8 @@
 #      @(#)Makefile    8.3 (Berkeley) 3/27/94
 # $FreeBSD: src/sbin/mount_cd9660/Makefile,v 1.4.6.1 2001/04/25 10:58:34 ru Exp $
 
+NOSHARED=YES
+
 PROG=  mount_cd9660
 MAN=   mount_cd9660.8
 LDADD=  -lutil -lkiconv
index ee746e8..e8d74aa 100644 (file)
@@ -2,6 +2,8 @@
 # $FreeBSD: src/sbin/mount_msdos/Makefile,v 1.14.2.6 2002/08/07 16:31:48 ru Exp $
 #
 
+NOSHARED=yes
+
 PROG=  mount_msdos
 MAN=   mount_msdos.8
 DPADD= ${LIBUTIL} ${LIBKICONV}
index aadaf86..ccafd95 100644 (file)
@@ -2,6 +2,8 @@
 # $FreeBSD: src/sbin/mount_ntfs/Makefile,v 1.2.2.2 2001/10/12 22:08:43 semenu Exp $
 #
 
+NOSHARED=yes
+
 PROG=  mount_ntfs
 MAN=   mount_ntfs.8
 DPADD= ${LIBUTIL} ${LIBKICONV}
index ac610de..51a2d23 100644 (file)
@@ -5,4 +5,6 @@ LDADD=  -lprop -lpthread
 DPADD= ${LIBPROP} ${LIBPTHREAD}
 MAN=   udevd.8
 
+NOSHARED=yes
+
 .include <bsd.prog.mk>