[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#770658: fails to debootstrap debian on fedora: Failure trying to run: chroot /debian mount -t proc proc /proc



Joey Hess <id@joeyh.name> (2014-11-22):
> Package: debootstrap
> Version: 1.0.64
> Severity: normal
> 
> W: Failure trying to run: chroot /debian mount -t proc proc /proc
> 
> This is because mount is in a different location in fedora than in debian.
> On Debian, it's in /bin/mount, while on fedora, /usr/bin/mount.
> 
> And, on fedora, root's default path does not contain /bin:
> 
> [root@alien /]# echo $PATH
> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
> 
> So, chroot tries each of those directories, does not find mount in them
> in the debian chroot, and fails.
> 
> Suggested fix: Before chrooting into the debootstrapped chroot to run
> commands, debootstrap should ensure that the PATH includes all
> directories it does on a standard debian system. Eg:
> 
> PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
> 
> This way, the host system's chroot etc will still be found whereever
> it's PATH has them, and the debian system's commands will likewise be
> found.

I see two naive approaches here: append said $PATH unconditionally, or
walk through each component and only append those who aren't in $PATH
already. Not sure how reliable it would be to split current $PATH
using ':' as a separator, in case there are some funnily-named,
maybe-quoted directories in there. I'm happy to receive hints here.

Mraw,
KiBi.

Attachment: signature.asc
Description: Digital signature


Reply to: