pkg_preinst
| Function | pkg_preinst |
|---|---|
| Purpose | Called before image is installed to ${ROOT}
|
| Sandbox | Disabled |
| Privilege | root |
| Called for | ebuild, binary |
Common pkg_preinst tasks
There are a few things that are often done in pkg_preinst:
-
Adding users and groups. However, since
pkg_preinstmay be called aftersrc_compile,pkg_setupis the more suitable location for user creation — see Users and groups. -
Modifying the install image for a particular system. This function
allows system-specific customisation to be done even when installing
from a binary. The most useful example is probably smart
configuration file updating — a
pkg_preinstcould check a configuration file in${ROOT}/etc/and create a smart updated version in${D}/etc/(see Install destinations) rather than always trying to install the default configuration file (remember Configuration file protection).