Date: Sat, 26 Sep 2015 13:44:33 +0200 From: Alexander Leidinger <Alexander@leidinger.net> To: freebsd-emulation@freebsd.org Subject: Re: /dev for Linux binaries in freebsd Message-ID: <20150926134433.Horde.dywx79dLiTk9Z_UmyvgIU7-@webmail.leidinger.net> In-Reply-To: <20150924195443.1805e50d@Papi>
next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Mario Lobo <lobo@bsd.com.br> (from Thu, 24 Sep 2015 19:54:43 -0300): > I was trying to find out where a linux binary will look for the /dev > directory. > > I tried to link the device I need to /compat/linux/dev but that didn't > work. This is expected. Do not create links to the real /dev there, you will create a loop (see below). > How can a linux binary see the devices (serial ports, usb, etc) of the > system? The behavior under the assumption that you haven't chrooted into /compat/linux is: A linux program will ask the kernel for /dev/xyz. The kernel knows that it is a linux program, and as such it will first look for /compat/linux/dev/xyz. If the kernel doesn't find the device there, it will look for /dev/xyz. As such you should not touch /compat/linux/dev at all, it will "fall-through" to the real /dev. Maybe your real problem is not that you can't access the right /dev/ entry, but that the devide doesn't understand what the linux program wants to do. You can use ktrace or dtrace to check what the program tries to do. You should see in the output what the real patch is it tries to reach and what kind or errno it get's when it tries to access it. If you chroot into /compat/linux, you need to mount devfs in additionally to /compat/linux/dev. Bye, Alexander. -- http://www.Leidinger.net Alexander@Leidinger.net: PGP 0xC773696B3BAC17DC http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0xC773696B3BAC17DC
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150926134433.Horde.dywx79dLiTk9Z_UmyvgIU7->