Is /boot/device.hints supposed to be Read Only?

I'm trying to make freebsd switch audio output automatically to headphones.

In 9.2.4. Automatically Switching to Headphones​

the handbook says = "Add the following lines to /boot/device.hints:"
Code:
hint.hdac.0.cad0.nid22.config="as=1 seq=15 device=Headphones"
hint.hdac.0.cad0.nid26.config="as=2 seq=0 device=speakers"
But this file is set to -r--r--r-- 1 root wheel /boot/device.hints
Could you please verify your permissions on your system and let me know if i should change my file's permissions.

 
Yes, /boot/device.hints has 444 permissions. But as root you can write a file even if it doesn't have write bit set. So you should be able to edit this file.
By the way, you can make file unwritable even for root by settings file schg flag with chflags(1):
Code:
schg, schange, simmutable
        set the system immutable flag (super-user only)
Code:
# chflags schg myfile
and even root can't write to it.
You can see file flags with ls(1), for instance:
Code:
$ ls -lo myfile
-r--r--r--  1 root wheel schg 11 Jan 13 23:53 myfile
To make it writable again:
Code:
# chflags noschg myfile

Now, regarding your question: as far as I know, it's not very recommended to edit /boot/device.hints, since it may be changed as part of the upgrade process. It's better to treat /boot/device.hints as defaults for hints, and I believe you should be able to set the hints you want in /boot/loader.conf instead.
 
Back
Top