mock patch proposal: unmount everything mounted under chroot

Mike McLean mikem at redhat.com
Tue Mar 16 19:28:43 UTC 2010


On 03/16/2010 02:50 PM, Clark Williams wrote:
> I'm pretty sure that makeChrootPath() was designed to do exactly that
> (return a canonical path for the chroot + element).  If you know
> of a case where it doesn't, that's a bug and we need to fix it.

It doesn't expand symlinks or even fully normalize. For the rest of mock 
that is fine, but when you need to compare paths coming from different 
sources you want something stronger. The kernel is not going to use 
makeChrootPath to populate /proc/mounts ;)

Actually, I realized we probably to use os.path.samefile() to make the 
comparison. This would eliminate the need for realpath. Otoh, it does 
raise an exception if either fails to stat so we'll probably want to 
catch that (granted, such a situation shouldn't really happen).


More information about the buildsys mailing list