Advanced BSD Tutorial: Protect Critical Firmware on GhostBSD

This tutorial is a guide based on my personal hardware setup, a Dell Precision workstation with a 10th generation Intel CPU and built-in graphics. If your hardware differs, especially if you use AMD GPUs, Wi-Fi, or Bluetooth devices, your required firmware packages will vary.

The purpose of this guide is to warn new BSD users about the risks of blindly accepting all package removals when running pkg autoremove. Doing so can accidentally remove critical system components and render your system unbootable.

Always review the packages being removed carefully and understand your system’s hardware dependencies before confirming any automated cleanup. With that out of of way, let’s take a closer look at the situation.

Background: Firmware Removal After Backup Snapshot

After creating a backup snapshot using BackupStation, I proceeded to remove most firmware packages that my Dell workstation does not need. Since my workstation uses a 10th generation Intel CPU with built-in graphics and does not have an AMD graphics card, Wi-Fi, or Bluetooth, those related firmware packages were unnecessary and safe to remove.

Why Careful Use of pkg autoremove Matters

The pkg autoremove command is designed to clean up packages that were installed as dependencies but are no longer required. However, blindly accepting all removals by simply pressing y can cause serious issues.

Many critical components, such as kernel modules and firmware needed for graphics and system stability, may be removed unintentionally. This can break your system, prevent it from booting, and make recovery difficult or impossible.

Firmware
Software embedded in hardware devices that enables them to function and communicate with the operating system. It’s essential for booting, stability, and hardware compatibility. Removing needed firmware packages can cause devices to malfunction or prevent the system from starting.

Protecting Essential Firmware on a 10th Gen Intel Dell Workstation

To prevent removal of the remaining necessary firmware packages after cleanup, I issued the following commands to mark them as explicitly installed. This ensures that pkg autoremove will not remove them accidentally:

sudo pkg set -A 0 drm-61-kmod
sudo pkg set -A 0 gpu-firmware-intel-kmod-icelake
sudo pkg set -A 0 gpu-firmware-intel-kmod-kabylake
sudo pkg set -A 0 gpu-firmware-intel-kmod-skylake

After marking the packages, I confirmed their status using this command:

pkg query '%n %a' drm-61-kmod gpu-firmware-intel-kmod-icelake gpu-firmware-intel-kmod-kabylake gpu-firmware-intel-kmod-skylake

The output should be 0 after each package name, indicating that the packages are explicitly installed and protected from automatic removal.

This procedure is intended for advanced users familiar with package management and system internals. Improper removal or modification of system packages can lead to an unbootable system.


Pro Tip

How to Identify Packages That May Be Removed by pkg autoremove

When you install software on GhostBSD, some packages are added automatically as dependencies. These are marked with a special flag that tells the system they weren’t installed manually. If they’re no longer needed, pkg autoremove may suggest removing them.

To see which packages are flagged this way, run:

pkg query '%n %a' | awk '$2 == 1'

This command lists all packages that were installed automatically and are considered candidates for removal. If any of these are still essential for your system, you should mark them as explicitly installed to protect them.

Leave a Reply

Your email address will not be published. Required fields are marked *