aboutsummaryrefslogtreecommitdiff
path: root/scripts/hostclass/laptop
blob: 66d41818ba1eef6ee36c872c729dc38bc36bf286 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh

# Set USB power savings
usbconfig | awk -F: '{ print $1 }' | xargs -rtn1 -I% usbconfig -d % power_save ||:
install_file /etc/rc.local

# Create devd rule for lid close.
install_file -m 0555 /usr/local/libexec/lid-close
install_file -m 0644 /etc/devd/lid-close.conf
service devd restart

case ${wireless_type:-} in
  iwm*)
    set_loader_conf \
      if_iwm_load=YES \
      "${wireless_type}fw_load=YES"

    load_kernel_module \
      if_iwm \
      "${wireless_type}fw"

    sysrc -v wlans_iwm0='wlan0'
    ;;
esac

# Configure wireless card.
sysrc -v \
  create_args_wlan0='country US regdomain FCC' \
  ifconfig_wlan0="WPA DHCP powersave"

# Hardware-specific fixes.
case ${laptop_type:-} in
  thinkpad)
    # Set brightness using function keys.
    set_sysctl dev.acpi_ibm.0.handlerevents='0x10 0x11'
    install_file -m 0555 /usr/local/libexec/thinkpad-brightness
    install_file -m 0644 /etc/devd/thinkpad-brightness.conf
    service devd restart
    ;;
esac