Page MenuHomeFreeBSD

nanobsd: Remove chflags call in install_world()
Needs ReviewPublic

Authored by senguptaangshuman17_gmail.com on Wed, Aug 19, 10:19 AM.
Tags
None
Referenced Files
F168861902: D58957.id184832.diff
Sun, Aug 30, 12:11 PM
F168848604: D58957.id185262.diff
Sun, Aug 30, 10:49 AM
F168826486: D58957.diff
Sun, Aug 30, 8:22 AM
F168825008: D58957.id184967.diff
Sun, Aug 30, 8:10 AM
F168808200: D58957.id184832.diff
Sun, Aug 30, 6:26 AM
F168789805: D58957.id184598.diff
Sun, Aug 30, 4:14 AM
F168784585: D58957.id184967.diff
Sun, Aug 30, 3:37 AM
F168768351: D58957.id.diff
Sun, Aug 30, 1:33 AM
Subscribers

Details

Reviewers
jlduran
jrm
ashish
Summary

NanoBSD images should retain file flags set by the installation process (such as the schg flag on /var/empty) to match a standard FreeBSD installation. Unconditionally stripping system flags with chflags -R noschg after installworld removes these expected security flags.

clean_world() already takes care of clearing noschg when wiping NANO_WORLDDIR and NANO_OBJ during clean builds.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76297
Build 73180: arc lint + arc unit

Event Timeline

I would recommend squashing the majority of this commit with D58931, as the changes are mostly NFC (the leftovers).

tools/tools/nanobsd/defaults.sh
1046–1047

This is a "functional" change and should be submitted separately.

Isolate functional change (disable chflags in install_world) and normalize comments

senguptaangshuman17_gmail.com retitled this revision from nanobsd: Cleanup common functions to nanobsd: Disable chflags call in install_world().Thu, Aug 20, 7:04 PM

Commit message needs a why.

senguptaangshuman17_gmail.com retitled this revision from nanobsd: Disable chflags call in install_world() to nanobsd: Remove chflags call in install_world().Tue, Aug 25, 6:13 AM

While I do agree with the change, I do not fully agree with the commit message.
For me, the reason we want to remove this step is because we want to ship a NanoBSD image with the flags set just like a normal FreeBSD installation (/var/empty for instance).

While I do agree with the change, I do not fully agree with the commit message.
For me, the reason we want to remove this step is because we want to ship a NanoBSD image with the flags set just like a normal FreeBSD installation (/var/empty for instance).

will this work?

nanobsd: Remove chflags call in install_world()
     
NanoBSD images should retain file flags set by the installation process
(such as the schg flag on /var/empty) to match a standard FreeBSD
installation. Unconditionally stripping system flags with chflags -R noschg
after installworld removes these expected security flags.
    
clean_world() already takes care of clearing noschg when wiping
NANO_WORLDDIR and NANO_OBJ during clean builds.
     
Sponsored by:   Google LLC (GSoC 2026)
Differential Revision:  https://reviews.freebsd.org/D58957

While I do agree with the change, I do not fully agree with the commit message.
For me, the reason we want to remove this step is because we want to ship a NanoBSD image with the flags set just like a normal FreeBSD installation (/var/empty for instance).

will this work?

nanobsd: Remove chflags call in install_world()
     
NanoBSD images should retain file flags set by the installation process
(such as the schg flag on /var/empty) to match a standard FreeBSD
installation. Unconditionally stripping system flags with chflags -R noschg
after installworld removes these expected security flags.
    
clean_world() already takes care of clearing noschg when wiping
NANO_WORLDDIR and NANO_OBJ during clean builds.
     
Sponsored by:   Google LLC (GSoC 2026)
Differential Revision:  https://reviews.freebsd.org/D58957

Sure!