summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2006-01-08 10:15:31 +0000
committerdougb <dougb@FreeBSD.org>2006-01-08 10:15:31 +0000
commit2bdeba9d87921218cb6722c0da1b74fe0bd119ac (patch)
tree5b32eb52c896d966f1bb237b4835bd3f29e1dda2
parent6f27a53b6f2b9f17b4144b5da54af97bb6d66991 (diff)
downloadFreeBSD-src-2bdeba9d87921218cb6722c0da1b74fe0bd119ac.zip
FreeBSD-src-2bdeba9d87921218cb6722c0da1b74fe0bd119ac.tar.gz
Add a mechanism to include files added by ports which contain
the names of directories to include in the base ldconfig script. This will eliminate the need for each port to install its own boot script which does nothing but ldocnfig a given directory. This code was developed by flz (ports committer), discussed on freebsd-rc@, and modified slightly by me. Submitted by: flz Reviewed by: brooks
-rw-r--r--etc/defaults/rc.conf5
-rw-r--r--etc/mtree/BSD.local.dist4
-rw-r--r--etc/mtree/BSD.x11.dist4
-rwxr-xr-xetc/rc.d/ldconfig17
-rw-r--r--share/man/man5/rc.conf.517
-rw-r--r--sys/sys/param.h2
6 files changed, 48 insertions, 1 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index df0143d..a6e5eba 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -498,6 +498,11 @@ ldconfig_paths="/usr/lib/compat /usr/X11R6/lib /usr/local/lib /usr/local/lib/com
# shared library search paths
ldconfig_paths_aout="/usr/lib/compat/aout /usr/X11R6/lib/aout /usr/local/lib/aout"
# a.out shared library search paths
+ldconfig_local_dirs="/usr/local/libdata/ldconfig /usr/X11R6/libdata/ldconfig"
+ # Local directories with ldconfig configuration files.
+ldconfig_local32_dirs="/usr/local/libdata/ldconfig32 /usr/X11R6/libdata/ldconfig32"
+ # Local directories with 32-bit compatibility ldconfig
+ # configuration files.
kern_securelevel_enable="NO" # kernel security level (see init(8)),
kern_securelevel="-1" # range: -1..3 ; `-1' is the most insecure
# Note that setting securelevel to 0 will result
diff --git a/etc/mtree/BSD.local.dist b/etc/mtree/BSD.local.dist
index 966fc02..491e0f5 100644
--- a/etc/mtree/BSD.local.dist
+++ b/etc/mtree/BSD.local.dist
@@ -20,6 +20,10 @@
lib
..
libdata
+ ldconfig
+ ..
+ ldconfig32
+ ..
pkgconfig
..
..
diff --git a/etc/mtree/BSD.x11.dist b/etc/mtree/BSD.x11.dist
index ef33781..122cdd5 100644
--- a/etc/mtree/BSD.x11.dist
+++ b/etc/mtree/BSD.x11.dist
@@ -192,6 +192,10 @@
..
..
libdata
+ ldconfig
+ ..
+ ldconfig32
+ ..
..
libexec
..
diff --git a/etc/rc.d/ldconfig b/etc/rc.d/ldconfig
index 96de363..60a61e1 100755
--- a/etc/rc.d/ldconfig
+++ b/etc/rc.d/ldconfig
@@ -22,6 +22,11 @@ ldconfig_start()
checkyesno ldconfig_insecure && _ins="-i"
if [ -x "${ldconfig_command}" ]; then
_LDC="/lib /usr/lib"
+ for i in ${ldconfig_local_dirs}; do
+ if [ -d "${i}" ]; then
+ ldconfig_paths="${ldconfig_paths} `find ${i} -type f`"
+ fi
+ done
for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
if [ -r "${i}" ]; then
_LDC="${_LDC} ${i}"
@@ -30,6 +35,18 @@ ldconfig_start()
echo 'ELF ldconfig path:' ${_LDC}
${ldconfig} -elf ${_ins} ${_LDC}
+ case `sysctl -n hw.machine_arch` in
+ amd64)
+ for i in ${ldconfig_local32_dirs}; do
+ if [ -d "${i}" ]; then
+ ldconfig32_paths="${ldconfig32_paths} `find ${i} -type f`"
+ fi
+ done
+ echo '32-bit compatibility ldconfig path:' ${ldconfig32_paths}
+ ${ldconfig} -32 -m ${_ins} ${ldconfig32_paths}
+ ;;
+ esac
+
# Legacy aout support for i386 only
case `sysctl -n hw.machine_arch` in
i386)
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index 5a732b8..b915c2a 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -2830,6 +2830,23 @@ which are writable by anyone except root.
Set this variable to
.Dq Li YES
to disable that security check during system startup.
+.It Va ldconfig_local_dirs
+.Pq Vt str
+Set to the list of local
+.Xr ldconfig 8
+directories.
+The names of all files in the directories listed will be
+passed as arguments to
+.Xr ldconfig 8 .
+.It Va ldconfig_local32_dirs
+.Pq Vt str
+Set to the list of local 32-bit compatibility
+.Xr ldconfig 8
+directories.
+The names of all files in the directories listed will be
+passed as arguments to
+.Xr ldconfig 8
+.Fl 32 .
.It Va kern_securelevel_enable
.Pq Vt bool
Set to
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 187337c..8883754 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -57,7 +57,7 @@
* is created, otherwise 1.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 700011 /* Master, propagated to newvers */
+#define __FreeBSD_version 700012 /* Master, propagated to newvers */
#ifndef LOCORE
#include <sys/types.h>
OpenPOWER on IntegriCloud