Solved How to save freebsd state ?

I just installed FreeBSD and I don't have any experiance with it. I noticed that when I apply a config like sudo sysctl hw.snd.default_unit=7 and reboot the system hw.snd.default_unit gets reset to it's original value. This also happens with .Xresources. Running xrdb .Xresoucres only applies to the current session, when I reboot it it goes back the the default. I tried to add hw.snd.default_unit=7 to /boot/loader.conf but that also doesn't work. Is there anything like execute these codes when you start the computer kind of script I have to set it up or I'm missing something ?
 
Hello & welcome to this FreeBSD community!

I noticed that when I apply a config like sudo sysctl hw.snd.default_unit=7 and reboot the system hw.snd.default_unit gets reset to it's original value.
That is indeed the expected behavior.

when I reboot it it goes back the the default. I tried to add hw.snd.default_unit=7 to /boot/loader.conf but that also doesn't work.
I'm no expert on audio but I assume that the device is simply not existing/enumerated yet when /boost/loader.conf gets invoked.
Personally, I have a call to sysctl to set the default output device in my startup script which gets invoked when I log in. At that point all devices connected should be enumerated.
 
Back
Top