From bf49eb540a181114f19c0fc2679436493f10c595 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 2 Nov 2010 21:00:31 +0000 Subject: use iurt_root_command to mount in chroot --- lib/Iurt/Chroot.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index b680c15..e23cf6f 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -91,17 +91,17 @@ sub clean_chroot { plog('ERROR', "Failed to dump macros"); return; } - if (system("$sudo mount none -t proc $chroot/proc")) { + if (!sudo($run, $config, '--bindmount', "/proc", "$chroot/proc")) { plog('ERROR', "Failed to mount proc"); return; } - if (system("$sudo mount none -t devpts $chroot/dev/pts")) { + if (!sudo($run, $config, '--bindmount', "/dev/pts", "$chroot/dev/pts")) { plog('ERROR', "Failed to mount dev/pts"); return; } if ($run->{icecream}) { system("$sudo mkdir -p $chroot/var/cache/icecream"); - if (system("$sudo mount -o bind /var/cache/icecream $chroot/var/cache/icecream")) { + if (!sudo($run, $config, '--bindmount', "/var/cache/icecream", "$chroot/var/cache/icecream")) { plog('ERROR', "Failed to mount var/cache/icecream"); return; } @@ -113,8 +113,8 @@ sub clean_chroot { my $mount_point = "$chroot/urpmi_medias"; my $url = $rep; $url =~ s!^file://!!; - system("$sudo mkdir -p $mount_point"); - if (system("$sudo mount -o bind,ro $url $mount_point")) { + sudo($run, $config, '--mkdir', '-p', $mount_point); + if (!sudo($run, $config, '--bindmount', $url, $mount_point)) { plog('ERROR', "Failed to mount $url on $mount_point"); return; } -- cgit v1.2.1