From owner-freebsd-emulation Sat Mar 22 5:32:27 2003 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 77B0537B401 for ; Sat, 22 Mar 2003 05:32:25 -0800 (PST) Received: from atlantis.homeip.net (d102207.upc-d.chello.nl [213.46.102.207]) by mx1.FreeBSD.org (Postfix) with SMTP id 85F4143F85 for ; Sat, 22 Mar 2003 05:32:23 -0800 (PST) (envelope-from wvengen@stack.nl) Received: (qmail 44127 invoked from network); 22 Mar 2003 13:32:22 -0000 Received: from moses.ourhome.nl (192.168.1.2) by atlantis.ourhome.nl with SMTP; 22 Mar 2003 13:32:22 -0000 Subject: Re: Chrooting to Linux in FreeBSD From: Willem van Engen To: Tim van den Elsen Cc: freebsd-emulation@freebsd.org In-Reply-To: <20030314232826.15a44630.timmie@timmie.dyndns.org> References: <20030314232826.15a44630.timmie@timmie.dyndns.org> Content-Type: text/plain Organization: Message-Id: <1048339973.2663.59.camel@moses.ourhome.nl> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 22 Mar 2003 14:32:54 +0100 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, there are two things I should do. First: find remaster-dir -type f -exec brandelf -t Linux {} \; FreeBSD needs to know what ABI the binary wants, it's stored in the ELF header. The binaries might be executed as native FreeBSD ones. ls seems to work, so either something else is wrong, or several linux system call numbers are the same as on FreeBSD. But I'd try the above find command. Secondly, to make sure shellscripts will run correctly in the chroot evironment, I'd use /usr/compat/linux/bin/sh, or maybe even better remaster-dir/bin/sh as the chroot shell. Linux has bash as bin/sh and some scripts rely on that. You don't have that problem yet, but it might save you some trouble later :) I hope this helps. - Willem On Fri, 2003-03-14 at 23:28, Tim van den Elsen wrote: > Hello, > > A friend of mine started his own version of Knoppix. His version is modular based and looks quite nice. For me to help him mount an .iso and chroot to this "pre-made filesystem" (Debian by the way). > > For mounting i do the following: > > # vnconfig /dev/vn0c ./image.iso > # mount_cd9660 /dev/vn0c ./tmp-iso-dir > > Then i copy the ./tmp-iso-dir to a normal dir in order to change files: > > # cp -Rp ./tmp-iso-dir/ ./remaster-dir > > After that i'm ready to chroot: > # chroot ./remaster-dir /bin/sh > sh-2.05b# > > Then the problem starts: every command i run when i'm in chroot will leave a .core file although most of them work. An example: > > sletje# chroot tmp-iso /bin/sh > sh-2.05b# ls > MorphixCD boot dev floppy initrd mnt opt root strip-apt usr > bin cdrom etc home lib morphix proc sbin tmp var > sh-2.05b# id > uid=0(root) gid=0(root) groups=0(root),2(bin),3(sys),4(adm),5(tty),20(dialout),31 > sh-2.05b# ls > MorphixCD boot dev floppy id.core lib mnt opt root strip-apt usr > bin cdrom etc home initrd ls.core morphix proc sbin tmp var > sh-2.05b# exit > exit > Bad system call (core dumped) > sletje# > > As you can see "ls" and "id" work, but both leave a .core file: ls.core and id.core. > When debugging it with gdb all commands seem to exit on a signal 12 Bad system call, like bash did when it exited. > > I tried to google but i can't find no hint or solution to the problem. Hopefully somebody here has a clue of what's going on :-) > > Thanks in advance! > > Tim van den Elsen > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-emulation" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message