Page MenuHomeFreeBSD

Try to create the debug directory if it does not exist.
ClosedPublic

Authored by bdrewery on Feb 23 2016, 6:29 PM.
Tags
None
Referenced Files
F103212008: D5411.id14039.diff
Fri, Nov 22, 7:08 AM
Unknown Object (File)
Mon, Nov 11, 2:38 PM
Unknown Object (File)
Mon, Oct 28, 12:51 PM
Unknown Object (File)
Oct 6 2024, 12:47 AM
Unknown Object (File)
Oct 6 2024, 12:25 AM
Unknown Object (File)
Oct 5 2024, 1:47 AM
Unknown Object (File)
Oct 3 2024, 5:12 AM
Unknown Object (File)
Oct 3 2024, 1:04 AM

Details

Summary

HardenedBSD folks reported that they have an out-of-tree LIB that by default
tries to install to /usr/lib and install debug files to /usr/lib/debug.
The /usr/lib/debug directory is not present though since it only comes from the
base-db.txz package.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bdrewery retitled this revision from to Try to create the debug directory if it does not exist..
bdrewery updated this object.
bdrewery edited the test plan for this revision. (Show Details)
bdrewery added a reviewer: emaste.

I went with this route as it cuts down on redundant install -d.

This has been tested successfully by a HardenedBSD user.

HardenedBSD folks reported that they have an out-of-tree LIB that by default
tries to install to /usr/lib and install debug files to /usr/lib/debug.
The /usr/lib/debug directory is not present though since it only comes from the
base-db.txz package.

I'm missing something here; the /usr/lib/debug hierarchy is created unconditionally. This case applies only to a binary installation, then building and installing additional components to go into /usr/lib?

share/mk/bsd.lib.mk
145 ↗(On Diff #13654)

DEBUGFILEDIR should never be empty

HardenedBSD folks reported that they have an out-of-tree LIB that by default
tries to install to /usr/lib and install debug files to /usr/lib/debug.
The /usr/lib/debug directory is not present though since it only comes from the
base-db.txz package.

I'm missing something here; the /usr/lib/debug hierarchy is created unconditionally. This case applies only to a binary installation, then building and installing additional components to go into /usr/lib?

Well it's not being added to base.txz.

  1. fetch https://download.freebsd.org/ftp/snapshots/amd64/11.0-CURRENT/base.txz
  2. tar -tf base.txz|grep usr/lib/debug #
bdrewery edited edge metadata.

DEBUGFILEDIR is never empty.

HardenedBSD folks reported that they have an out-of-tree LIB that by default
tries to install to /usr/lib and install debug files to /usr/lib/debug.
The /usr/lib/debug directory is not present though since it only comes from the
base-db.txz package.

I'm missing something here; the /usr/lib/debug hierarchy is created unconditionally. This case applies only to a binary installation, then building and installing additional components to go into /usr/lib?

See Makefile.inc1 distributeworld:

.if ${MK_DEBUG_FILES} != "no"
        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
            -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
.endif

It's conditional there (and 2 other places) which is what release/Makefile uses for base.txz.

I'm liking this change better than changing distributeworld to release empty directories.

This revision was automatically updated to reflect the committed changes.