public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mick <michaelkintzios@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Re: [was cross-compile attempt] 32bit chroot
Date: Mon, 01 Aug 2016 17:32:58 +0100	[thread overview]
Message-ID: <25794541.FjCKaz5n3c@dell_xps> (raw)
In-Reply-To: <20160801161941.GA411@waltdnes.org>

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

On Monday 01 Aug 2016 12:19:41 waltdnes@waltdnes.org wrote:
> On Mon, Aug 01, 2016 at 04:46:24PM +0100, Mick wrote
> 
> > On Monday 01 Aug 2016 11:23:03 waltdnes@waltdnes.org wrote:
> > >   I recommend going with one of 3 "cheats"...
> > > 
> > > 1) A 32-bit chroot in a 64-bit machine
> > > 
> > > 2) A QEMU (or VirtualBox) 32-bit guest on a 64-bit host
> > > 
> > > 3) If you have a spare 64-bit machine, install 32-bit Gentoo on it
> > > 
> > >   I use option 2) both as my distccd server and to manually build Pale
> > > 
> > > Moon.  The target in both cases is an ancient 32-bit-only Atom netbook.
> > 
> > I'm trying your cheat (1) above, but I must be doing something wrong:
> > 
> > gentoo-32bit # linux32 chroot /mnt/iso/gentoo-32bit /bin/bash
> > chroot: failed to run command ???/bin/bash???: No such file or directory
> > 
> > gentoo-32bit # ls -la /bin/bash
> > -rwxr-xr-x 1 root root 705400 Jan  9  2016 /bin/bash
> > 
> > gentoo-32bit # ls -la ./bin/bash
> > -rwxr-xr-x 1 root root 677244 Jan 16  2016 ./bin/bash
> > 
> > gentoo-32bit # linux32 chroot /mnt/iso/gentoo-32bit ./bin/bash
> > chroot: failed to run command ???./bin/bash???: No such file or directory
> 
>   I believe that "/bin/bash" is the pathname after you switch to the
> chroot environment.  So you would need a 32-bit bash located at
> /mnt/iso/gentoo-32bit/bin/bash *BEFORE CHROOTING*.  See
> https://lwn.net/Articles/252794/
> 
> > What chroot() actually does is fairly simple, it modifies pathname
> > lookups for a process and its children so that any reference to a path
> > starting '/' will effectively have the new root, which is passed as
> > the single argument, prepended onto the path. The current working
> > directory is left unchanged and relative paths can still refer to
> > files outside of the new root.

Thanks Walter, it's present along with the whole of the 32bit OS fs:

gentoo-32bit # ls -la /mnt/iso/gentoo-32bit/bin/bash
-rwxr-xr-x 1 root root 677244 Jan 16  2016 /mnt/iso/gentoo-32bit/bin/bash

gentoo-32bit # file /mnt/iso/gentoo-32bit/bin/bash
/mnt/iso/gentoo-32bit/bin/bash: ELF 32-bit LSB executable, Intel 80386, 
version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for 
GNU/Linux 2.6.32, stripped


Am I missing something in the amd64 kernel to be able to execute 32bit code?
-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2016-08-01 16:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-31 18:40 [gentoo-user] cross-compile attempt Mick
2016-07-31 20:15 ` Jeremi Piotrowski
2016-07-31 20:18 ` Andrew Savchenko
2016-07-31 22:31   ` Mick
2016-08-01 13:51     ` Mick
2016-08-01 15:31       ` Peter Humphrey
2016-08-01 15:49         ` Mick
2016-08-01 16:21           ` Mick
2016-08-02  8:46             ` Peter Humphrey
2016-08-02 11:56           ` Neil Bothwick
2016-08-03  0:26             ` [gentoo-user] " Ian Zimmerman
2016-08-03  8:20               ` Neil Bothwick
2016-08-03 17:26                 ` james
2016-08-03 20:11                   ` R0b0t1
2016-07-31 20:36 ` [gentoo-user] " james
2016-08-01 15:23 ` waltdnes
2016-08-01 15:46   ` [gentoo-user] Re: [was cross-compile attempt] 32bit chroot Mick
2016-08-01 16:19     ` waltdnes
2016-08-01 16:32       ` Mick [this message]
2016-08-01 17:57         ` Mick
2016-08-01 21:21           ` Mick
2016-08-01 23:11             ` Jeremi Piotrowski
2016-08-02  4:33               ` waltdnes
2016-08-02  5:29                 ` Mick
2016-08-02  9:22           ` Peter Humphrey
2016-08-02 14:33             ` Neil Bothwick

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=25794541.FjCKaz5n3c@dell_xps \
    --to=michaelkintzios@gmail.com \
    --cc=gentoo-user@lists.gentoo.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