Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
chroot problem with 64bit/64bit
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
ckonstanski1
n00b
n00b


Joined: 17 Jan 2019
Posts: 9
Location: Laporte CO

PostPosted: Mon Feb 11, 2019 4:15 pm    Post subject: chroot problem with 64bit/64bit Reply with quote

Typically you see "Illegal instruction" when you try to chroot into a 64-bit filesystem while running a 32-bit livecd or vice versa. But I'm seeing it while running a 64-bit livecd and trying to chroot into a 64-bit filesystem.

Has anyone else run into this and have any advice?

Code:
[root@sysresccd /mnt/sda3]# chroot . /bin/bash
Illegal instruction (core dumped)


/bin/bash on the livecd is 64-bit:

Code:
[root@sysresccd /mnt/sda3]# file /bin/bash
/bin/bash: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0,


/bin/bash on the target filesystem is also 64-bit. Note the relative path:

Code:
BuildID[sha1]=377a0525ac1ca32204716fcfe215cde2b01e4311, stripped
[root@sysresccd /mnt/sda3]# file bin/bash
bin/bash: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped


The host in question is an HP ProLiant blade with a xeon processor:

Code:
Intel(R) Xeon(R) CPU X5670 @ 2.93GHz


The root filesystem that I'm trying to chroot into also came from a xeon, though not exactly the same model:

Code:
Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43803
Location: 56N 3W

PostPosted: Mon Feb 11, 2019 4:31 pm    Post subject: Reply with quote

ckonstanski1,

That means that your chroot is trying to use an instruction the host CPU hardware does not have.
Try
Code:
chroot . '/bin/busybox sh'


If its bash thats broken, that may work. If its glibc, then almost noting will work in the chroot, even if you get in.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ckonstanski1
n00b
n00b


Joined: 17 Jan 2019
Posts: 9
Location: Laporte CO

PostPosted: Mon Feb 11, 2019 6:53 pm    Post subject: Reply with quote

Thanks for the reply. I tried it with no luck. The cpuflags are different on the two hosts (many more flags on the load I'm trying to chroot into) and I tuned CFLAGS to take full advantage. At least I understand the issue now.
Back to top
View user's profile Send private message
ckonstanski1
n00b
n00b


Joined: 17 Jan 2019
Posts: 9
Location: Laporte CO

PostPosted: Tue Feb 12, 2019 3:53 pm    Post subject: Reply with quote

Problem solved. First a comparison of the CFLAGS:

Source system:
Code:
CFLAGS="-march=broadwell -mtune=broadwell -mmmx -msse -msse2 -msse3 -mssse3 -mno-sse4a -mavx -mavx2 -msse4.2 -msse4.1 -O2 -pipe"


Destination system:
Code:
CFLAGS="-march=westmere -mtune=westmere -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mno-sha -O2 -pipe"


On the source host I copied the entire root filesystem into a new directory. I chrooted into it and rebuilt it with the new CFLAGS (emerge @world and also the kernel). Then I rsynced this cross-compiled copy of the OS over to the new host. Now it chroots!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum