This is useful when the uploaded CT does not contain a full OS. When the
autodetection detects an OS, that OS is returned. When it does not
successfully detect a supported OS, but /etc/os-release exists and has an ID
other than 'unmanaged', then the setup fails.
Signed-off-by: Arnout Engelen <arnout@bzzt.net>
return "alpine";
} elsif (-f "$rootdir/etc/gentoo-release") {
return "gentoo";
+ } elsif (-f "$rootdir/etc/os-release") {
+ die "unable to detect OS distribution\n";
+ } else {
+ warn "/etc/os-release file not found and autodetection failed, falling back to 'unmanaged'\n";
+ return "unmanaged";
}
- die "unable to detect OS distribution\n";
};
sub new {
if $type ne $expected_type;
}
+ if ($type eq 'unmanaged') {
+ $conf->{ostype} = $type;
+ return $self;
+ }
+
my $plugin_class = $plugins->{$type} ||
"no such OS type '$type'\n";