Differences between revisions 1 and 30 (spanning 29 versions)
Revision 1 as of 2020-12-19 10:54:27
Size: 466
Editor: Sciuro
Comment:
Revision 30 as of 2020-12-22 23:11:30
Size: 8011
Editor: Sciuro
Comment:
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
= Installation =
== Boot disk ==
Create a bootable installation USB stick from [[https://www.freebsd.org/where.html|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}}} ||

== Disks ==
The best solution is using ZFS. Downside, it will take your whole disk. Encrypt your disk and swap file.
Line 9: Line 20:
== Users ==
Add the users:

== General packages ==
{{{
pkg install bash htop pstree tree
}}}
Line 10: Line 29:
``` {{{
Line 12: Line 31:
``` }}}

== Window manager ==
{{{
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
}}}
Line 15: Line 40:
Updated the ports === Updated the ports ===
==== nvidia-driver ====
Line 17: Line 43:
``` {{{
Line 20: Line 46:
``` }}}
Line 22: Line 49:
{{{
-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

}}}
Line 23: Line 71:

In ''/boot/loader.conf'':
{{{
nvidia-modeset_load="YES"
}}}

{{{
pkg install nvidia-xconfig nvidia-settings
}}}

run nvidia-xconfig

==== linix--nvidia-libs ====
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%%
}}}
== Xorg ==
{{{
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"
}}}

=== Login manager ===
{{{
pkg install slim
pkg install slim-themes slim-freebsd-themes slim-freebsd-dark-theme slim-freebsd-black-theme slim-freebsd-themes
}}}

In ''/etc/rc.conf'':
{{{
slim_enable="YES"
}}}

=== XFCE ===
{{{
pkg install xscreensaver xdg-user-dirs redshift xrandr
}}}

.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"
}}}

.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
}}}

{{{
xscreensaver -no-splash &
xdg-user-dirs-update &
redshift &
exec startxfce4
}}}

== Audio ==
/boot/loader.conf
{{{
snd_driver_load="YES"
}}}

{{{
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 [[https://www.freebsd.org/cgi/man.cgi?query=device.hints|device.hints(5)]] and [[https://www.freebsd.org/cgi/man.cgi?query=snd_hda|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.

/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"
}}}

change your default output:
/etc/sysctl.conf
{{{
hw.snd.default_unit=0
}}}

reboot. (Thanks [[https://forums.freebsd.org/threads/speaker-mic-on-different-sound-devices-need-to-modify-pins.74983/|BSDForum]].

== Windows shares ==
/boot/loader.conf
{{{
smbfs_load="YES"
}}}

{{{
kldload smbfs
}}}

/etc/fstab
{{{
# SMB
//username@server/home /home/luser/documents smbfs rw,late 0 0
}}}

/etc/nsmbrc (Hostname, username and share has to be in CAPITALS)
{{{
[SERVER:USERNAME]
password=your_password
}}}

== Sensors ==
/boot/loader.conf
{{{
amdtemp_load="YES"
}}}

{{{
kldload amdtemp
}}}

{{{
pkg install hwstat
}}}

== Yubikey/U2F ==
{{{
pkg install yubioath-desktop yubikey-personalization-gui yubikey-manager-qt
}}}

In ''/etc/rc.conf'':
{{{
pcscd_enable="YES"
}}}

{{{
service devd restart
service pcscd start
pw group mod u2f -m <user>
exit
}}}

U2F should work now, for example github. Also the tools for configuration will work.

== Linux compat ==
/boot/loader.conf
{{{
linux64_load="YES"
}}}

{{{
kldload linux64
}}}

{{{
pkg install emulators/linux_base-c7
}}}

/etc/fstab
{{{
# Linux compat
linprocfs /compat/linux/proc linprocfs rw 0 0
linsysfs /compat/linux/sys linsysfs rw 0 0
tmpfs /compat/linux/dev/shm tmpfs rw,mode=1777 0 0
}}}

{{{ mount -a }}}

== wine ==

{{{
pkg install wine wine-mono
}}}

== BHyve ==
Install packages
{{{
pkg install vm-bhyve grub2-bhyve
zfs create -o mountpoint=/vm pool/vm
}}}

in /etc/rc.conf
{{{
vm_enable="YES"
vm_dir="zfs:freggel/vm"
}}}

{{{
vm init
cp /usr/local/share/examples/vm-bhyve/* /vm/.templates/
}}}

Description

Installation

Boot disk

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

Disks

The best solution is using ZFS. Downside, it will take your whole disk. Encrypt your disk and swap file.

Configuration

Users

Add the users:

General packages

pkg install bash htop pstree tree

Kernel

svnlite checkout https://svn.freebsd.org/base/release/12.2.0 /usr/src

Window manager

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

NVIDIA

Updated the ports

nvidia-driver

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

removed some includes

In /boot/loader.conf:

nvidia-modeset_load="YES"

pkg install nvidia-xconfig nvidia-settings

run nvidia-xconfig

linix--nvidia-libs

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%%

Xorg

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"

Login manager

pkg install slim
pkg install slim-themes slim-freebsd-themes slim-freebsd-dark-theme slim-freebsd-black-theme slim-freebsd-themes

In /etc/rc.conf:

slim_enable="YES"

XFCE

pkg install xscreensaver xdg-user-dirs redshift xrandr

.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"

.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

xscreensaver -no-splash &
xdg-user-dirs-update &
redshift &
exec startxfce4

Audio

/boot/loader.conf

snd_driver_load="YES"

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.

/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"

change your default output: /etc/sysctl.conf

hw.snd.default_unit=0

reboot. (Thanks BSDForum.

Windows shares

/boot/loader.conf

smbfs_load="YES"

kldload smbfs

/etc/fstab

# SMB
//username@server/home  /home/luser/documents     smbfs  rw,late 0   0

/etc/nsmbrc (Hostname, username and share has to be in CAPITALS)

[SERVER:USERNAME]
password=your_password

Sensors

/boot/loader.conf

amdtemp_load="YES"

kldload amdtemp

pkg install hwstat

Yubikey/U2F

pkg install yubioath-desktop yubikey-personalization-gui yubikey-manager-qt

In /etc/rc.conf:

pcscd_enable="YES"

service devd restart
service pcscd start
pw group mod u2f -m <user>
exit

U2F should work now, for example github. Also the tools for configuration will work.

Linux compat

/boot/loader.conf

linux64_load="YES"

kldload linux64

pkg install emulators/linux_base-c7

/etc/fstab

# Linux compat
linprocfs   /compat/linux/proc  linprocfs       rw      0       0
linsysfs    /compat/linux/sys   linsysfs        rw      0       0
tmpfs    /compat/linux/dev/shm  tmpfs   rw,mode=1777    0       0

 mount -a 

wine

pkg install wine wine-mono

BHyve

Install packages

pkg install vm-bhyve grub2-bhyve
zfs create -o mountpoint=/vm pool/vm

in /etc/rc.conf

vm_enable="YES"
vm_dir="zfs:freggel/vm"

vm init
cp /usr/local/share/examples/vm-bhyve/* /vm/.templates/

Howto/FreeBSDDesktop (last edited 2021-03-06 07:39:03 by Sciuro)