Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_image fails on chroot #8

Open
roens opened this issue Jan 24, 2017 · 2 comments
Open

create_image fails on chroot #8

roens opened this issue Jan 24, 2017 · 2 comments

Comments

@roens
Copy link

roens commented Jan 24, 2017

I've not been able to get create_image to complete a successful build. I'm attempting to build an image that I can then write to the OrangePi Plus's EMMC storage.

The output I get is:

# sudo ./create_image

Tue Jan 24 14:44:44 PST 2017
=======================================================
Creating Ubuntu/Debian SD Card instalation for OrangePI
=======================================================

Using disk image "Orangian.img"
Creating partition images, please wait ...

Creating new filesystem on Orangian.img...
  New filesystem created on Orangian.img.

Partitioning Orangian.img...
  Creating boot & linux partitions
  OK.

Formating fat partition ...
  fat partition formated.
Formating linux partition (ext4), please wait ...
  linux partition formated.

Instaling u-boot to Orangian.img ...
U-boot installed to Orangian.img.

Mounting SD Card partitions...
SD Card partitions mounted to _linux_img_mnt & _boot_img_mnt

DEBOOTSTRAP, FIRST STAGE
OK.                        
Creating "sources.list"
Error while loading /bin/bash: No such file or directory
================================================
ERROR on second-stage, instalation NOT FINISHED.
================================================

If I add -x to the shebang (first line), I can see that it's failing on running chroot:

+ mkdir -p _linux_img_mnt/media/boot
+ mkdir -p _linux_img_mnt/usr/local/bin
+ mkdir -p _linux_img_mnt/usr/bin
+ cp /etc/timezone _linux_img_mnt/etc
+ cp /usr/bin/qemu-arm-static _linux_img_mnt/usr/bin
+ cp second-stage _linux_img_mnt/second-stage
+ cp params.sh _linux_img_mnt/params.sh
+ '[' '!' yes = yes ']'
+ chroot _linux_img_mnt /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/bash /second-stage
Error while loading /bin/bash: No such file or directory

I can see that both ${sdcard}1 and ${sdcard}2 are still mounted, yet the 2nd, _linux_img_mnt has no /bin dir, where /bin/bash would be located… even tho that mkdir -p _linux_img_mnt/usr/bin line would appear to have run.
https://github.com/loboris/OrangePi-BuildLinux/blob/master/create_image#L205

@vencol
Copy link

vencol commented Jul 24, 2018

hello, i have the same problem with you ,how do you fix it? could you share it with me?Thanks

@MarkZ2012
Copy link

sudo apt-get install debootstrap qemu qemu-user-static
I resolve this problem by the command above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants