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 bug [python 3] #211

Closed
willprice opened this issue Aug 4, 2019 · 2 comments
Closed

QEMU boot bug [python 3] #211

willprice opened this issue Aug 4, 2019 · 2 comments

Comments

@willprice
Copy link

Hi kamilion ,
Thanks for the really helpful tool.

I've bumped into a problem using customizer -q on python 3, it seems there is some text encoding issue going on (python 2 used bytes by default for str and its now unicode for python 3)

When I try and launch a QEMU session, I get the following error

* CUSTOMIZER: ('ISO image does not exist', "/home/customizer/Ubuntu-b'amd64'-18.04.iso")

I'm guessing the arch (amd64) is obtained as the result of some shell command, which by default in Python 3 will return bytes, typically you want to call .decode('utf-8') on the output.

Environment details:

  • uname -a: Linux vm-xubuntu 4.18.0-15-generic #16~18.04.1-Ubuntu SMP ....
  • python --version: Python 3.7.3
  • customizer -v: Customizer 4.2.0 (Zip Release)
@kamilion
Copy link
Owner

kamilion commented Aug 7, 2019

Noted; I don't think I've used the qemu features myself, as I test my ISOs in virtualbox.

I'll check into the code, but for now you can work around it by copying /etc/os-release to /etc/livecd-release in your build directory, and editing livecd-release (customizer will honor it to name the resulting ISO over what it finds in os-release, while ubuntu will continue to use the codenames in os-release for updates.)

I left myself a comment here years ago.
https://github.com/kamilion/customizer/blob/master/src/actions/rebuild.py#L89-L93
I probably messed something up elsewhere for it still to be bytes.

Just below it is the check that handles the above livecd-release check.
https://github.com/kamilion/customizer/blob/master/src/actions/rebuild.py#L95-L104

Oh, yeah. There it is. (the bug)
https://github.com/kamilion/customizer/blob/master/src/actions/qemu.py#L14-L15

Looks like I need to apply the same check in rebuild.py.

@kamilion
Copy link
Owner

kamilion commented Aug 7, 2019

yeah, clearkimura was the last one to touch qemu.py, I've never edited it at all after assuming maintainership until now. Pull master, make deb or whatever, see if the change works.
Can also just pop open qemu.py with a text editor and throw the four lines in to see if your problem evaporated. I'm just so glad I don't have to deal with GAMBAS3 anymore, and I can deal with the relative sanity of Python3.

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