NAME
App::FuguVM::Miniroot - the OpenBSD miniroot image
SYNOPSIS
use App::FuguVM::Miniroot;
use App::FuguVM::Mirror;
my $mirror = App::FuguVM::Mirror->new(
cache => $proxy->cache,
version => '7.8',
arch => 'arm64',
);
my $image = App::FuguVM::Miniroot->new($cache_dir, $proxy, $mirror);
my $path = $image->ensure
or die $mirror->error, "\n";
DESCRIPTION
An installation boots the miniroot image of its OpenBSD release. The module finds that image in the proxy cache. On a miss the mirror downloads and verifies it, because the miniroot is the boot medium and no code in the guest inspects it before it runs.
The concern of this module is the install media: the file name of a version, and the cached copy. The mirror facts live in App::FuguVM::Mirror: the host, the URL, the download helper, the release key and the verification.
The module does not hold a copy of the cache layout. It asks the cache where a URL lands. A cache that changed that answer would otherwise leave this module looking in the old place, and every run would download the image again.
METHODS
new
App::FuguVM::Miniroot->new($cache_dir, $proxy, $mirror)
The proxy can be undef. The mirror is necessary: it carries the version, the architecture and the verification switch, and a call without it is a programming error.
path, ensure
path returns the cached image, or undef. ensure returns it, and on a miss it calls $mirror->ensure: the mirror proves the release manifest, fetches the image, verifies it, and stores it. On a failure ensure returns undef, the cache holds no image, and the mirror error holds the reason. The mirror is the one home of the version and the architecture, so the methods take no argument.
url
url returns the mirror URL of the image, through $mirror->url, so the mirror host has one home. The path holds the version and the architecture of the mirror: /pub/OpenBSD/<version>/<arch>/miniroot<version>.img. The file name is the same for both architectures; only the path segment differs.
SEE ALSO
App::FuguVM::Mirror, App::FuguVM::Proxy, App::FuguVM::Guest
AUTHOR
Dick Olsson <hi@senzilla.io>