Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Feb 2018 01:00:16 +0000
From:      tech-lists <tech-lists@zyxst.net>
To:        freebsd-virtualization@freebsd.org
Cc:        freebsd-stable@freebsd.org
Subject:   is it possible to chroot into arm64 from amd64?
Message-ID:  <30cfa8a3-76e4-73ac-3b2a-2d64ed24aef8@zyxst.net>

next in thread | raw e-mail | index | archive | help
Hi,

Is it possible to have on an amd64 system, a chrooted or jailed arm64
environment? It's possible to cross-compile an arm6 environment on
amd64 and then chroot into the arm6 environment - is the same possible
for arm64? I can cross-compile arm64 like this:

# SYSROOT=/crossbuild/arm64
# cd /usr/src
# make -j32 TARGET=arm64 TARGET_ARCH=aarch64 buildworld
# make DESTDIR=$SYSROOT TARGET=arm64 TARGET_ARCH=aarch64 installworld

# make DESTDIR=$SYSROOT TARGET=arm TARGET_ARCH=armv6 distribution
# cp /usr/local/bin/qemu-aarch64-static $SYSROOT/sbin

# /usr/sbin/binmiscctl add arm64 --interpreter
"/usr/local/bin/qemu-aarch64" \
--magic
"\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00"
\
--mask
"\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
\
--size 20 --set-enabled

# mount -t devfs devfs ${DESTDIR}/dev

then:

# chroot -u root $SYSROOT

then I get the following error:

chroot: /bin/csh: No such file or directory
#

so looked at the chroot, and bin/csh is there!

# ls -lah $SYSROOT/bin |less
total 9144
drwxr-xr-x   2 root  wheel   1.0K Feb 16 00:43 .
drwxr-xr-x  18 root  wheel   512B Feb 16 00:44 ..
-r-xr-xr-x   2 root  wheel   195K Feb 16 00:43 [
-r-xr-xr-x   1 root  wheel   195K Feb 16 00:43 cat
-r-xr-xr-x   1 root  wheel   195K Feb 16 00:43 chflags
-r-xr-xr-x   1 root  wheel   195K Feb 16 00:43 chio
-r-xr-xr-x   1 root  wheel   195K Feb 16 00:43 chmod
-r-xr-xr-x   1 root  wheel   195K Feb 16 00:43 cp
-r-xr-xr-x   2 root  wheel   451K Feb 16 00:43 csh

what am I doing wrong?


-- 
J.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?30cfa8a3-76e4-73ac-3b2a-2d64ed24aef8>