# sysfs.conf manual page (sysfs.conf.5)
#
# Copyright © 2022 Guillem Jover <guillem@debian.org>
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

=encoding utf8

=head1 NAME

sysfs.conf, sysfs.d/*.conf - Linux sysfs attributes setting configuration files

=head1 DESCRIPTION

These configuration files are used to set B<sysfs> attribute values and
modify their file mode or owner, during the system boot.

Note that these configuration files are concerned with the F</sys> filesystem
and should not be confused with the F</etc/sysctl.conf> configuration which
is concerned with the F</proc/sys> filesystem instead.

=head1 FORMAT

The syntax consists on a series of line based directives for F<sysfs>
attributes, those being pathnames within that filesystem, with the
following format:

=over 4

=item I<attribute> = I<value>

Set I<value> for the F<sysfs> I<attribute>.

=item B<mode> I<attribute> = I<mode>

Set the I<mode> for the F<sysfs> I<attribute>.
Where I<mode> is any mode accepted by L<chmod(1)>.

=item B<owner> I<attribute> = I<owner>[:I<group>]

Set the I<owner> (and/or I<group>) for the F<sysfs> I<attribute>.
Where I<owner> (and/or I<group>) are any specification accepted by
L<chown(1)>.

=back

Leading and trailing whitespace (SPACE, TAB), and whitespace around
the B<=> character are ignored.

Comments start with a B<#> character until the end of line.
Empty or whitespace-only lines are also ignored.

The I<attribute> paths support L<glob(7)> wildcard patterns.

Any I<attribute> that does not exist will be warned about, but will not cause
the loading to fail.

=head1 FILES

=over

=item F</etc/sysfs.conf>

The main configuration file.
It gets loaded first if readable.

=item F</etc/sysfs.d/*.conf>

The optional configuration fragment files.
These get loaded after the main configuration file, if readable,
in glob order.

=back

=head1 EXAMPLES

Always use the powersave CPU frequency governor.

  devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave

Use userspace CPU frequency governor and set initial speed.

  devices/system/cpu/cpu0/cpufreq/scaling_governor = userspace
  devices/system/cpu/cpu0/cpufreq/scaling_setspeed = 600000

Set permissions of suspend control file.

  mode power/state = 0660
  owner power/state = root:power

=head1 SEE ALSO

L<sysfs(5)>,
L<https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt>,
L<https://www.kernel.org/doc/Documentation/ABI/stable/>.
