[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] pygrub, installed with Python 3, doesn't boot Xen DomU-s


  • To: Kevin Buckley <kevin.buckley.ecs.vuw.ac.nz@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 22 Jul 2019 13:55:05 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@xxxxxxxxxx; spf=Pass smtp.mailfrom=Andrew.Cooper3@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Autocrypt: addr=andrew.cooper3@xxxxxxxxxx; prefer-encrypt=mutual; keydata= mQINBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ ISW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8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs 6+ahAA==
  • Cc: Wei Liu <wl@xxxxxxx>, M A Young <m.a.young@xxxxxxxxxxxx>
  • Delivery-date: Mon, 22 Jul 2019 12:55:16 +0000
  • Ironport-sdr: rNVgFuWwBaGyn9/9IXzSr7RQEKbqtFx1VyzcRutf8TWZX0tHRbFczLbnb/abXSaYb0BUT/LmoU TZBLn1fodzWCPr2qLbO+DiQ2wxixrWiyuudgH6Fitdg2FhqhhHkafxduSdcqlQz54tBjUQix7m vQjRJNfg/oUwZV5aUlgGuUxXduz9GZ6ApaYKFo54qcP/x8lO5qy5HOQIDj+mHE7rwI5iT0QaQO lme+FuVgledlQr7j+JZoResm5eC+yq97P+wxtYs85HrSSnlnj8oHPIwrRIy9/dwrwLzhaCOA/U RNA=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Openpgp: preference=signencrypt

On 22/07/2019 03:57, Kevin Buckley wrote:
> This follows on from
>
> pygrub gives "raise RuntimeError("Unable to find partition containing 
> kernel")"
>
> https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg01589.html
>
> and for some reason I submitted my latest findings onto the grub-devel list,
> only to be reminded that pygrub is part of Xen, not Grub, so reposting here:
>
>
> OK, so I am trying to build an LFS (Linux From Scratch) system that
> will serve as a basic Xen Dom0.
>
> You can see the way things have been compiled, including my UEFI-aware
> Grub, here (Very much a WIP)
>
>   http://youvegotbuckleys.org.nz/LFS/LFS-BOOK.html

Having a quick read through, I think the pkgcfg issue mentioned was
fixed by
https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=a0f981451509bf83af153038d35079c4e62dc1cf

If you pull up to a newer version of master, it ought to work as you expect.

>
>
> Suffice it to say that the LFS Grub boots either of the two
> UEFI enties (non-Xen and Dom0) I have so as to bring up the
> system.
>
>
> I also have a couple of VBD-backed DomU-s that I can bring up,
> using the pygrub from either an Ubuntu 1404, or a Centos 6.10
> with Xen4Centos, Dom0.
>
> When I come to try and have my LFS Xen's pygrub boot the VBD-backed
> DomU, I get errors of the form
>
>
> # cat /mnt/var/log/xen/bootloader.4.log
> Using <class 'grub.GrubConf.Grub2ConfigFile'> to parse /boot/grub/grub.cfg
> Traceback (most recent call last):
>   File "/usr/lib/xen/bin/pygrub", line 928, in <module>
>     raise RuntimeError("Unable to find partition containing kernel")
> RuntimeError: Unable to find partition containing kernel
>
> I originally thought that this might be down to my using a Xen
> source from the Xen Git repo that was in beyond 4.12 (which I
> needed so to get a Xen that was happy with just Python3. See
>  https://lists.xenproject.org/archives/html/xen-devel/2019-04/msg00996.html
> ) and had prhaps had tripped over a regression, as that error used
> to be a problem with Xen (if you go back far enough).
>
>
> However I have since tracked down my problem to the pygrub, in
> that if I point pygrub to the start of the partition in the VBD
> that has the grub.cfg in it, I see the following failure to parse
> the config file:
>
>
> bash-5.0# /usr/lib/xen/bin/pygrub --debug --offset=1048576
> --list-entries /dev/vg_xen_vbds/lv_4g_02
> Using <class 'grub.GrubConf.Grub2ConfigFile'> to parse /boot/grub/grub.cfg
> Traceback (most recent call last):
>   File "/usr/lib/xen/bin/pygrub", line 907, in <module>
>     chosencfg = run_grub(file, entry, fs, incfg["args"])
>   File "/usr/lib/xen/bin/pygrub", line 625, in run_grub
>     g = Grub(file, fs)
>   File "/usr/lib/xen/bin/pygrub", line 249, in __init__
>     self.read_config(file, fs)
>   File "/usr/lib/xen/bin/pygrub", line 460, in read_config
>     self.cf.parse(buf)
>   File "/usr/lib/python3.7/site-packages/grub/GrubConf.py", line 376, in parse
>     lines = buf.split("\n")
> TypeError: a bytes-like object is required, not 'str'
>
>
> whereas if I do the same with the pygrub from the CentOs6.10/Xen4Centos
> environment, I see
>
>
> /usr/bin/pygrub  --debug --offset=1048576 --list-entries
> /dev/vg_xen_vbds/lv_4g_02
> title: Ubuntu
>   root: None
>   kernel: /boot/vmlinuz-4.4.0-31-generic
>   args: root=/dev/xvda1 ro  quiet splash $vt_handoff
>   initrd: /boot/initrd.img-4.4.0-31-generic
> title: Ubuntu, with Linux 4.4.0-31-generic
>   root: None
>   kernel: /boot/vmlinuz-4.4.0-31-generic
>   args: root=UUID=5556a819-ced8-4864-9e7f-73792570703e ro  quiet
> splash $vt_handoff
>   initrd: /boot/initrd.img-4.4.0-31-generic
> title: Ubuntu, with Linux 4.4.0-31-generic (recovery mode)
>   root: None
>   kernel: /boot/vmlinuz-4.4.0-31-generic
>   args: root=UUID=5556a819-ced8-4864-9e7f-73792570703e ro recovery nomodeset
>   initrd: /boot/initrd.img-4.4.0-31-generic
> Using <class 'grub.GrubConf.Grub2ConfigFile'> to parse /boot/grub/grub.cfg
> INFO:root:Ignored directive if
> INFO:root:Ignored directive load_env
> INFO:root:Ignored directive fi
> INFO:root:Ignored directive if
> WARNING:root:grub2's saved_entry/next_entry not supported
> INFO:root:Ignored directive save_env
> ...
>
>
> and it goes on and suceeds.
>
> Ok, so then I went hunting around for the cause of the error
> I was seeing on the LFS system and got pointed towards the
> cause being a Pythin2->3 issue, with the way 3 now differentiates
> between strings and bytes.

Yes - this looks like a Py 2/3 compatibility issue.  This particular one
is related to
https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=ff915c8cacc264ae1380d51fea07267b8308d7ba

However, I can't explain why python is complaining at str.split(). 
split() is a string operation, not a bytes operation.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.