Page MenuHomeFreeBSD

Normalize the g(eom,cache,part,...) build.

Authored by brooks on May 8 2018, 10:33 PM.



Rather then combining hardlink creation for the geom(8) binary with
shared library build, move libraries to src/lib/geom so they are
built and installed normally. Create a common Makefile.classes
which is included by both lib/geom/Makefile and sbin/geom/Makefile
so the symlink and libraries stay in sync.

The relocation of libraries allows libraries to be build for 32-bit
compat. This also reduces the number of non-standard build options in
the system.

This commit is not sufficent to run a 32-bit /sbin/geom on a 64-bit
system out of the box as it will look in the wrong place for libraries
unless GEOM_LIBRARY_PATH is set appropriatly in the environment.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

brooks created this revision.May 8 2018, 10:33 PM
bdrewery requested changes to this revision.May 8 2018, 10:46 PM

Please update the paths here too:

targets/pseudo/tests/Makefile.depend:      tests/sys/geom \
targets/pseudo/tests/Makefile.depend:      tests/sys/geom/class \
targets/pseudo/tests/Makefile.depend:      tests/sys/geom/class/concat \
targets/pseudo/tests/Makefile.depend:      tests/sys/geom/class/eli \
targets/pseudo/tests/Makefile.depend:      tests/sys/geom/class/gate \
targets/pseudo/tests/Makefile.depend:      tests/sys/geom/class/mirror \
targets/pseudo/tests/Makefile.depend:      tests/sys/geom/class/nop \
targets/pseudo/tests/Makefile.depend:      tests/sys/geom/class/raid3 \
targets/pseudo/tests/Makefile.depend:      tests/sys/geom/class/shsec \
targets/pseudo/tests/Makefile.depend:      tests/sys/geom/class/stripe \
targets/pseudo/tests/Makefile.depend:      tests/sys/geom/class/uzip \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/cache \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/concat \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/eli \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/journal \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/label \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/mirror \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/mountver \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/multipath \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/nop \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/part \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/raid \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/raid3 \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/sched \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/shsec \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/stripe \
targets/pseudo/userland/Makefile.depend:        sbin/geom/class/virstor \
targets/pseudo/userland/Makefile.depend:        sbin/geom/core \

And the paths in the moved Makefile.depend files:

sbin/geom/class/cache/Makefile.depend:  sbin/geom/core \
sbin/geom/class/concat/Makefile.depend: sbin/geom/core \
sbin/geom/class/eli/Makefile.depend:    sbin/geom/core \
sbin/geom/class/journal/Makefile.depend:        sbin/geom/core \
sbin/geom/class/label/Makefile.depend:  sbin/geom/core \
sbin/geom/class/mirror/Makefile.depend: sbin/geom/core \
sbin/geom/class/mountver/Makefile.depend:       sbin/geom/core \
sbin/geom/class/multipath/Makefile.depend:      sbin/geom/core \
sbin/geom/class/nop/Makefile.depend:    sbin/geom/core \
sbin/geom/class/part/Makefile.depend:   sbin/geom/core \
sbin/geom/class/raid/Makefile.depend:   sbin/geom/core \
sbin/geom/class/raid3/Makefile.depend:  sbin/geom/core \
sbin/geom/class/sched/Makefile.depend:  sbin/geom/core \
sbin/geom/class/shsec/Makefile.depend:  sbin/geom/core \
sbin/geom/class/stripe/Makefile.depend: sbin/geom/core \
This revision now requires changes to proceed.May 8 2018, 10:46 PM
bdrewery added inline comments.May 8 2018, 10:56 PM
2426 ↗(On Diff #42292)

Ew now we have a lib/geom and lib/libgeom. It's already confused me at least 3 times in this review.

22 ↗(On Diff #42292)

Adding this down below:
SUBDIR_DEPEND_geom+= libufs
Should allow moving libufs down to the normal SUBDIR in the alphabetical order.

This SUBDIR_BOOTSTRAP list is a lazy hack to avoid writing a bunch more SUBDIR_DEPEND.

brooks updated this revision to Diff 42295.May 8 2018, 10:58 PM
  • Chase the relocation of library directories.
brooks updated this revision to Diff 42314.May 9 2018, 3:13 PM
brooks marked an inline comment as done.
  • Create WORLDTMP/lib/geom
  • Use SUBDIR_DEPENDS_geom to depend on libufs.
brooks marked an inline comment as done.May 9 2018, 3:13 PM
brooks added inline comments.
2426 ↗(On Diff #42292)

Other name options welcome. The best alternative I've come up with is libgeom_classes.

bdrewery accepted this revision.Jun 19 2018, 5:15 PM
This revision is now accepted and ready to land.Jun 19 2018, 5:15 PM
This revision was automatically updated to reflect the committed changes.

This commit is possibly incomplete. I get a make[4]: "/usr/src/lib/geom/" line 15: Could not find Makefile.classes immediately after the new geom objdir is created; make completely aborts here. Makefile.classes indeed does not exist in the new directory.

brd added a subscriber: brd.Jun 25 2018, 10:00 PM

This commit is possibly incomplete. I get a make[4]: "/usr/src/lib/geom/" line 15: Could not find Makefile.classes immediately after the new geom objdir is created; make completely aborts here. Makefile.classes indeed does not exist in the new directory.

Fixed in rS335647.