techne/freebsd.org

81 lines
1.8 KiB
Org Mode

#+title: FreeBSD
** USB 3.1 Type-C to RJ45 Gigabit Ethernet adapter
The [[https://www.amazon.com/dp/B08989MYQ2][Amazon Basics Aluminum USB 3.1 Type-C to RJ45 Gigabit Ethernet Adapter]] works well with FreeBSD 14.1-RELEASE. It uses the *AX88179* chipset from ASIX Electronics Corp.
** Install the ports tree
Source: [[https://docs.freebsd.org/en/books/handbook/ports/#ports-using-installation-methods][Chapter 4. Installing Applications: Packages and Ports | FreeBSD Documentation Portal]]
*** Ensure the FreeBSD source code is checked out
#+BEGIN_SRC shell
sudo git clone -o freebsd -b releng/14.1 https://git.FreeBSD.org/src.git /usr/src
#+END_SRC
*** Check out the ports tree
#+BEGIN_SRC shell
sudo git clone --depth 1 https://git.FreeBSD.org/ports.git -b 2024Q3 /usr/ports
#+END_SRC
To switch to a different quarterly branch:
#+BEGIN_SRC shell
sudo git -C /usr/ports switch 2024Q4
#+END_SRC
** drm-61-kmod
Install from the ports tree.
#+BEGIN_SRC shell
cd /usr/ports/graphics/drm-61-kmod
sudo make install clean
#+END_SRC
Alternatively, for Alderlake GPUs:
#+BEGIN_SRC shell
sudo pkg install drm-kmod
#+END_SRC
Edit ~/etc/rc.conf~:
#+BEGIN_SRC shell
kld_list="i915kms"
#+END_SRC
Add user to ~video~ group:
#+BEGIN_SRC shell
sudo pw groupmod video -m jas
#+END_SRC
** Mount filesystems in single-user mode
When booted into single-user mode.
#+BEGIN_SRC shell
fsck
mount -u /
mount -a -t zfs
zfs mount -a
#+END_SRC
You should now be able to edit files, add/remove packages, etc.
** Mount encrypted zroot in LiveCD
Boot into the LiveCD environment.
#+BEGIN_SRC shell
mkdir /tmp/mnt
geli attach /dev/nda0p4
zpool import -f -R /tmp/mnt zroot
zfs mount zroot/ROOT/default
#+END_SRC
The root directory of the zroot, ~zroot/ROOT/default~, is labeled to not be automounted when imported, hence the need for the last command.