Issues about building OpenHD images

When using Open.HD_Image_Builder-2.0, I have encounter an issue as below


In the /stages/02-Packages/00-run-chroot.sh, it stop at “execve /bin/bash failed!”, how to resolve this ?

Did you install qemu-user-static and binfmt-support?

yes, I have already installed these two packages. The version of qemu-user-static is (1:2.11+dfsg-1ubuntu7.34), and binfmt-support (2.1.8-2). The Ubuntu version is 18.04.1, Linux core version is 5.3.0-53-generic. Still not resolve the problem. :pensive:

See if the images are actually being mounted, check losetup and mount you should see some mountpoints for the last time you ran the build command.


Is that right?

Yea they look right, run the clean script and try it again, and if that doesn’t help remove that work dir entirely and let it start fresh.

I don’t think i’ve ever seen it fail to execute bash like that here.

Still not work. The only difference between what I’ve done and steps suggested in the readme file is that I downloaded 2018-10-09-raspbian-stretch-lite.zip manually, and put the downloaded zip file to the work dir, then rerun the build.sh. But as shown in the screen shot , the zip has been unzipped successfully. What is the suggested environments for creating the img?

We just use Ubuntu. I’ll run it on a new Ubuntu install and see what happens, however I’ve done that a few times in the past few months and haven’t seen that problem.

A few of the developers are getting ready to replace that builder as well, hopefully will be easier for people to deal with soon :slight_smile:

Thanks a lot, Stephen. With your help, I’ve successfully builded the image. After making the qemu-user-static reinstalled, keeping the binfmt service running, the image was builded successfully.

I am having an issue trying to run the build.sh for pi-buster and would appreciate any guidance. Many thanks in advance for any help on this.

I am running on Ubuntu 16.04 and following the instructions I have downloaded the files from github and initiated the build.sh. When the download finishes I get an error saying there is an unrecognized disk error (see log below).

When I run the losetup I can see the unzipped image

root@brian-Blade:~/Open.HD_Image_Builder# losetup
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE
/dev/loop0 0 0 1 1 /var/lib/snapd/snaps/github-desktop_57.snap
/dev/loop1 0 0 1 1 /var/lib/snapd/snaps/core18_1944.snap
/dev/loop2 0 0 1 1 /var/lib/snapd/snaps/gtk-common-themes_1514.snap
/dev/loop3 0 0 1 1 /var/lib/snapd/snaps/core18_1932.snap
/dev/loop4 0 0 1 1 /var/lib/snapd/snaps/core_10577.snap
/dev/loop5 0 0 1 1 /var/lib/snapd/snaps/gtk-common-themes_1513.snap
/dev/loop6 0 0 1 1 /var/lib/snapd/snaps/core_10583.snap
/dev/loop7 2146435072 1048576 0 0 /home/BrianRoot/Open.HD_Image_Builder/work-pi-buster/02-Packages/IMAGE.img (deleted)
/dev/loop8 2146435072 1048576 0 0 /home/BrianRoot/Open.HD_Image_Builder/work-pi-buster/02-Packages/IMAGE.img

==============================================================================
Terminal screen output from ./build.sh pi-buster

==============================================================================
2021-01-07 15:50:58 (213 KB/s) - ‘2020-05-27-raspios-buster-lite-armhf.zip’ saved [452715448/452715448]

[15:50:58] Unarchive base image
Archive: 2020-05-27-raspios-buster-lite-armhf.zip
inflating: 2020-05-27-raspios-buster-lite-armhf.img
mv: cannot stat ‘2020-05-27-raspios-buster-lite-armhf’: No such file or directory
~/Open.HD_Image_Builder/stages/01-Baseimage ~/Open.HD_Image_Builder
[15:51:09] End /home/BrianRoot/Open.HD_Image_Builder/stages/01-Baseimage/00-run.sh
[15:51:09] Begin /home/BrianRoot/Open.HD_Image_Builder/stages/01-Baseimage/01-run.sh
~/Open.HD_Image_Builder/work-pi-buster/01-Baseimage ~/Open.HD_Image_Builder/stages/01-Baseimage ~/Open.HD_Image_Builder
[15:51:09] Create 2Gb empty image
1+0 records in
1+0 records out
1 byte copied, 6.4248e-05 s, 15.6 kB/s
[15:51:09] Enlarge the downloaded image by 2Gb
[15:51:10] fdisk magic to enlarge the main partition
Error: /home/BrianRoot/Open.HD_Image_Builder/work-pi-buster/01-Baseimage/IMAGE.img: unrecognised disk label
ROOT OFFSET:

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x91578922.

Command (m for help): No partition is defined yet!
Could not delete partition 1

Command (m for help): 2: unknown command

Command (m for help): Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-4194303, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-4194303, default 4194303):
Created a new partition 2 of type ‘Linux’ and of size 2 GiB.

Command (m for help): The partition table has been altered.
Syncing disks.

~/Open.HD_Image_Builder/stages/01-Baseimage ~/Open.HD_Image_Builder
[15:51:11] End /home/BrianRoot/Open.HD_Image_Builder/stages/01-Baseimage/01-run.sh
[15:51:12] End /home/BrianRoot/Open.HD_Image_Builder/work-pi-buster/01-Baseimage
[15:51:12]
[15:51:12]
[15:51:12] ======================================================
[15:51:12] Begin /home/BrianRoot/Open.HD_Image_Builder/work-pi-buster/02-Packages
[15:51:14] Mounting image file: /home/BrianRoot/Open.HD_Image_Builder/work-pi-buster/02-Packages/IMAGE.img
[15:51:16] Mounting root partition: 2
[15:51:17] /: offset 1048576, length 2146435072
mount: wrong fs type, bad option, bad superblock on /dev/loop9,

I builded the image successfully using the 2.0 branch not the master branch. From the build cmd you posted, you builded the image on the master branch, I have not builded successfully on the master, try the 2.0 branch.

Ok many thanks I will try this.

I have been having this same issue with execve /bin/bash failed message. Nothing in this post addresses the Fix for it… is there any updates to this issue??

what did you have configured for the binfmt service? I am having the same problem with the execve failure… i have removed and reinstalled both binfmt and qemu-user-static to no avail…

I tested on the ubuntu 20.04 and 18.04. Did you use the same version?binfmt and qemu-user-static is a deamon tool for images, find some tutorials to use the tool. When you know how to use the tool, you will resolve this problem