Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Sep 2017 09:53:27 -0600
From:      Ian Lepore <ian@freebsd.org>
To:        Nick Hibma <nick@van-laarhoven.org>, FreeBSD Current Mailing List <freebsd-current@FreeBSD.ORG>
Subject:   Re: How do GEOM_PART_* options configure geom_part_* modules??
Message-ID:  <1506614007.31939.19.camel@freebsd.org>
In-Reply-To: <FD2F9831-F5E9-459D-B250-E5D9AE72DA08@van-laarhoven.org>
References:  <FD2F9831-F5E9-459D-B250-E5D9AE72DA08@van-laarhoven.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2017-09-28 at 17:31 +0200, Nick Hibma wrote:
> I created a new kernel config file from scratch, wondered what the
> GEOM_PART_MBR option and friends were doing, search for them, didn't
> find them in the tree, and deleted them from my config. But... de
> resulting disk image didn't boot, because of the fact that it didn't
> recognise the MBR partitions (it only had a single diskid entry on
> the mount-root prompt).
>=20
> Can anyone explain to me how these kernel options work, as in: they
> are defined in kernel configs and as a consequence in opt_geom.h, but
> how are they actually used to select which geom_part_* modules/kernel
> parts to build? I thought these options were translated to stuff that
> cpp would use, but there are not uses of for example GEOM_PART_MBR
> anywhere for example!
>=20
> The only thing I was able to come up with, but could not figure out,
> was FEATURE() doing some magic.
>=20
> Thanks in advance for any pointers!
>=20
> Nick Hibma
> nick@van-laarhoven.org <mailto:nick@van-laarhoven.org>
>=20
> -- Open Source: We stand on the shoulders of giants.
>=20
>=20
> % grep -r GEOM_PART_ /usr/src/sys/ | grep -Ev '/conf/.*options'
> /usr/src/sys/geom/part/g_part_mbr.c:=A0=A0=A0=A0"GEOM_PART_MBR Master B=
oot
> Record");
> /usr/src/sys/geom/part/g_part_ldm.c:=A0=A0=A0=A0"GEOM_PART_LDM Logical =
Disk
> Manager");
> /usr/src/sys/geom/part/g_part_ldm.c:	=A0* XXX: We use some
> knowledge about GEOM_PART_GPT internal
> /usr/src/sys/geom/part/g_part_ebr.c:#if defined(GEOM_PART_EBR_COMPAT)
> /usr/src/sys/geom/part/g_part_ebr.c:#ifndef GEOM_PART_EBR_COMPAT
> /usr/src/sys/geom/part/g_part_ebr.c:#if defined(GEOM_PART_EBR_COMPAT)
> /usr/src/sys/geom/part/g_part_ebr.c:#if defined(GEOM_PART_EBR_COMPAT)
> /usr/src/sys/geom/part/g_part_ebr.c:#if defined(GEOM_PART_EBR_COMPAT)
> /usr/src/sys/geom/part/g_part_ebr.c:#if defined(GEOM_PART_EBR_COMPAT)
> /usr/src/sys/geom/part/g_part_ebr.c:#ifndef GEOM_PART_EBR_COMPAT
> /usr/src/sys/geom/part/g_part_ebr.c:#ifndef GEOM_PART_EBR_COMPAT
> /usr/src/sys/geom/part/g_part_ebr.c:#ifndef GEOM_PART_EBR_COMPAT
> /usr/src/sys/geom/part/g_part_ebr.c:#ifndef GEOM_PART_EBR_COMPAT
> /usr/src/sys/geom/part/g_part.h:#ifndef _GEOM_PART_H_
> /usr/src/sys/geom/part/g_part.h:#define	_GEOM_PART_H_
> /usr/src/sys/geom/part/g_part.h:#endif /* !_GEOM_PART_H_ */

If you had added '-i' to your grep command you would have found the
missing piece in sys/conf/files. =A0config(8) turns uppercase OPTION_NAME
into lowercase option_name for purposes of configuring which files to
compile.

-- Ian




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1506614007.31939.19.camel>