You are not logged in.

#1 2015-03-13 22:14:10

stevepa
Member
From: Texas USA
Registered: 2012-02-12
Posts: 113

[resolved]chroot: failed to run command '/bin/bash': Exec format error

Problem: I am getting an error:

 chroot: failed to run command ‘/bin/bash’: Exec format error 

while attempting to follow wiki topic "Remastering the Install ISO"

My environment is i686 packages on fully updated Arch Linux install.

My arch iso is from here http://mirrors.gigenet.com/archlinux/is … 1-dual.iso

The context of the error is precisely as follows, at the end:


# mkdir /mnt/archiso

# mount -t iso9660 -o loop /home/steve/Downloads/archlinux-2015.03.01-dual.iso /mnt/archiso
mount: /dev/loop0 is write-protected, mounting read-only

$ cd ~
$ mkdir customiso                      
$ cp -a /mnt/archiso/ ./customiso                      
$ cd customiso/archiso/arch/x86_64/
$ unsquashfs airootfs.sfs
Parallel unsquashfs: Using 2 processors
1 inodes (262144 blocks) to write

[=============================================================================================|] 262144/262144 100%

created 1 files
created 1 directories
created 0 symlinks
created 0 devices
created 0 fifos


# cd /home/steve/customiso/archiso/arch/x86_64/
# mount -o loop squashfs-root/airootfs.img mnt
                           
# mount -o loop squashfs-root/airootfs.img mnt
# arch-chroot mnt /bin/bash
chroot: failed to run command ‘/bin/bash’: Exec format error

FYI, I have read this info https://wiki.archlinux.org/index.php/Ch … rch-chroot
Plus, I use chroot on every install without this trouble.

Does this error have anything to do with  setarch? Here is what I tried:

setarch i686 arch-chroot mnt /bin/bash
chroot: failed to run command ‘/bin/bash’: Exec format error
#  setarch x86_64 arch-chroot mnt /bin/bash
setarch: x86_64: Unrecognized architecture

I verified bash is at /bin/bash

The wiki article directories appear to vary slightly from the downloaded iso, but I adjusted to them, I hope, correctly.

Is it even possible to follow the wiki section "Modifying the X86_64 system" on a i686 install?

I hope I have not overlooked something simple.

Any pointers or tips appreciated as always.
Steve.

Last edited by stevepa (2015-03-15 01:31:20)


Arch - LVM - ext4 - gnome (T60p 14.1 1400p  x86_64), (T60 15 flexview 1400p i686)

Offline

#2 2015-03-13 22:19:51

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: [resolved]chroot: failed to run command '/bin/bash': Exec format error

I believe you need to boot into an i686 install to chroot into an i686 system.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2015-03-13 22:55:41

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [resolved]chroot: failed to run command '/bin/bash': Exec format error

graysky wrote:

I believe you need to boot into an i686 install to chroot into an i686 system.

No, this isn't true. You can use linux32 to emulate an i686 environment from x86_64. You can't do the reverse however (chroot into x86_64 from i686) which is what the OP is attempting.

Last edited by falconindy (2015-03-13 23:00:14)

Offline

#4 2015-03-13 23:00:13

stevepa
Member
From: Texas USA
Registered: 2012-02-12
Posts: 113

Re: [resolved]chroot: failed to run command '/bin/bash': Exec format error

Thank you Mr. Falcon. That was my suspicion.

I did not see that proviso on the wiki page but maybe it was common sense.


Arch - LVM - ext4 - gnome (T60p 14.1 1400p  x86_64), (T60 15 flexview 1400p i686)

Offline

#5 2015-03-13 23:19:27

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [resolved]chroot: failed to run command '/bin/bash': Exec format error

Oh, so it is Mr Falcon now?

tongue


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2015-03-13 23:20:41

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [resolved]chroot: failed to run command '/bin/bash': Exec format error

stevepa wrote:

