Bug 236125

Summary: /sbin/geom cannot work anymore when world is build WITHOUT_DYNAMICROOT
Product: Base System Reporter: SimpleRezo <simplerezo>
Component: binAssignee: freebsd-geom (Nobody) <geom>
Status: New ---    
Severity: Affects Some People CC: brooks
Priority: ---    
Version: 12.0-RELEASE   
Hardware: Any   
OS: Any   

Description SimpleRezo 2019-03-01 11:27:43 UTC
Hi

Since probably this commit:
https://svnweb.freebsd.org/base?view=revision&revision=335645

If you build world with WITHOUT_DYNAMICROOT=yes, g(tools) won't work anymore because they require loading of dynamic libraries (/lib/geom).

# gpart
gpart: Cannot open library: Service unavailable.

Hotfix:
Comment WITHOUT_DYNAMICROOT in /etc/src.conf.
cd /usr/src/sbin/geom && make && make install clean

Regards
Comment 1 Brooks Davis freebsd_committer freebsd_triage 2019-03-01 19:51:52 UTC
geom(8) is really not designed for static compilation.  We should probably at a minimum alter sbin/geom/Makefile to embed gpart and glabel in the binary when WITHOUT_DYNAMICROOT is defined.  That should be as simple as changing the line mentioning RESCUE to:

.if defined(RESCUE) || defined(RELEASE_CRUNCH) || ${MK_DYNAMICROOT} == "no"

and altering the LINKS value to in the MK_DYNAMICROOT=no case.
Comment 2 Brooks Davis freebsd_committer freebsd_triage 2019-03-07 18:41:28 UTC
For a possible fix see: https://reviews.freebsd.org/D19497