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

Trouble running the image-builder #210

Closed
orgua opened this issue Oct 1, 2022 · 8 comments
Closed

Trouble running the image-builder #210

orgua opened this issue Oct 1, 2022 · 8 comments

Comments

@orgua
Copy link

orgua commented Oct 1, 2022

Is there more info about running the scripts to build your own image for the BBB?

As the rcn-ee apt repo seems to support ubuntu 22.04 / jammy, I wanted to create a test-image but already failed at the default ubuntu image instructions given in the readme:

git clone https://github.com/RobertCNelson/omap-image-builder
cd ./omap-image-builder
./RootStock-NG.sh -c rcn-ee.net-console-ubuntu-focal-v5.10-ti-armhf

As debian-based linux as a host seems tested, I tried to run it on ubuntu 20.04 and and 22.04 without success:

Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 3, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code

I found one undocumented prereq I had to install:

  • m4 (via apt)

is there more? I looked through all directories, saw the jenkins-files and the ./docs, but could not find helpful information.

@RobertCNelson
Copy link
Owner

RobertCNelson commented Oct 1, 2022

Hi @orgua sorry, at one time we did have a dependency check, but debootstrap is actually common on non-debian systems, so it was decided to not try to do every combination..

now days i'm having too much fun on other arch's, i don't think i'll actually finish the 22.04/jammy (ARMHF) bits..

@orgua
Copy link
Author

orgua commented Mar 10, 2023

Ok, so no official jammy. But I still fail to run the default script for Ubuntu 20.4.5 following the readme.

It always fails in the chroot.sh line 287

>> sudo chroot ./ignore/tmp.xyz debootstrap/debootstrap --second-stag
e
chroot: failed to run command ‘debootstrap/debootstrap’: Exec format error

I tried several distros in WSL as host:

  • debian 11.6
  • ubuntu 20.4
  • ubuntu 22.4

By reading through the web (looking for fixes for the error-message) I got to collect several packages for pre-install:

  • m4
  • debootstrap
  • debootstick
  • qemu-system-arm (+ many dependencies)
  • git
  • sbuild (just a guess)
  • qemubuilder (+ many dependencies)
  • qemu-user-static
  • crossbuild-essential-armhf
  • coreutils
  • sbuild-qemu
  • qemu-utils
  • pbuilder
  • cdebootstrap
  • zstd
  • schroot
  • tree

The error is still present. Could you please hint me a possible solution? The build-server is clearly producing images :)

@RobertCNelson
Copy link
Owner

RobertCNelson commented Mar 10, 2023

are you running in WSL (1) or WSL (2) mode, WSL 2 provides a better linux internal vm..

ps, sorry i haven't tried this script personally on wsl.. running the debootstrap step should be the easiest for wsl to do, afterwards i'd fully expect it to barf on the bind mount and chroot into the qemu-arch enviromrment for final install.

@orgua
Copy link
Author

orgua commented Mar 10, 2023

Yes it was indeed WSL1, but after updating to WSL 2 it still fails :)
But using a VM did the trick - the script ran almost through ('tree' was not installed). Thanks so much for your work!

One more question if I may:

Now that there is an riscv64-ubuntu23.04 on the image-server and the rcn-ee apt repo also has jammy-support -> Would it be feasible to compile a working BB Black image by just adapting the focal-config?

@RobertCNelson
Copy link
Owner

yeah, i think that would work,

just
copy the focal one directly rcn-ee.net-console-ubuntu-focal-v5.10-ti-armhf, and then tweak the new stuff defined in rcn-ee.net-console-ubuntu-2304-riscv64

the biggest issue, these might now all be built yet for jammy..

https://github.com/RobertCNelson/omap-image-builder/blob/master/configs/rcn-ee.net-console-ubuntu-2304-riscv64.conf#L131-L143

@orgua
Copy link
Author

orgua commented Mar 10, 2023

awesome spidersenses! Thats exactly where its failing. some of these packages you pointed out are in the repo, but most of them aren't.

Hit:1 http://ports.ubuntu.com jammy InRelease
Hit:2 http://repos.rcn-ee.com/ubuntu jammy InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package bb-beagle-config
E: Unable to locate package bb-beagle-version
E: Unable to locate package bb-cape-overlays
E: Unable to locate package bb-usb-gadgets
E: Unable to locate package generic-sys-mods
E: Unable to locate package gt
E: Unable to locate package libusbgx
Log: umount: [/home/service/omap-image-builder/ignore/tmp.tGPfyN1lqQ/dev/pts]

Some fallback to focal would suffice. I did an ubuntu-upgrade once - it took forever on the BB - but the new software-versions brought a significant and much needed speed improvement for us.

BTW: is that line a possible bug? I tried adding it to jammy, but there are only debian-source in it.

@RobertCNelson
Copy link
Owner

Oh that line is only for arm64/riscv64 debian.beagleboard.org is not a full mirror of rcn-ee.net (the armhf has a large history, no reason to mirror that when we enabled the BeagleV project and then the TI bbai64 project)...

Regards,

@orgua
Copy link
Author

orgua commented Dec 3, 2023

main issue resolved as it was WSL-related

@orgua orgua closed this as completed Dec 3, 2023
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

2 participants