#983494 arch-test breaks debootstrap into empty chroot

#983494#5
Date:
2021-02-25 02:48:31 UTC
From:
To:
Hi - I'm using debootstrap to create a fresh new chroot, and it fails
immediately:

root:~# /usr/sbin/debootstrap --variant=buildd buster /var/chroot/buster-amd64
E: Unable to execute target architecture
root:~# cat /var/chroot/buster-amd64/debootstrap/debootstrap.log
amd64: not supported on this machine/kernel
root:~#

In this example, the directory /var/chroot/buster-amd64 did not previously
exist.

The problem appears to be at the arch-test stage (line 637 of
/usr/sbin/debootstreap), where it runs 'arch-test -c "$TARGET" "$ARCH"'
to see if the host and target architectures are compatible.  AFAICT,
when given a chroot via -c, arch-test looks for its test files *inside*
the chroot; however, at this stage debootstrap has not yet done any
unpacking (or even any downloads), which means the chroot is empty.
This maks arch-test fail, even though the host and target architecture
are identical, and in turn this makes debootstrap fail before it has a
chance to do any real work.

If I comment out the arch-test stage at line 632 (i.e., skipping the
arch-test block entirely) then debootstrap runs successfully to completion.

Thanks - Ben.

#983494#10
Date:
2021-03-18 05:43:43 UTC
From:
To:
Also struggling with something similar, I thought I hit this bug, but
actually no. Let me bring more details.

 > arch-test looks for its test files *inside* the chroot;

That's not how I read the code. It copies the helper in the chroot, and
then it runs it with chroot:

https://github.com/kilobyte/arch-test/blob/28f25fef25cdb09805a20986414bf3435c67d47f/arch-test#L56

And here's a corresponding trace, while running it with '-x':

||

|++ basename /usr/lib/arch-test/arm64|
|||
+ HELPER_F=arm64
||
+ cp -p /usr/lib/arch-test/arm64
/builds/kalilinux/build-scripts/kali-docker/arm64/kali-rolling/arm64
||
+ trap 'rm
'\''/builds/kalilinux/build-scripts/kali-docker/arm64/kali-rolling/arm64'\'''
0
||
++ chroot /builds/kalilinux/build-scripts/kali-docker/arm64/kali-rolling
/arm64
||
+ MSG=
||
+ '[' 127 -eq 0 -a x = xok ']'
||
+ echo 'arm64: not supported on this machine/kernel'
||
arm64: not supported on this machine/kernel
||+ exit 1|

|Cheers,|

|  Arnaud
|

#983494#15
Date:
2024-02-04 15:25:42 UTC
From:
To:
I've never seen this. Is it fixed?