Page MenuHomeFreeBSD

release: Add a helper script for common tools
ClosedPublic

Authored by bnovkov on Jun 25 2025, 9:55 AM.
Tags
None
Referenced Files
F132377142: D51038.diff
Thu, Oct 16, 9:04 AM
Unknown Object (File)
Sun, Oct 12, 6:45 AM
Unknown Object (File)
Wed, Sep 24, 1:09 AM
Unknown Object (File)
Wed, Sep 17, 12:35 PM
Unknown Object (File)
Wed, Sep 17, 5:21 AM
Unknown Object (File)
Wed, Sep 17, 4:42 AM
Unknown Object (File)
Tue, Sep 16, 4:59 PM
Unknown Object (File)
Sep 16 2025, 9:58 AM

Details

Summary

Add a helper script that populates variables used to invoke several tools.
This is also the first step towards cleaning up several inconsistencies
related to tool invocation in various release scripts (e.g. ${MAKEFS} vs makefs).

Sponsored by: Klara, Inc.
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des added inline comments.
release/scripts/tools.subr
36

This can be reduced to

: ${ETDUMP:=etdump}
release/scripts/tools.subr
9
bnovkov marked 2 inline comments as done.

Address @des 's and @emaste 's comments.

release/scripts/tools.subr
36

Thank you, fixed.

This revision is now accepted and ready to land.Jun 25 2025, 8:15 PM

It's OK to omit the license boilerplate and have just the SPDX now too, i.e. remove Redistribution and use ... SUCH DAMAGE. Just noticed since this file only has three lines of content now.

markj added a subscriber: markj.

Is this the right place to interpose if I want to add a flag to every use of one of these tools? For instance, in reproducible build mode, mkimg should be invoked with the new -R flag; should I just write something like

if [ -n "$REPRODUCIBLE_BUILD" ]; then
    MKIMG="${MKIMG} -R"
fi

here?

This revision now requires review to proceed.Jun 26 2025, 3:23 PM
This revision is now accepted and ready to land.Jun 26 2025, 3:28 PM

It's OK to omit the license boilerplate and have just the SPDX now too, i.e. remove Redistribution and use ... SUCH DAMAGE. Just noticed since this file only has three lines of content now.

Done, thank you!

Is this the right place to interpose if I want to add a flag to every use of one of these tools? For instance, in reproducible build mode, mkimg should be invoked with the new -R flag; should I just write something like

if [ -n "$REPRODUCIBLE_BUILD" ]; then
    MKIMG="${MKIMG} -R"
fi

here?

Yes, this is a good spot to add such flags.
Should we introduce variables like MKIMGARGS make this a little bit clearer?

It's OK to omit the license boilerplate and have just the SPDX now too, i.e. remove Redistribution and use ... SUCH DAMAGE. Just noticed since this file only has three lines of content now.

Done, thank you!

Is this the right place to interpose if I want to add a flag to every use of one of these tools? For instance, in reproducible build mode, mkimg should be invoked with the new -R flag; should I just write something like

if [ -n "$REPRODUCIBLE_BUILD" ]; then
    MKIMG="${MKIMG} -R"
fi

here?

Yes, this is a good spot to add such flags.
Should we introduce variables like MKIMGARGS make this a little bit clearer?

Probably yes, embedding flags directly in MKIMG is fragile, since the caller might reasonably override MKIMG to point to a different executable.