Skip to content

Instantly share code, notes, and snippets.

@mister2d
Forked from priyadarshan/PolicyKit.conf
Created September 28, 2018 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mister2d/0c129ba8944922deec4fa3b73e30d9bd to your computer and use it in GitHub Desktop.
Save mister2d/0c129ba8944922deec4fa3b73e30d9bd to your computer and use it in GitHub Desktop.
FreeBSD 11 notebook installation cheat-sheet
# Add to /etc/X11/xorg.conf
# https://unix.stackexchange.com/questions/34158/rebinding-disabling-ctrlaltf
# disable VT switching with Ctrl+Alt+Fn
# This is particularly bad right now, since
# nVidia driver has a bug: whne one switch VT, it falls back to a black screen.
# In that case, one should log out, log back in, and manually restart startx
# Also, to kill X11 (in case one needs to relaod xorg.conf), just do
# sudo service kdm4 stop
# But you will fall back to black screen. Then blindly log back in and do startx.
Section "ServerFlags"
Option "DontVTSwitch" "on"
EndSection
Section "InputClass"
Identifier "keyboard defaults"
MatchIsKeyboard "on"
Option "XKbOptions" "srvrkeys:none"
EndSection
FreeBSD 11 notebook installation cheat-sheet
============================================
1) Turn off the terrible, annoying console beep:
# sysctl -w hw.syscons.bell=0
# sysctl -w kern.vt.enable_bell=0
2) Make this permanent by editing /etc/sysctl.conf and adding these 2 lines:
hw.syscons.bell=0
kern.vt.enable_bell=0
3) Update the system using "pkg update" (install pkgng if asked to)
4) Install necessary console utilities / system tools:
# pkg install bash screen irssi ncmpc vim mpg123 git tig
5) Install graphical environment and Xorg utilities:
# pkg install xorg xfce xscreensaver audacious audacious-plugins firefox chromium
6) Generate /etc/machine-id
# uuidgen | tr -d "-" > /etc/machine-id
7) Create a minimal ~/.xinitrc file:
setxkbmap de
exec startxfce4
8) Enable psm configuration interface for trackpad/trackpoint:
/boot/loader.conf:
hw.psm.synaptics_support=1
hw.psm.trackpoint_support=1
9) Speed up trackpoint motion:
/etc/sysctl.conf:
hw.psm.trackpoint.sensitivity=240
10) To enable i915 kernel mode setting:
/boot/loader.conf:
i915kms_load="YES"
11) Add your user to the "video" group
12) The following optional settings in sysctl.conf have been proposed:
# Enhance shared memory X11 interface
kern.ipc.shmmax=67108864
kern.ipc.shmall=32768
# Enhance desktop responsiveness under high CPU use (200/224)
kern.sched.preempt_thresh=224
# Bump up maximum number of open files
kern.maxfiles=200000
# Disable PC Speaker
hw.syscons.bell=0
# Shared memory for Chromium
kern.ipc.shm_allow_removed=1
vfs.usermount=1
13) Consider the following in /etc/profile
LC_ALL=en_US.UTF-8; export LC_ALL
CHARSET=UTF-8; export CHARSET
14) Consider the following in /boot/loader.conf
hw.psm.synaptics_support=1
hw.psm.trackpoint_support=1
i915kms_load="YES"
# Devil worship in loader logo
loader_logo="beastie"
# Boot-time kernel tuning
kern.ipc.shmseg=1024
kern.ipc.shmmni=1024
kern.maxproc=100000
# Load MMC/SD card-reader support
mmc_load="YES"
mmcsd_load="YES"
sdhci_load="YES"
# Access ATAPI devices through the CAM subsystem
atapicam_load="YES"
# Filesystems in Userspace
fuse_load="YES"
# Intel Core thermal sensors
coretemp_load="YES"
# AMD K8, K10, K11 thermal sensors
#amdtemp_load="YES"
# In-memory filesystems
tmpfs_load="YES"
# Asynchronous I/O
aio_load="YES"
# Handle Unicode on removable media
libiconv_load="YES"
libmchain_load="YES"
cd9660_iconv_load="YES"
msdosfs_iconv_load="YES"
snd_driver_load="YES"
15) If you want your laptop to suspend on lid close, use the following in /etc/sysctl.conf:
# suspend on lid close
hw.acpi.lid_switch_state=s3
If you want to be able to use the battery widget in KDE, be sure you have hald enabled.
To enable hald, add the following line to /etc/rc.conf:
hald_enable="YES"
# A useful FreeBSD 11 desktop installation guide I found:
https://cooltrainer.org/a-freebsd-desktop-howto/
# Real-Time Audio (DAW) in FreeBSD
A friend of mine wrote a very informative blog post about that topic and allowed me to link there (thanks, Meka!):
http://meka.rs/blog/2017/01/25/sing-beastie-sing/
/etc/fstab
Some programs need linprocfs mounted on /compat/linux/proc. Add the
following line to /etc/fstab:
linprocfs /compat/linux/proc linprocfs rw 0 0
Then run "mount /compat/linux/proc".
Some programs need tmpfs mounted on /compat/linux/dev/shm. Add the
following line to /etc/fstab:
tmpfs /compat/linux/dev/shm tmpfs rw,mode=1777 0 0
Then run "mount /compat/linux/dev/shm".
# cat /boot/loader.conf
# NOTE: the MMC/SSD bit cause kernel panic
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
zfs_load="YES"
kern.vt.fb.default_mode="1440x810"
i915kms_load="YES"
kern.vty="vt"
hw.psm.synaptics_support="1"
hw.psm.trackpoint_support="1"
# Boot-time kernel tuning
kern.ipc.shmseg=1024
kern.ipc.shmmni=1024
kern.maxproc=100000
# Load MMC/SD card-reader support
#mmc_load="YES"
#mmcsd_load="YES"
#sdhci_load="YES"
# Access ATAPI devices through the CAM subsystem
atapicam_load="YES"
# Filesystems in Userspace
fuse_load="YES"
# Intel Core thermal sensors
coretemp_load="YES"
# AMD K8, K10, K11 thermal sensors
#amdtemp_load="YES"
# In-memory filesystems
tmpfs_load="YES"
# Asynchronous I/O
aio_load="YES"
# Handle Unicode on removable media
libiconv_load="YES"
libmchain_load="YES"
cd9660_iconv_load="YES"
msdosfs_iconv_load="YES"
snd_driver_load="YES"
# /usr/local/etc/PolicyKit/PolicyKit.conf
# Allow normal users to mount removable media automatically
<config version="0.1">
<match action="org.freedesktop.hal.storage.mount-removable">
<return result="yes"/>
</match>
<match action="org.freedesktop.hal.storage.mount-fixed">
<return result="yes"/>
</match>
<match user="root">
<return result="yes"/>
</match>
<define_admin_auth group="wheel"/>
</config>
# cat /etc/rc.conf
# NOTE: No more KDE!
clear_tmp_enable="YES"
syslogd_flags="-ss"
sendmail_enable="NONE"
hostname="lisp"
ifconfig_em0="DHCP"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
dbus_enable="YES"
hald_enable="YES"
virtuoso_enable="YES"
virtuoso_config="/usr/local/lib/virtuoso/db/virtuoso.ini"
linux_enable="YES"
bsdstats_enable="NO"
atop_enable="YES"
svnserve_enable="YES"
svnserve_data="/usr/home/svn/repos"
webcamd_enable="YES"
# cat /etc/sysctl.conf
# NOTE: To allow sleep
# $FreeBSD: releng/11.0/etc/sysctl.conf 112200 2003-03-13 18:43:50Z mux $
#
# This file is read when going to multi-user and its contents piped thru
# ``sysctl'' to adjust kernel values. ``man 5 sysctl.conf'' for details.
#
# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
#security.bsd.see_other_uids=0
#compat.linux.osrelease=2.6.32
kern.ipc.shm_allow_removed=1
hw.acpi.lid_switch_state=s3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment