poudriere-hooks

Poudriere hooks
Login

Poudriere hooks

These are hooks for mounting ISO images or external directories into a poudriere jail for building packages that rely upon data that is not easily fetched.

common.sh is where all the logic resides for mounting and unmounting into jails. To function correctly, jail.sh and builder.sh are both needed to mount under the master and builder jails, respectively. Typically, the reference jail is cloned by poudriere for each builder but these are nullfs mounts and are not cloned.

Mount types

These hooks support two types of sources:

Both are configured by settings within a poudriere.conf file.

ISO images

To maintain ports that require game data, it is usually necessary to mount the actual CD or DVD and set CDROM_MOUNT for the port prior to building. This can be a lot of work switching between the discs as well as wear-and-tear on the discs. It is even more of a hassle when doing this in poudriere where the user would have to run each build individually to allow for switching the discs.

With the ISO hook, only a few steps are needed:

  .if ${.CURDIR:M*/games/linux-nwnclient} || ${.CURDIR:M*/games/nwndata}
  CDROM_MOUNT=    /media/NWN-diamond.iso
  .endif
  .if ${.CURDIR:M*/games/linux-ssamtse}
  CDROM_MOUNT=    /media/SSAM-TSE.iso
  .endif
  .if ${.CURDIR:M*/games/linux-ut}
  CDROM_MOUNT=    /media/UT.iso
  .endif

  ISO_MOUNT_SETS="/usr/ports/distfiles/ISO/NWN-diamond.iso"
  ISO_MOUNT_SETS="${ISO_MOUNT_SETS} /usr/ports/distfiles/ISO/SSAM-TSE.iso"
  ISO_MOUNT_SETS="${ISO_MOUNT_SETS} /usr/ports/distfiles/ISO/UT.iso"
  export ISO_MOUNT_SETS

nullfs mounts

There may be times when an external path located on the file system is needed within the jail. One example is when building with poudriere using a branch URL that uses the file:// scheme.

With the nullfs hook, it is very easy to configure:

  NULL_MOUNT_SETS="/usr/local/poudriere/data/packages/fbsd14-default-base"
  export NULL_MOUNT_SETS