Blacklisting packages

With the advent of package management and hrev46391, it has become possible to prevent a packaged file from being extracted at boot time.

In Haiku's boot menu, there is a 'Blacklist entries' option available. However, this method will only let you disable system packages, and only until the next time you reboot.

As you may know, package management has made some Haiku directories read-only, so unlike in the past, it is no longer possible to just delete or rename a problematic driver or library. The blacklisting functionality addresses this issue without requiring any editing of package file content.

So let's go through the few steps needed:

  1. Figure out which file in which package you want to blacklist, and whether the file is contained in a system package or in a user one.
  2. Next step is to create a text file named 'packages' in /boot/system/settings, or in /boot/home/config/settings/global. The first directory is used for blacklisting system packages, the second for user packages.
  3. And finally, in the 'packages' file, we put something like:
    Package 'packagename' {
    	EntryBlacklist {
    		'entrypath'
    		...
    	}
    }
    
    For example, to blacklist the intel_extreme driver and the xhci driver, which are both part of the 'haiku' system package, the 'packages' file looks like this:
    Package haiku  {
    	EntryBlacklist {
    		add-ons/kernel/drivers/bin/intel_extreme
    		add-ons/kernel/busses/usb/xhci
    	}
    }
    
    • 'packagename' is the name of the package without version, for example 'haiku'.
    • 'entrypath' is the relative path to the installation location, e.g. "add-ons/Translators/FooTranslator".

Any blacklisted entries will be ignored by packagefs and will no longer appear in the file system.

Example

Let's look at a practical example, blacklisting the broadcom570x driver. We create a 'packages' text file in /boot/system/settings with the following content:

Package haiku {
	EntryBlacklist {
		add-ons/kernel/drivers/bin/broadcom570x
	}
}

We then save the file and reboot. Once Haiku starts again, the package is re-mounted and the file is ignored by packagefs.



Originally published by Barrett.