Very valuable lesson for me. I was sure you made a typo. Thank you.kld_list+="nvidia"
will not work as expected. This syntax can be used with the command line utilty sysrc(8) like this: on a console (aka terminal) type as user root:sysrc kld_list+=" nvidia"
(note the space) will append the stringnvidia
(again note the space) to the variablekld_list
in the file rc.conf(5). When you omit the space, the item to add will be merged tightly to the previous items in that variable, without the necessary space between them. Thatkld_list
is, well, a list. The separator between the items of the list is a space.
For me too.Very valuable lesson for me. [...] Thank you.
Bummer.kld_list+="nvidia"
will not work as expected. [...]
sysrc kld_list+=" nvidia"
(note the space) will append the stringnvidia
(again note the space) to the variablekld_list
in the file rc.conf(5). [...]
Thatkld_list
is, well, a list.
Please RTFM sysrc(8), sections APPENDING VALUES & SUBTRACTING VALUES.So one has to check anyway whether the item is already in the list, and do other formatting checks also.
And no -=
Maybe some extra options like --list, --uniqueitems and --separator would help making sysrc more usable.
whereis sysrc
and patch it. sysrc(8) is already doing some checks & handling strings smart. That's no surprise since it knows it's handling strings according to sh(1)ell syntax in most cases. And in kld_list
duplicates won't hurt, since kernel modules refuse to load twice.