is it possible to chroot into arm64 from amd64?

tech-lists tech-lists at zyxst.net
Fri Feb 16 01:00:23 UTC 2018


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.


More information about the freebsd-stable mailing list