From owner-freebsd-questions@FreeBSD.ORG Tue Sep 30 19:14:25 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D127106568D for ; Tue, 30 Sep 2008 19:14:25 +0000 (UTC) (envelope-from zozo@q.gid0.org) Received: from postfix2-g20.free.fr (postfix2-g20.free.fr [212.27.60.43]) by mx1.freebsd.org (Postfix) with ESMTP id 822EE8FC13 for ; Tue, 30 Sep 2008 19:14:24 +0000 (UTC) (envelope-from zozo@q.gid0.org) Received: from smtp3-g19.free.fr (smtp3-g19.free.fr [212.27.42.29]) by postfix2-g20.free.fr (Postfix) with ESMTP id 42ACB2AA4B04 for ; Tue, 30 Sep 2008 18:44:06 +0200 (CEST) Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id 2C44417B5E8 for ; Tue, 30 Sep 2008 20:44:22 +0200 (CEST) Received: from q.gid0.org (s.gid0.org [88.163.116.140]) by smtp3-g19.free.fr (Postfix) with ESMTP id EF83F17B616 for ; Tue, 30 Sep 2008 20:44:05 +0200 (CEST) Received: (from zozo@localhost) by q.gid0.org (8.14.3/8.14.3/Submit) id m8UIi2SP023864 for questions@freebsd.org; Tue, 30 Sep 2008 20:44:02 +0200 (CEST) (envelope-from zozo) Date: Tue, 30 Sep 2008 20:44:02 +0200 From: Olivier Smedts To: questions@freebsd.org Message-ID: <20080930184401.GA23783@q.gid0.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Subject: chrooting in a 32-bit world from a 64-bit kernel+world X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2008 19:14:25 -0000 Hello hackers, I'm trying to cross-compile an i386 FreeBSD system (kernel+world+ports) under my amd64 host : % uname -srm FreeBSD 8.0-CURRENT amd64 I updated my CURRENT sources yesterday. So far I've got a working FreeBSD (kernel+world) in a 512MB image I can dump on a CompactFlash card : # cd /usr/src # make buildworld TARGET=i386 # make buildkernel TARGET=i386 # mount /dev/md0a /mnt (md0 is a 512MB file backed image I bsdlabel'd and newfs'd before) # make installworld TARGET=i386 DESTDIR=/mnt # make distribution TARGET=i386 DESTDIR=/mnt # make installkernel TARGET=i386 DESTDIR=/mnt The problem is that I can't chroot in this 32-bit world. Say I want to install the sysutils/screen port in /mnt : # mkdir /mnt/usr/ports # mount -t nullfs /usr/ports /mnt/usr/ports # mount -t devfs devfs /mnt/dev # chroot /mnt /bin/sh -c "cd /usr/ports/sysutils/screen && make BATCH=yes \ install clean" ELF interpreter /libexec/ld-elf.so.1 not found Abort trap Of course it's the same with the new (new since a year or so) ports DESTDIR since it's based on chroot : # cd /usr/ports/sysutils/screen # make DESTDIR=/mnt install clean ===> Creating some important subdirectories ===> Starting chrooted make in /mnt... ELF interpreter /libexec/ld-elf.so.1 not found Abort trap ===> Chrooted make in /mnt failed ===> Cleaning up... I can directly execute /mnt/bin/sh or any program in /mnt without problems. As expected, file gives me : /libexec/ld-elf.so.1: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), stripped /mnt/libexec/ld-elf.so.1: ELF 32-bit LSB shared object, Intel 80386, version 1 (FreeBSD), dynamically linked, stripped Host kernel with COMPAT_IA32 and world without WITHOUT_LIB32 didn't help. I tried temporarily replacing /mnt/libexec/ld-elf.so.1 with the 64-bit one, but the same problem occurs. Using ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-current/ is not an option because I don't use default OPTIONS. Is there a way or another to chroot in this i386 world from my amd64 host ? Olivier -- Olivier Smedts _ ASCII ribbon campaign ( ) e-mail: olivier@gid0.org - against HTML email & vCards X www: http://www.gid0.org - against proprietary attachments / \ "Il y a seulement 10 sortes de gens dans le monde : ceux qui comprennent le binaire, et ceux qui ne le comprennent pas."