Skip to content
Snippets Groups Projects
Unverified Commit c4853269 authored by boklm's avatar boklm
Browse files

Bug 40043: container: add rbm to /etc/hosts by default

parent e93302bd
Branches
Tags
No related merge requests found
......@@ -96,6 +96,8 @@ sub run_chroot {
local $File::Copy::Recursive::CopyLink = 0;
fcopy('/etc/resolv.conf', "$rootfsdir/etc/resolv.conf");
local %ENV = ();
path("$rootfsdir/etc/hosts")->append("\n127.0.1.1 rbm\n")
unless grep { m/^127.0.1.1 rbm$/ } path("$rootfsdir/etc/hosts")->lines;
system('hostname', 'rbm');
my $res = system('/usr/sbin/chroot', $rootfsdir, @$cmd);
do_unmounts($rootfsdir);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment