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

qemu_boot requires xz-compressed images to live in /tmp #201

Open
umlaeute opened this issue Aug 31, 2023 · 6 comments
Open

qemu_boot requires xz-compressed images to live in /tmp #201

umlaeute opened this issue Aug 31, 2023 · 6 comments

Comments

@umlaeute
Copy link
Contributor

i'm just starting with CustomPiOS, and i'm a bit stumped on how to use qemu_boot.

  1. no help or whatsoever
    it would be really nice if starting qemu_boot.sh without any arguments (or with -h; or with a non-existing file) to output some usage information
  2. it apparently requires the image to be passed either as ZIP-compressed archive or an XZ-compressed image - why is it not possible to use a raw (uncompressed) image, such as created by build_dist
  3. when using a ZIP-compressed archive the image has to be the first entry in the archive (I don't know whether this is also a requirement by rpi-imager, but it would be nice to have this documented)
  4. when using an XZ-compressed image, it must live in /tmp otherwise the uncompressed image won't be found
@umlaeute umlaeute changed the title qemu_boot requires a compressed image in /tmp qemu_boot requires xz-compressed images to live in /tmp Aug 31, 2023
@umlaeute
Copy link
Contributor Author

also, from checking the code it seems that the image-name (unless it is a zip-file) must not contain the sequence xz preceded by an arbitrary character:

IMG_NAME=$(echo $(basename $ZIP_IMG) | sed "s/.xz//")

e.g.

$ echo mixzap.img.xz | sed "s/.xz//"
map.img.xz
$

the correct sed-expression would be "s/\.xz$//", but i think a much better way would be to use POSIX parameter expansion:

IMG_NAME=$(basename "${ZIP_IMG%.xz}")

@guysoft
Copy link
Owner

guysoft commented Aug 31, 2023

Hey, you are quite right. I initially wrote qemu_boot as a quick hack and it really has the place to become something more useful and well documented.
I am not sure how much time I have to do that now. Perhaps adding an if args<0 and to print help would be a good start. I would really welcome a PR if you have time for that.

@umlaeute
Copy link
Contributor Author

i might :-)

sidenote: shouldn't qemu_boot.sh and qemu_boot64.sh be virtually identical (obviously apart from the CPU/kernel/dtb/...)?

@guysoft
Copy link
Owner

guysoft commented Sep 2, 2023

i might :-)

sidenote: shouldn't qemu_boot.sh and qemu_boot64.sh be virtually identical (obviously apart from the CPU/kernel/dtb/...)?

Yes, though I update which kernel is used since they changed over time. They could be joined in to one script

@umlaeute
Copy link
Contributor Author

umlaeute commented Sep 7, 2023

i found https://github.com/bablokb/pi-qemu-helper which seems to be a better alternative to your scripts (as it also supports booting with a GUI)

@guysoft
Copy link
Owner

guysoft commented Sep 7, 2023

Cool - if you have some example of what commands to run on a .zip file to get a running emulation we could add that to the wiki.
Also I am interested too :)

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