From owner-freebsd-virtualization@freebsd.org Fri Feb 16 14:15:55 2018 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88D44F176DC; Fri, 16 Feb 2018 14:15:55 +0000 (UTC) (envelope-from tech-lists@zyxst.net) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D4757BB87; Fri, 16 Feb 2018 14:15:55 +0000 (UTC) (envelope-from tech-lists@zyxst.net) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 88CEC2082A; Fri, 16 Feb 2018 09:15:54 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Fri, 16 Feb 2018 09:15:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zyxst.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=8qjWpMsb3HlUR0PMZfUhB2BOgyFjn dl+sOwqe63Fzb8=; b=Ks8FJx47nK5cm55Jf4EUh7TK23Y2HIqByycJXhyp8rwZl 1PYRZex6W+1EmY/zRhazctFKFLuwIf8Q+/etiJhIpY51o9qrrsLWwPhQR4/bJybh UOaRDsLSXhWn60yA8rqt6cRj7XKDYhBWAaxBzmUaWfq5pFB1eS23zFFmJpTOdMAw 4y75raqbP/Zb+Y9xZ334qjaeI7qmPLrxIpw9cUsy3dHwy86pKRFlpfA1CBXSpOil B1wm9FJeF/kpkmTqOQh8H7Hvt4fgBGX7FrqbaoM+eeAsIauH0N76NC/j1wCk5WVb Zbvvk6mXJ8saH9VVGQSeO20KlB160Tb21hlRWsx/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=8qjWpM sb3HlUR0PMZfUhB2BOgyFjndl+sOwqe63Fzb8=; b=cPSRu0foPhjSGIHnbL8iD/ vC5j8I62yKk3h3sa8/GKvzjpe42YsBWVPDuaKkXCndWH8gkzEKKKSLaqZZp/bKMT zjuW0ePmI3CRh7OqJPz3angL7u+wZReW6PXThtQ6QgqnEF+iiUUpzjUfSbMpAreL kFOAc9sMve+KoEIMIspooo4cyej+QJ73M9Tbjg1zBzDgPtRD4H0LVGUz+U8jaPqy AqfBTvmJ47gkM/BWlGUhQl3ABG5V8HKyesyP6MjzBH2PztTNd7uq36gkCihMt9K7 suyW1yQPU6AB9KfnKj87X6WxOp+KSJb6wzUpF/BYi6nDM2m8NIl7NL7IFBIsY4qw == X-ME-Sender: Received: from desktop.parsley.growveg.org (parsley.growveg.org [82.70.91.97]) by mail.messagingengine.com (Postfix) with ESMTPA id E361C24550; Fri, 16 Feb 2018 09:15:53 -0500 (EST) Subject: Re: is it possible to chroot into arm64 from amd64? To: =?UTF-8?Q?Mika=c3=abl_Urankar?= References: <30cfa8a3-76e4-73ac-3b2a-2d64ed24aef8@zyxst.net> Cc: freebsd-virtualization@freebsd.org, freebsd-stable@freebsd.org From: tech-lists Message-ID: Date: Fri, 16 Feb 2018 14:15:52 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 14:15:55 -0000 On 16/02/2018 08:21, Mikaël Urankar wrote: > Put  /usr/local/bin/qemu-aarch64-static in > $SYSROOT/usr/local/bin/qemu-aarch64-static > you can use "service qemu_user_static start" to add the interpreter That did it! :D many thanks. I had a bit of a problem with ldconfig but it seems ok so far. Here's what I did from start to finish in case anyone else is interested: ### root@sm1:/# chflags -Rf noschg crossbuild/ root@sm1:/# rm -Rf crossbuild/* root@sm1:/# mkdir crossbuild/arm64 root@sm1:/# sh # SYSROOT=/crossbuild/arm64 # cd /usr/src # make -j96 cleandir && make -j96 clean && make -j96 clean # make -j96 TARGET=arm64 TARGET_ARCH=aarch64 buildworld # make DESTDIR=$SYSROOT TARGET=arm64 TARGET_ARCH=aarch64 installworld # make DESTDIR=$SYSROOT TARGET=arm64 TARGET_ARCH=aarch64 distribution # cp /usr/local/bin/qemu-aarch64-static $SYSROOT/usr/local/bin/qemu-aarch64-static cp: /crossbuild/arm64/usr/local/bin/qemu-aarch64-static: No such file or directory # cp /usr/local/bin/qemu-aarch64-static $SYSROOT/usr/local/bin/ cp: directory /crossbuild/arm64/usr/local/bin does not exist # ls -lah $SYSROOT/usr/local total 8 drwxr-xr-x 2 root wheel 512B Feb 16 12:28 . drwxr-xr-x 13 root wheel 512B Feb 16 12:28 .. # mkdir $SYSROOT/usr/local/bin # cp /usr/local/bin/qemu-aarch64-static $SYSROOT/usr/local/bin/ # service qemu_user_static start Cannot 'start' qemu_user_static. Set qemu_user_static_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'. # echo "qemu_user_static_enable="YES"" >>/etc/rc.conf # service qemu_user_static start # mount -t devfs devfs ${DESTDIR}/dev # chroot -u root $SYSROOT root@sm1:/ # root@sm1:~ # file /usr/bin/file /usr/bin/file: ELF 64-bit LSB executable, ARM aarch64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 11.1 (1101509), FreeBSD-style, stripped root@sm1:~ # service start ldconfig ps: empty file: Invalid argument start does not exist in /etc/rc.d or the local startup directories (/usr/local/etc/rc.d), or is not executable root@sm1:~ # which ldconfig /sbin/ldconfig root@sm1:~ # /sbin/ldconfig root@sm1:~ # root@sm1:~ # exit # -- J.