Skip to content

Refine /etc/matter layout for network-manager daemon#49

Merged
ksperling-apple merged 1 commit into
project-chip:mainfrom
ksperling-apple:netman-config
Jun 18, 2026
Merged

Refine /etc/matter layout for network-manager daemon#49
ksperling-apple merged 1 commit into
project-chip:mainfrom
ksperling-apple:netman-config

Conversation

@ksperling-apple

Copy link
Copy Markdown
Contributor

Change /etc/matter to be owned by root and group-readable and move non-factory data into /etc/matter/data; only this sub-directory is now owned by the matter user. Change permissions of chip_factory.ini to be no longer group or world readable. Run the daemon with umask 027 instead of the default 022.

These changes make it easier to "factory reset" the Matter service by deleting /etc/matter/data, and lay the ground work for giving another daemon read-access to some files managed by the matter daemon via the matter group (e.g. letting hostapd read /etc/matter/network).

Also simplify get_model_name() to use jsonfilter instead of jshn (this is the same logic also used in the otbr-agent init script). jsonfilter is a dependency of the base-files package, so is always already available in practice. Also add the missing jsonfilter dependency to the openthread-br package.

Change /etc/matter to be owned by root and group-readable and move non-factory
data into /etc/matter/data; only this sub-directory is now owned by the matter
user.  Change permissions of chip_factory.ini to be no longer group or world
readable. Run the daemon with umask 027 instead of the default 022.

These changes make it easier to "factory reset" the Matter service by deleting
/etc/matter/data, and lay the ground work for giving another daemon read-access
to some files managed by the matter daemon via the matter group (e.g. letting
hostapd read /etc/matter/network).

Also simplify get_model_name() to use jsonfilter instead of jshn (this is the
same logic also used in the otbr-agent init script). jsonfilter is a dependency
of the base-files package, so is always already available in practice. Also add
the missing jsonfilter dependency to the openthread-br package.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates Matter configuration and persistence data from /etc/matter to /etc/matter/data, replaces custom JSON parsing in bootstrap.sh with jsonfilter, and introduces umask restrictions. The review feedback suggests three key improvements: unconditionally setting correct ownership and permissions on /etc/matter to avoid skipped migrations, checking for file existence before moving them during migration to prevent shell errors, and using the native procd_set_param umask in the init script instead of spawning an intermediate shell.

Comment thread service/matter-netman/files/bootstrap.sh
Comment thread service/matter-netman/files/bootstrap.sh
Comment thread service/matter-netman/files/matter.init
@rmelotte

Copy link
Copy Markdown
Contributor

I went over it only briefly and haven't tested it, but the changes look good to me 👍

@ksperling-apple ksperling-apple added the sdk-maintainer-approved PR marked by `matter-sdk-maintainers` as suitable for MERGE label Jun 18, 2026
@ksperling-apple ksperling-apple merged commit fee994f into project-chip:main Jun 18, 2026
5 checks passed
@ksperling-apple ksperling-apple deleted the netman-config branch June 18, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review - pending sdk-maintainer-approved PR marked by `matter-sdk-maintainers` as suitable for MERGE

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants