pgj / freebsd-wifibox

wifibox: Use Linux to drive your wireless card on FreeBSD
BSD 2-Clause "Simplified" License
159 stars 12 forks source link

Removing the wifibox.conf devd configuration file #39

Closed maurizio-emmex closed 1 year ago

maurizio-emmex commented 2 years ago

The devd configuration file /usr/local/etc/devd/wifibox.conf can be removed rewriting the /usr/local/etc/rc.d/wifibox script:


# PROVIDE: wifibox
# BEFORE: netif
# REQUIRE: FILESYSTEMS sysctl kld
# KEYWORD: shutdown nojail resume

. /etc/rc.subr

: ${wifibox_enable="NO"}

name=wifibox
desc="Start and stop wifibox on boot and shutdown"
rcvar=wifibox_enable
extra_commands="resume"

load_rc_config ${name}

command="/usr/local/sbin/${name}"
start_cmd="${command} start"
stop_cmd="${command} stop"
status_cmd="${command} status"
resume_cmd="${command} restart vmm"

run_rc_command "$1"`

Adding the resume keyword the resume command is called from the /etc/rc.resume script.

Regards Maurizio

pgj commented 2 years ago

Oh, that is great to know. Thanks @maurizio-emmex ! I will create a commit for this to update the rc.d script and the documentation. Do you know if this is supported on FreeBSD 12?

maurizio-emmex commented 2 years ago

From the FreeBSD source code the resume keyword, in the /etc/rc.resume script, is supported from release 12.1 . This is the commit

Thanks again for your work.

pgj commented 2 years ago

Okay, this has been implemented as part of ff81a0b80bb46ebd0aa068e3a5beea764cf47aeb . Note that I have developed the idea further to be able to capture other use cases.

pgj commented 1 year ago

I am closing this ticket because it has been made part of the main branch.