Page MenuHomeFreeBSD

Add bsd.conf.mk
ClosedPublic

Authored by bapt on Oct 8 2015, 11:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Feb 28, 11:25 PM
Unknown Object (File)
Jan 7 2025, 9:37 PM
Unknown Object (File)
Oct 17 2024, 11:32 AM
Unknown Object (File)
Sep 8 2024, 1:55 AM
Unknown Object (File)
Sep 7 2024, 9:19 PM
Unknown Object (File)
Sep 7 2024, 8:51 PM
Unknown Object (File)
Aug 22 2024, 7:36 PM
Unknown Object (File)
Aug 15 2024, 11:03 AM
Subscribers

Details

Reviewers
imp
bdrewery
Summary

This function adds support for buildconfig and installconfig
Works basically the same way FILES except that installconfig is not hooked to
the realinstall target

Convert the distribution target to keep the current behaviour and call
installconfig on every directories
so mergemaster and friends keep working as expected

Move dma.conf into the libexec/dma directory where it belongs.

This helps packaging base so that when a Makefile is tagged to belong to a given
package all its configuration files are also tagged correctly

It also makes confiuration files behaving like other files: includes, manpages,
etc

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 722
Build 722: arc lint + arc unit

Event Timeline

bapt retitled this revision from to Add bsd.conf.mk.
bapt updated this object.
bapt edited the test plan for this revision. (Show Details)
bapt added reviewers: imp, bdrewery.
bdrewery edited edge metadata.

You've missed the changes from r288964

This revision now requires changes to proceed.Oct 8 2015, 11:22 PM
bapt edited edge metadata.

Address @bdrewery comments

I actually want to unify SCRIPTS and FILES as they are now. Can't you just add a wrapper around FILES for it?

For the installconfig: need just don't install CONFS groups for installfiles:, only let installconfig: handle those groups, which you would define in bsd.files.mk.

CONFS= blah

.include <bsd.confs.mk>
...
bsd.confs.mk:
FILESGROUPS+= CONFS
#CONFS = # already set
CONFSDIR?= /etc/
CONFSOWN?= ${BINOWN}
CONFSGRP?= ${BINGRP}
CONFSMODE?= ${NOBINMODE}

...

bsd.files.mk:

.for group in ${FILESGROUPS}
.if ${group:M*CONFS*}

Only hookup to installconfig, not 'installfiles' which is in realinstall

installconfig: installfiles-${group}
.else
.if defined(${group}) && !empty(${group})
installfiles: installfiles-${group}
.endif

This is a very simple example. You could have CONFSGROUPS that just loop and set appropriate FILES vars for bsd.confs.mk.

share/mk/bsd.README
21

Need more information, how to use?

share/mk/bsd.subdir.mk
125

This target is weird to me. It lacks scripts and nothing seems broken. It's been on my list to investigate more. Explanations welcome.

This comment was removed by bdrewery.
bapt edited edge metadata.

You've missed the changes from r288964

Actually that change does not impact this file. I was thinking it was a clone of bsd.incs.mk.

What SHOULD happen for staging of conf files? Do you want them staged? How do you handle it in your staging?

share/mk/bsd.subdir.mk
125

This one is made so that one can run make installincludes from top level Makefile.inc1, enforcing the target to be defined.

script is not needed here, config is needed because now make distribution calls installconfig on Makefile.inc1

share/mk/bsd.subdir.mk
125

Why is scripts not needed and files is?

I actually want to unify SCRIPTS and FILES as they are now. Can't you just add a wrapper around FILES for it?

For the installconfig: need just don't install CONFS groups for installfiles:, only let installconfig: handle those groups, which you would define in bsd.files.mk.

CONFS= blah

.include <bsd.confs.mk>
...
bsd.confs.mk:
FILESGROUPS+= CONFS
#CONFS = # already set
CONFSDIR?= /etc/
CONFSOWN?= ${BINOWN}
CONFSGRP?= ${BINGRP}
CONFSMODE?= ${NOBINMODE}

...

bsd.files.mk:

