From owner-freebsd-current@FreeBSD.ORG Mon Sep 17 21:38:31 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F76116A418 for ; Mon, 17 Sep 2007 21:38:31 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from mail.ambrisko.com (mail.ambrisko.com [64.174.51.43]) by mx1.freebsd.org (Postfix) with ESMTP id ED15F13C46B for ; Mon, 17 Sep 2007 21:38:30 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from server2.ambrisko.com (HELO www.ambrisko.com) ([192.168.1.2]) by ironport2.ambrisko.com with ESMTP; 17 Sep 2007 14:04:35 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by www.ambrisko.com (8.14.1/8.12.11) with ESMTP id l8HL9upt015952; Mon, 17 Sep 2007 14:09:56 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.14.1/8.13.1/Submit) id l8HL9uiZ015951; Mon, 17 Sep 2007 14:09:56 -0700 (PDT) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200709172109.l8HL9uiZ015951@ambrisko.com> In-Reply-To: <20070914124630.D14000@woozle.rinet.ru> To: Dmitry Morozovsky Date: Mon, 17 Sep 2007 14:09:56 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Cc: current@freebsd.org Subject: Re: i386 package building on an amd64 system X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2007 21:38:31 -0000 Dmitry Morozovsky writes: | Hi there colleagues, | | possibly stupid question: it there a way to fool jail (real, not "tinderbox" | one) that it's working under i386 kernel? This would be extremely useful for | local package building. | | Quick googling does not reveal anything, or did I miss something obvious? Mostly, OSVERSION= UNAME_m= UNAME_p= UNAME_r= UNAME_s= UNAME_v= then chroot or jail. I have a script: #!/bin/sh UNAME_s="FreeBSD" UNAME_m="i386" UNAME_p="i386" ROOT=$HOME/current_$UNAME_p REVISION=`cd ${ROOT}/sys/conf && grep REVISION= newvers.sh | cut -f2 -d'"'` BRANCH=`cd ${ROOT}/sys/conf && grep BRANCH= newvers.sh | head -n1 | cut -f2 -d' "'` UNAME_r=$REVISION-$BRANCH UNAME_v="$UNAME_s $UNAME_r #0: Thu May 4 07:54:55 PDT 2006 root@a21p:/data/ home/ambrisko/current/usr/src/sys/$UNAME_p/compile/THINK" OSVERSION=`awk '/\#define.*__FreeBSD_version/ { print $3 }' < ${ROOT}/sys/sys/pa ram.h` export UNAME_s UNAME_r UNAME_v UNAME_m UNAME_p OSVERSION ROOT if [ -r $ROOT/dev/zero ] then echo dev already mounted else sudo mount -t devfs dev $ROOT/dev fi sudo ln -sf ld-elf.so.1 $ROOT/libexec/ld-elf32.so.1 sudo sh -c '( echo "libpthread.so.2 libthr.so.2" ;\ echo "libpthread.so libthr.so") > ${ROOT}/etc/libmap.conf' sudo cp ${ROOT}/etc/libmap.conf ${ROOT}/etc/libmap32.conf sudo chroot $ROOT It could be made even smarter but looking at the dest and figuring out the release as well. We could make it a make target since you can do this into 6.2 world as well (amd64/current -> amd64/6.2, amd64/current -> i386/6.2 or amd64/current -> amd64/i386). I think I merged in the UNAME_/OSVERSION stuff before 6.2 went out. I also have local hacks to do this with 4.X. At work, our build machines are all loaded up with amd64 and we build i386 or amd64 SW on them. This includes whatever ports are needed. Doug A.