blob: 5e1ae2f1370d6fcfd5ec5d9005040db65780c9c2 (
plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
#!/bin/sh
# Craig Jennings <c@cjennings.net>
# optimizes and enables functionality in the boot sequence
# ensure root
if ! [ $(id -u) -eq 0 ]
then
echo "Must run as root. Exiting."
exit
fi
# disable devil icon in boot menu
sysrc -f /boot/loader.conf loader_logo="none"
# hide kernel diagnostics
sysrc -f /boot/loader.conf boot_mute="YES"
# reduce default wait time before boot
sysrc -f /boot/loader.conf autoboot_delay=2
# don't print start messages
sysrc rc_startmsgs=NO
# create console.log with the proper permissions
touch /var/log/console.log
chmod 600 /var/log/console.log
# move from printing errors to the console to printing them to the above console.log file
sed -i '' 's#/dev/console#/var/log/console.log#' /etc/syslog.conf
# prevent core dumps
echo "kern.coredump=0" >> /etc/sysctl.conf
# enable linuxulator
sysrc -v linux_enable=YES
# load microcode
sysrc -f /boot/loader.conf cpu_microcode_load="YES"
sysrc -f /boot/loader.conf cpu_microcode_name="/boot/firmware/intel-ucode.bin"
# Enable querying CPU information and temperature.
sysrc -f /boot/loader.conf cpuctl_load="YES"
sysrc -f /boot/loader.conf coretemp_load="YES"
# Optimizations for Intel graphics.
echo 'compat.linuxkpi.i915_enable_fbc="1"' | sudo tee -a /boot/loader.conf
echo 'compat.linuxkpi.i915_fastboot="1"' | sudo tee -a /boot/loader.conf
# Power saving for Intel graphics.
echo 'compat.linuxkpi.i915_disable_power_well="1"' | sudo tee -a /boot/loader.conf
echo 'compat.linuxkpi.i915_enable_dc="2"' | sudo tee -a /boot/loader.conf
# Allow unprivileged users to mount
echo 'vfs.usermount=1' | sudo tee -a /etc/sysctl.conf
# Increase ZFS transaction timeout to save battery.
echo 'vfs.zfs.txg.timeout="10"' | sudo tee -a /boot/loader.conf
# fuse filesystems
sysrc kld_list="${kld_list} fusefs"
# allow for usb mounting (e.g., kobo reader)
pw groupadd usb
pw groupmod usb -m root,cjennings
echo "[usb=12]" | tee -a /etc/devfs.rules
echo "add path 'usb/*' mode 0660 group usb" | tee -a /etc/devfs.rules
sysrc devfs_system_ruleset="usb"
service devfs restart
|