.for group in ${FILESGROUPS}
.if ${group:M*CONFS*}

Only hookup to installconfig, not 'installfiles' which is in realinstall

installconfig: installfiles-${group}
.else
.if defined(${group}) && !empty(${group})
installfiles: installfiles-${group}
.endif

This is a very simple example. You could have CONFSGROUPS that just loop and set appropriate FILES vars for bsd.confs.mk.

My plan was to add bsd.conf.mk quickly to unblock working on packaging base, then once I'm done with packaging base I could merge them back.

Now, if you do prefer to have it merged in the first place I would do it yes

In D3850#79511, @bapt wrote:

I actually want to unify SCRIPTS and FILES as they are now. Can't you just add a wrapper around FILES for it?

For the installconfig: need just don't install CONFS groups for installfiles:, only let installconfig: handle those groups, which you would define in bsd.files.mk.

CONFS= blah

.include <bsd.confs.mk>
...
bsd.confs.mk:
FILESGROUPS+= CONFS
#CONFS = # already set
CONFSDIR?= /etc/
CONFSOWN?= ${BINOWN}
CONFSGRP?= ${BINGRP}
CONFSMODE?= ${NOBINMODE}

...

bsd.files.mk:

.for group in ${FILESGROUPS}
.if ${group:M*CONFS*}

Only hookup to installconfig, not 'installfiles' which is in realinstall

installconfig: installfiles-${group}
.else
.if defined(${group}) && !empty(${group})
installfiles: installfiles-${group}
.endif

This is a very simple example. You could have CONFSGROUPS that just loop and set appropriate FILES vars for bsd.confs.mk.

My plan was to add bsd.conf.mk quickly to unblock working on packaging base, then once I'm done with packaging base I could merge them back.

Now, if you do prefer to have it merged in the first place I would do it yes

It's fine. I don't mind doing it when I find time. I have it mapped out in my head pretty clearly too :)

You've missed the changes from r288964

Actually that change does not impact this file. I was thinking it was a clone of bsd.incs.mk.

What SHOULD happen for staging of conf files? Do you want them staged? How do you handle it in your staging?

Exactly the same thing as what is done with the etc directory, which I have no idea what meta mode does about it

bdrewery edited edge metadata.
In D3850#79513, @bapt wrote:

You've missed the changes from r288964

Actually that change does not impact this file. I was thinking it was a clone of bsd.incs.mk.

What SHOULD happen for staging of conf files? Do you want them staged? How do you handle it in your staging?

Exactly the same thing as what is done with the etc directory, which I have no idea what meta mode does about it

Meta Mode really doesn't do anything but build. The FreeBSD work is incomplete for "what comes next". That's something I'll be pushing on soon once I get Isilon's build working, since we need to install things. For Juniper they are generating packages from the stagedir, apparently. Having seen no examples or code to support this I'm not sure if it even relates to "packaging base".

Staging is also used for the auto dependency handling. Every time a file is installed to the stagedir, a FILE.dirdep is created with which src dir staged it. The stagedir is in the default PATH/--sysroot, so anything that is used from the stagedir is considered a dependency for building that thing, using the .dirdep files to map it back to src dirs. AFAIK the .meta files from the objdir were supposed to do this too but it does't work for me; auto dirdeps requires staging.

Beyond that the staging is not 100% complete from what a normal 'installworld' does, since some Makefiles want to do a ".sample" type thing and not overwrite files. The stagedir lacks all of that, so it will never be safe to just cpdup it over to / for example or make a world.txz from it without more handling of these sample/config files.

This seems fine to me if it all builds. I would love to see a @sample type thing supported to. That dma.conf could be installed as .sample and copied over if not present.

This revision is now accepted and ready to land.Oct 8 2015, 11:56 PM

This certainly smells a lot like bsd.files.mk...

share/mk/bsd.README
21

Still kinda slim...

share/mk/bsd.conf.mk
7

Why?

86

doesn't match the if at top of file...

share/mk/bsd.own.mk
216

I'm surprised we don't have this already...