From: François Tigeot Date: Sun, 13 Apr 2014 07:01:55 +0000 (+0200) Subject: Dynamic root: Build /bin and /sbin dynamically X-Git-Tag: v3.9.0~160 X-Git-Url: https://gitweb.dragonflybsd.org/~nant/dragonfly.git/commitdiff_plain/92a4a26422e1e1298e05101fec64b5443df39730 Dynamic root: Build /bin and /sbin dynamically * 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 --- diff --git a/bin/Makefile.inc b/bin/Makefile.inc index 6492a9dda9..cf5f210b24 100644 --- a/bin/Makefile.inc +++ b/bin/Makefile.inc @@ -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 diff --git a/sbin/Makefile.inc b/sbin/Makefile.inc index 49b73d4d08..ee49891dd5 100644 --- a/sbin/Makefile.inc +++ b/sbin/Makefile.inc @@ -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 diff --git a/sbin/cryptdisks/Makefile b/sbin/cryptdisks/Makefile index 7437335678..1ec09af08d 100644 --- a/sbin/cryptdisks/Makefile +++ b/sbin/cryptdisks/Makefile @@ -1,5 +1,6 @@ PROG= cryptdisks MAN= cryptdisks.8 +NOSHARED= YES SRCS+= cryptdisks.c safe_mem.c diff --git a/sbin/init/Makefile b/sbin/init/Makefile index 1aae303eb0..1d92ee2060 100644 --- a/sbin/init/Makefile +++ b/sbin/init/Makefile @@ -14,4 +14,6 @@ CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT -DSUPPORT_UTMPX DPADD= ${LIBUTIL} ${LIBCRYPT} LDADD= -lutil -lcrypt +NOSHARED=yes + .include diff --git a/sbin/mount_cd9660/Makefile b/sbin/mount_cd9660/Makefile index fbf02dd8c2..a933a9a36d 100644 --- a/sbin/mount_cd9660/Makefile +++ b/sbin/mount_cd9660/Makefile @@ -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 diff --git a/sbin/mount_msdos/Makefile b/sbin/mount_msdos/Makefile index ee746e80df..e8d74aa321 100644 --- a/sbin/mount_msdos/Makefile +++ b/sbin/mount_msdos/Makefile @@ -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} diff --git a/sbin/mount_ntfs/Makefile b/sbin/mount_ntfs/Makefile index aadaf86c64..ccafd95a40 100644 --- a/sbin/mount_ntfs/Makefile +++ b/sbin/mount_ntfs/Makefile @@ -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} diff --git a/sbin/udevd/Makefile b/sbin/udevd/Makefile index ac610de932..51a2d2376f 100644 --- a/sbin/udevd/Makefile +++ b/sbin/udevd/Makefile @@ -5,4 +5,6 @@ LDADD= -lprop -lpthread DPADD= ${LIBPROP} ${LIBPTHREAD} MAN= udevd.8 +NOSHARED=yes + .include