libioc.Pkg module

Abstracts offline FreeBSD/HardenedBSD package installation.

ioc mirrors packages from FreeBSD and HardenedBSD to a local ZFS dataset for each release and ioc datasource. On each use the pkg repository matching to a jails release is mirrored from the quaterly releases. The host downloads wanted packages into this local repository, that is afterwards mounted into the jail (read-only) for package installation.

With this module it is possible to save bandwith and shorten the time required for package installation. In setups that spawn disposable jails, it might be reasonable to seed newly created jails from latest packages, rather than managing a template, that tempts to outdate.

class libioc.Pkg.Pkg(zfs=None, host=None, logger=None)[source]

Bases: object

ioc pkg management utility.

bootstrap(jail, event_scope=None)[source]

Bootstrap pkg within a jail.

Return type

Generator[PkgEvent, None, None]

configure(jail, event_scope=None)[source]

Configure the repositories within the jail.

Return type

Generator[PkgEvent, None, None]

fetch(packages, release, event_scope=None)[source]

Fetch a bunch of packages to the local mirror.

Return type

Generator[PkgEvent, None, None]

fetch_and_install(packages, jail, event_scope=None, postinstall=[])[source]

Mirror and install packages to a jail.

Return type

Generator[PkgEvent, None, None]

install(packages, jail, event_scope=None, postinstall=[])[source]

Install locally mirrored packages to a jail.

Return type

Generator[PkgEvent, None, None]

package_source_directory = '/.ioc-pkg'
remove(packages, jail, event_scope=None)[source]

Remove installed packages from a jail.

Return type

Generator[PkgEvent, None, None]