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
F170858898: D58957.id184322.diff
Mon, Sep 7, 2:23 AM
F170817529: D58957.diff
Sun, Sep 6, 7:57 PM
F170781006: D58957.id184967.diff
Sun, Sep 6, 2:32 PM
F170780985: D58957.id184598.diff
Sun, Sep 6, 2:31 PM
F170780660: D58957.id184505.diff
Sun, Sep 6, 2:29 PM
F170780630: D58957.id185382.diff
Sun, Sep 6, 2:28 PM
F170780609: D58957.id184995.diff
Sun, Sep 6, 2:28 PM
F170780593: D58957.id185262.diff
Sun, Sep 6, 2:28 PM
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 76252
Build 73135: 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!