Thank you Mr. Falcon. That was my suspicion.

I did not see that proviso on the wiki page but maybe it was common sense.

It does say

Requirements:
Matching architecture environments; i.e. the chroot from and chroot to. The architecture of the current environment can be discovered with: uname -m (e.g. i686 or x86_64).

Online

#7 2015-03-13 23:44:59

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [resolved]chroot: failed to run command '/bin/bash': Exec format error

Offline

#8 2015-03-14 02:23:30

stevepa
Member
From: Texas USA
Registered: 2012-02-12
Posts: 113

Re: [resolved]chroot: failed to run command '/bin/bash': Exec format error

If I may update my experience about archiso.

First,     I love it!   Thanks to those who created or maintain archiso.

As my first foray, I just added the package 'vim-minimal' to packages.both and ran the build script (because I dislike nano).

After about 10 minutes, it quit, and I burned the image to a flash drive, booted it, and vim was in the live system. 

Kind of gives a beginner a taste of creating an Arch Linux install 'spin'. Granted, a hardly improved spin.

Update 2: Just thought I would add some build times on a modern laptops

Lenovo Thinkpad T440p i5 4GB SSD profile=releng

time ./build.sh -v
[mkarchiso] INFO: Done! | 611M out/archlinux-2015.03.14-dual.iso

real	6m38.869s
user	12m38.920s
sys	0m48.213s

Lenovo X220 i5 8GB SSD profile=baseline

time ./build.sh -v
[mkarchiso] INFO: Done! | 223M out/archlinux-2015.03.14-x86_64.iso

real	2m10.040s
user	4m53.380s
sys	0m26.313s

Lenovo X220 i5 8GB SSD profile=releng (stock)

[mkarchiso] INFO: Done! | 595M out/archlinux-2015.03.14-dual.iso

real	7m37.280s
user	14m21.257s
sys	1m8.783s

Last edited by stevepa (2015-03-15 04:09:17)


Arch - LVM - ext4 - gnome (T60p 14.1 1400p  x86_64), (T60 15 flexview 1400p i686)

Offline

#9 2015-03-14 03:35:17

stevepa
Member
From: Texas USA
Registered: 2012-02-12
Posts: 113

Re: [resolved]chroot: failed to run command '/bin/bash': Exec format error

Raynman wrote:
stevepa wrote:

Thank you Mr. Falcon. That was my suspicion.

I did not see that proviso on the wiki page but maybe it was common sense.

It does say

Requirements:
Matching architecture environments; i.e. the chroot from and chroot to. The architecture of the current environment can be discovered with: uname -m (e.g. i686 or x86_64).

You are absolutely right!  My bad.


Arch - LVM - ext4 - gnome (T60p 14.1 1400p  x86_64), (T60 15 flexview 1400p i686)

Offline

#10 2015-03-14 04:07:45

stevepa
Member
From: Texas USA
Registered: 2012-02-12
Posts: 113

Re: [resolved]chroot: failed to run command '/bin/bash': Exec format error

On the wiki https://wiki.archlinux.org/index.php/Ta … not_enough

Regarding "Rebuilding the iso...not enough"

I can confirm this is correct.

The error I get is

[mkarchiso] INFO: Configuration settings
[mkarchiso] INFO:                   Command:   run
[mkarchiso] INFO:              Architecture:   i686
[mkarchiso] INFO:         Working directory:   work/i686
[mkarchiso] INFO:    Installation directory:   arch
[mkarchiso] INFO:               Run command:   /root/customize_airootfs.sh

Generating locales...
  en_US.UTF-8... done
Generation complete.
usermod: no changes
useradd: user 'arch' already exists

Will look for a solution.
Tks

Last edited by stevepa (2015-03-14 04:09:05)


Arch - LVM - ext4 - gnome (T60p 14.1 1400p  x86_64), (T60 15 flexview 1400p i686)

Offline

Board footer

Powered by FluxBB