RBM's chroot fails in Fedora
Line 98 in file container
causes RBM's chroot to fail when building the Tor Browser on Fedora (39). The build fails during the first call to copy_file_to
, due to the chown
command not being found inside the chroot. In turn, this happens because of the clearing of $PATH
implicit in line 98. Neither Debian nor on Ubuntu show this behavior.
While changing chown
to /usr/bin/chown
on line 113 fixes copy_file_to
, a better fix is to re-set $PATH
after clearing the environment:
fcopy('/etc/resolv.conf', "$rootfsdir/etc/resolv.conf");
local %ENV = ();
+ local $ENV{"PATH"} = "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin";
path("$rootfsdir/etc/hosts")->append("\n127.0.1.1 rbm\n")
unless grep { m/^127.0.1.1 rbm$/ } path("$rootfsdir/etc/hosts")->lines;
Of course, /usr/local/bin
and /usr/local/sbin
are probably superfluous.