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
Unknown Object (File)
Feb 26 2024, 10:03 PM
Unknown Object (File)
Feb 26 2024, 9:29 PM
Unknown Object (File)
Feb 18 2024, 11:36 PM
Unknown Object (File)
Dec 22 2023, 9:13 PM
Unknown Object (File)
Oct 27 2023, 1:48 AM
Unknown Object (File)
Aug 1 2023, 3:37 PM
Unknown Object (File)
Aug 1 2023, 3:37 PM
Unknown Object (File)
Aug 1 2023, 3:37 PM

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.