aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt/Chroot.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Iurt/Chroot.pm')
-rw-r--r--lib/Iurt/Chroot.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm
index c54b180..9710b0f 100644
--- a/lib/Iurt/Chroot.pm
+++ b/lib/Iurt/Chroot.pm
@@ -49,7 +49,7 @@ sub clean_chroot {
}
-=head2 clean_and_build_chroot($chroot, $chroot_ref, $run, $config)
+=head2 clean_and_build_chroot($chroot, $chroot_ref, $run, $config, $use_netns)
Create or clean a chroot
I<$chroot> chroot path
@@ -60,10 +60,10 @@ Return true.
sub clean_and_build_chroot {
- my ($chroot, $chroot_ref, $run, $config) = @_;
+ my ($chroot, $chroot_ref, $run, $config, $use_netns) = @_;
clean_chroot($chroot, $run, $config) and return 1;
- if (!create_build_chroot($chroot, $chroot_ref, $run, $config)) {
+ if (!create_build_chroot($chroot, $chroot_ref, $run, $config, $use_netns)) {
plog('ERROR', "Failed to create chroot");
return;
}
@@ -188,11 +188,11 @@ sub add_local_user {
}
sub create_temp_chroot {
- my ($run, $config, $chroot_tmp, $chroot_ref) = @_;
+ my ($run, $config, $chroot_tmp, $chroot_ref, $use_netns) = @_;
plog("Install new chroot");
plog('DEBUG', "... in $chroot_tmp");
- clean_and_build_chroot($chroot_tmp, $chroot_ref, $run, $config) or return;
+ clean_and_build_chroot($chroot_tmp, $chroot_ref, $run, $config, $use_netns) or return;
$chroot_tmp;
}
@@ -298,7 +298,7 @@ sub check_chroot_need_update {
}
sub create_build_chroot {
- my ($chroot, $chroot_ref, $run, $config) = @_;
+ my ($chroot, $chroot_ref, $run, $config, $use_netns) = @_;
my $ret = 0;
if ($run->{storage} eq 'btrfs') {
$ret = create_build_chroot_btrfs($chroot, $chroot_ref, $run, $config);
@@ -316,7 +316,7 @@ sub create_build_chroot {
}
}
- if ($ret && $config->{use_netns}) {
+ if ($use_netns) {
sudo($config, '--netns_create', $chroot);
}
return $ret;