Github messages for voidlinux
 help / color / mirror / Atom feed
From: ejolson2005 <ejolson2005@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: musl qemu-user-static not static
Date: Wed, 08 Jul 2020 07:55:26 +0200	[thread overview]
Message-ID: <20200708055526.AkWd5uCl-JGlr7M3csn9qpsebNJgKDXeXATgdhm4pZQ@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23418@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 2436 bytes --]

New comment by ejolson2005 on void-packages repository

https://github.com/void-linux/void-packages/issues/23418#issuecomment-655303483

Comment:
I have the Raspberry Pi OS unpacked in the directory iroot and binfmt-support enabled in Void Linux for user-mode QEMU.  Then I perform the following:
```
# mount --rbind /sys iroot/sys
# mount --make-rslave iroot/sys
# mount --rbind /dev iroot/dev
# mount --make-rslave iroot/dev
# mount --rbind /dev/pts iroot/dev/pts
# mount --make-rslave iroot/dev/pts
# mount --rbind /proc iroot/proc
# mount --make-rslave iroot/proc
# cp /usr/bin/qemu-arm-static iroot/usr/bin
# cp /usr/bin/qemu-aarch64-static iroot/usr/bin
# chroot iroot
root@silver:/# ldd /bin/bash
    libtinfo.so.6 => /lib/aarch64-linux-gnu/libtinfo.so.6 (0x000000550198a000)
    libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x00000055019ca000)
    libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x00000055019de000)
    /lib/ld-linux-aarch64.so.1 (0x0000005500000000)
root@silver:/# exit
exit
# umount -R iroot/dev/pts
# umount -R iroot/sys
# umount -R iroot/dev
# umount -R iroot/proc
```
Everything seems to work fine when iroot contains the 32-bit version of Raspberry Pi OS; however, if I do the same with the 64-bit version of Raspberry Pi OS, then there is no networking in the chroot environment.  The error is something like
```
root@silver:/# ifconfig
: error fetching interface information: Device not found
root@silver:/# ip link
netlink receive error Message too long (90)
Dump terminated
```
I have no idea whether this is an issue with the x86 Void host or the 64-bit AARCH64 image.  At any rate, it would appear QEMU user-mode is working in musl even though file reports the binaries as being dynamically linked.  As I'm not up to speed on the different binary formats available with Linux, I don't know why PIE are flagged as dynamically linked.  In my opinion, this is likely to cause ongoing confusion, but this thread seems not the place to resolve that problem.

Thanks everyone for the help.  Also, if there is time, I would greatly appreciate if someone could comment on whether the bind mounts I have included above are sufficient for a properly functioning chroot environment.  In particular, have I left out something obvious that is preventing the network devices from being detected in the AARCH64 chroot?  I'm very impressed with the help so far.  Again thanks!

  parent reply	other threads:[~2020-07-08  5:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06 16:02 [ISSUE] " ejolson2005
2020-07-06 16:51 ` ericonr
2020-07-06 18:05 ` ejolson2005
2020-07-06 18:16 ` ericonr
2020-07-06 18:31 ` ejolson2005
2020-07-06 18:32 ` ejolson2005
2020-07-06 18:47 ` ericonr
2020-07-07 23:32 ` sgn
2020-07-07 23:39 ` sgn
2020-07-08  5:55 ` ejolson2005 [this message]
2020-07-08  6:15 ` ericonr
2020-07-11 18:52 ` ejolson2005
2020-07-11 18:52 ` [ISSUE] [CLOSED] " ejolson2005
2020-07-11 19:37 ` ericonr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200708055526.AkWd5uCl-JGlr7M3csn9qpsebNJgKDXeXATgdhm4pZQ@z \
    --to=ejolson2005@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).