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

add guide on how to emulate Olimex image #15

Merged
merged 1 commit into from Jun 7, 2023

Conversation

atmaxinger
Copy link
Collaborator

Small basic guide on how to emulate the Olimex board.

Copy link
Collaborator

@fel115 fel115 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all this documentation describes the emulation setup perfect, but I had some issue with the binding of /dev/ttyACM0, without this bindings I can boot the emulator.


```
systemd-nspawn --bind=/dev/ttyACM0 -b -D /tmp/olimex
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't bind the /dev/ttyACM0, because my system doesn't have such a device. Is it necessary to mount this device?

Copy link
Collaborator Author

@atmaxinger atmaxinger Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only necessary if you want to bind it. However, opensesame seems to be a bit useless without it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything except of the air-quality sensors works without it (the other devices/sensors use i2c).

You need to have the [A20 Debian image](http://images.olimex.com/release/a20/) extracted somewhere in your filesystem.
This means you either extracted it from the image file, you mounted the image file, or you have already written it onto a microSD card and mounted that on your system.
As an example, we have extracted the whole image into `/tmp/olimex`.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could include some basic information on, how to mount from an Image. For example, extracting the offset of the partition which should be mounted (``fdisk -l .img) and how to setup the loop-device (losetup -o -f .img).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I can't because I don't know. But feel free to add suggestions via the comments on how you set up that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First you need to get the offset of the olimex.img for that you need to execute fdisk -l olimex.img, now you need to get the starting sector of the image partition, you like to mount. Now you have to multiple the starting sector with the sector-size and this results in the offset. In the next step you have to setup the loop-device with losetup -o <offset> -f olimex.img. You can list all you loop-devices with losetup -l, to see on which loop-device your image is connected. The last step is to mount the loop-device with mount /dev/loop0 <mount-dir>.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fel115 probably easier if you directly write it.

Copy link
Collaborator Author

@atmaxinger atmaxinger Jun 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fel115 systemd-nspawn also has a way of directly working on the image with the --image parameter. Maybe this is easier? You can then use --overlay for persisting the changes and keeping the image read-only.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With my image it doesn't worked. I get this error message No suitable root partition found in image 'A20-OLinuXino-bullseye-minimal-20220928-143706.img'.. It think that's because the image doesn't contain a MBR- or GUID-table.

@markus2330 markus2330 merged commit 5b7304d into ElektraInitiative:master Jun 7, 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

Successfully merging this pull request may close these issues.

None yet

3 participants