Create a bootable installation USB stick from FreeBSD.org. Install the disk by:
OS | Command |
---|---|
MacOS | sudo dd if=FreeBSD-12.2-RELEASE-amd64-memstick.img of=/dev/diskX bs=4m |
Linux | sudo dd if=FreeBSD-12.2-RELEASE-amd64-memstick.img of=/dev/sdX bs=4=M |
The best solution is using ZFS. Downside, it will take your whole disk. Encrypt your disk and swap file.
Add the users:
adduser
pkg install bash htop pstree tree
svnlite checkout https://svn.freebsd.org/base/release/12.2.0 /usr/src
pkg install xorg xfce
pkg install chinese/arphicttf chinese/font-std hebrew/culmus hebrew/elmar-fonts japanese/font-ipa japanese/font-ipa-uigothic japanese/font-ipaex japanese/font-kochi japanese/font-migmix japanese/font-migu japanese/font-mona-ipa japanese/font-motoya-al japanese/font-mplus-ipa japanese/font-sazanami japanese/font-shinonome japanese/font-takao japanese/font-ume japanese/font-vlgothic x11-fonts/hanazono-fonts-ttf japanese/font-mikachan korean/aleefonts-ttf korean/nanumfonts-ttf korean/unfonts-core x11-fonts/anonymous-pro x11-fonts/artwiz-aleczapka x11-fonts/dejavu x11-fonts/inconsolata-ttf x11-fonts/terminus-font x11-fonts/cantarell-fonts x11-fonts/droid-fonts-ttf x11-fonts/doulos x11-fonts/ubuntu-font x11-fonts/isabella x11-fonts/junicode x11-fonts/khmeros x11-fonts/padauk x11-fonts/stix-fonts x11-fonts/charis x11-fonts/urwfonts-ttf russian/koi8r-ps x11-fonts/geminifonts x11-fonts/cyr-rfx x11-fonts/paratype x11-fonts/gentium-plus
The following is probably outdated and made for FreeBSD version 12. It contains the changed files in the ports tree to get version 460 of the NVidia drivers working. This can be seen as a reference as how to update to a newer version of drivers.
distinfo:
SHA256 (NVIDIA-FreeBSD-x86_64-460.27.04.tar.gz) = b9c0e676b5e66569d2f71a25ab1e782bb8a52cbcb3e413e854b72debc37b6623
SIZE (NVIDIA-FreeBSD-x86_64-460.27.04.tar.gz) = 103234112
Makefile:
-DISTVERSION?= 440.100
+DISTVERSION?= 460.27.04
-SUB_PATCHES= extra-patch-src-Makefile \
- extra-patch-src-nv-freebsd.h \
- extra-patch-src-nv-misc.h \
- extra-patch-src-nvidia_ctl.c \
- extra-patch-src-nvidia_dev.c \
- extra-patch-src-nvidia_linux.c \
- extra-patch-src-nvidia_pci.c
-.if ${NVVERSION} >= 358.009
-# Initialize memory allocations to avoid spurious "lock re-initialization"
-# errors. A little more detail can be found in bug 201340 starting around
-# comment #50.
-EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src_nvidia-modeset_nvidia-modeset-freebsd.c
-.endif
remove some includes (??)
In /boot/loader.conf
:
nvidia-modeset_load="YES"
pkg install nvidia-xconfig nvidia-settings
nvidia-xconfig
distinfo:
SHA256 (NVIDIA-Linux-x86_64-460.27.04.run) = a654eab5ce50650c0cd1fdcc78c655d0de573a2b925c20839252ffab2cbc1ccf
SIZE (NVIDIA-Linux-x86_64-460.27.04.run) = 171853284
99a100
> libnvidia-fatbinaryloader.so.${PORTVERSION} \
109a111
> libnvidia-fatbinaryloader.so.${PORTVERSION} \
119a122
> '\,${LINUXBASE}.*libnvidia-fatbinaryloader\.so,d' \
122,126c125
< .if ${NVVERSION} >= 460.027
< LINUX_LIBS+= libnvidia-egl-wayland.so.1.1.5
< LINUX_LINKS+= libnvidia-egl-wayland.so.1.1.5 libnvidia-egl-wayland.so.1
< PLIST_RE+= '\,${LINUXBASE},s/(libnvidia-egl-wayland\.so)\.X/\1.1.1.5/'
< .elif ${NVVERSION} >= 440.026
---
> .if ${NVVERSION} >= 440.026
pkg-plist:
50a51
> %%LINUX32%%%%LINUXBASE%%/usr/lib/libnvidia-fatbinaryloader.so.%%SHLIB_VERSION%%
120a122
> %%LINUXBASE%%%%LINUX_LIBDIR%%/libnvidia-fatbinaryloader.so.%%SHLIB_VERSION%%
Section "Device"
Identifier "Card0"
Driver "nvidia"
# BusID "PCI:0:8:0:0"
EndSection
Section "Module"
Load "freetype"
Load "bitmap"
Load "type1"
Load "glx"
EndSection
In /etc/rc.conf
:
dbus_enable="YES"
hald_enable="YES"
pkg install xscreensaver xdg-user-dirs redshift xrandr
In ~/.config/user-dirs.dirs
:
XDG_DESKTOP_DIR="$HOME/desktop"
XDG_DOWNLOAD_DIR="$HOME/downloads"
XDG_TEMPLATES_DIR="$HOME/templates"
XDG_PUBLICSHARE_DIR="$HOME/public"
XDG_DOCUMENTS_DIR="$HOME/documents"
XDG_MUSIC_DIR="$HOME/music"
XDG_PICTURES_DIR="$HOME/pictures"
XDG_VIDEOS_DIR="$HOME/videos"
In ~/.config/redshift.conf
:
[redshift]
temp-day=5700
temp-night=3600
gamma=0.8
adjustment-method=randr
location-provider=manual
[manual]
lat=52.1
lon=5.2
In ~/.xinitrc
xscreensaver -no-splash &
xdg-user-dirs-update &
redshift &
exec startxfce4
In /boot/loader.conf
:
snd_driver_load="YES"
Or load it by hand:
kldload snd_driver
Rearange your mixer to one usable Get the information. Look in your dmesg.
sysctl dev.hdac.0.pindump=1
sysctl dev.hdac.1.pindump=1
dmesg |grep hdaa
See device.hints(5) and snd_hda for more information. Long story short, as is the group of devices, seq is the sequence. An as of 0 is disable this device. A seq of 15 will override the 0.
In /boot/device.hints
:
hint.hdac.0.cad0.nid4.config="as=0"
hint.hdac.0.cad0.nid5.config="as=0"
hint.hdac.0.cad0.nid6.config="as=0"
hint.hdac.0.cad0.nid7.config="as=0"
hint.hdac.1.cad0.nid17.config="as=0"
hint.hdac.1.cad0.nid20.config="as=1 seq=0"
hint.hdac.1.cad0.nid22.config="as=1 seq=1"
hint.hdac.1.cad0.nid21.config="as=1 seq=2"
hint.hdac.1.cad0.nid27.config="as=1 seq=15"
hint.hdac.1.cad0.nid24.config="as=2 seq=0"
hint.hdac.1.cad0.nid26.config="as=2 seq=1"
hint.hdac.1.cad0.nid25.config="as=2 seq=15"
hint.hdac.1.cad0.nid30.config="as=0"
To change your default output: /etc/sysctl.conf
hw.snd.default_unit=0
reboot. (Thanks BSDForum.)
Suspend to memory is supported on FreeBSD. Suspend to disk isn't... You can test if your suspend to memory works by running as root:
acpiconf -s 3
If that works, your suspend is going to work. You can change what to do in /etc/rc.suspend
and /etc/rc.resume
. To start your suspension as a user, you have to be of the operator group.
pw group mod operator -m youruser
Now you can use zzz
to suspend your system.
To also get it working within your XFCE, install polkit (pkg install polkit
) and make a new file /usr/local/etc/polkit-1/rules.d/85-suspend.rules
:
polkit.addRule(function (action, subject) {
if ((action.id == "org.freedesktop.consolekit.system.restart" ||
action.id == "org.freedesktop.consolekit.system.stop")
&& subject.isInGroup("operator")) {
return polkit.Result.YES;
}
});
// For those who have working suspend/resume:
polkit.addRule(function (action, subject) {
if (action.id == "org.freedesktop.consolekit.system.suspend"
&& subject.isInGroup("operator")) {
return polkit.Result.YES;
}
});
// Explicitly disallow hibernation because it's not supported by the OS.
polkit.addRule(function (action, subject) {
if (action.id == "org.freedesktop.consolekit.system.hibernate") {
return polkit.Result.NO;
}
});
Install bash and the autocomplete
pkg install bash bash-completion
Add in your ~/.bashrc
:
if ! shopt -oq posix; then
if [ -f /usr/local/share/bash-completion/bash_completion.sh ]; then
. /usr/local/share/bash-completion/bash_completion.sh
fi
fi
In /boot/loader.conf
:
smbfs_load="YES"
Or load it by hand:
kldload smbfs
Change in /etc/fstab
:
# SMB
//username@server/home /home/luser/documents smbfs rw,late 0 0
And for the credentials change in /etc/nsmbrc
(Hostname, username and share has to be in CAPITALS)
[SERVER:USERNAME]
password=your_password
Change in /boot/loader.conf
:
amdtemp_load="YES"
Or load it by hand:
kldload amdtemp
pkg install hwstat
pkg install yubioath-desktop yubikey-personalization-gui yubikey-manager-qt
Change in /etc/rc.conf
:
pcscd_enable="YES"
Add the user to the u2f group:
pw group mod u2f -m <user>
And restart the services:
service devd restart
service pcscd start
U2F should work now, for example github. Also the tools for configuration will work.
Keep in mind that for the proper use of U2F/FIDO/WebAuth, WebRTC is needed. If you block WebRTC in your browser, U2F will not work!
pkg install opensc
ssh-add -s /usr/local/lib/opensc-pkcs11.so
First, check if your virtualisation is enabled in your BIOS. Mine wasn't (Gighabyte and AMD).
Install packages:
pkg install vm-bhyve grub2-bhyve
zfs create -o mountpoint=/vm pool/vm
Change in /etc/rc.conf
:
vm_enable="YES"
vm_dir="zfs:freggel/vm"
vm init
cp /usr/local/share/examples/vm-bhyve/* /vm/.templates/
vm switch create public
vm switch add public igb0
Create a debian VM:
vm create -t debian vmname
vm iso https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.7.0-amd64-netinst.iso
vm install vmname debian-10.7.0-amd64-netinst.iso
vm console vmname