Check for the existence of /etc, use -e as it could also be a symlink
(and it's just a heuristic). But only do so if the expected ostype
from the config does not match the detected one, this normally
indicates that we had a "reals" distro running but detected the
fallback "unmanaged". Only warn though, as a hint for the user.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
$type = &$autodetect_type($self, $rootdir, $os_release);
my $expected_type = $conf->{ostype} || $type;
- warn "got unexpected ostype ($type != $expected_type)\n"
- if $type ne $expected_type;
+ if ($type ne $expected_type) {
+ warn "WARNING: /etc not present in CT, is the rootfs mounted?\n"
+ if ! -e "$rootdir/etc";
+ warn "got unexpected ostype ($type != $expected_type)\n"
+ }
}
if ($type eq 'unmanaged') {