All of lore.kernel.org
 help / color / mirror / Atom feed
From: konrad wilk <konrad.wilk@oracle.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
Subject: Re: [PATCH] remove dependency on /boot/config-* in grub.d/20_linux_xen
Date: Fri, 26 Jul 2013 14:50:31 -0400	[thread overview]
Message-ID: <51F2C4F7.30206@oracle.com> (raw)
In-Reply-To: <51F19775.5060305@gmail.com>


On 7/25/2013 5:24 PM, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 15.07.2013 20:00, Konrad Rzeszutek Wilk wrote:
>> Hey,
>>
>> There is a discussion on the linux-kernel mailing list in which the
>> Linus states that "if you depend on any config file, you're broken
>> by definition" (https://lkml.org/lkml/2013/7/15/368).
>>
> The world is broken by definition sometimes you just can't avoid being 
> broken unless a good facility for your needs is supplied. In this case 
> it would be a documentation on how to detect dom0 pv_ops. We could 
> ship a detector as a GRUB tool if appropriate documentation is provided.
One suggestion was to use readelf to see if the binary has an .Xen ELF 
note in it. But then
that creates a dependency of grub tools on 'libelf' and that is probably 
unwise for just one
case. I guess one could write a grub-detection code without depending on 
libelf to do this too?

The .Xen ELF header is documented 
here:http://wiki.xenproject.org/wiki/X86_Paravirtualised_Memory_Management#Start_Of_Day

>> The 20_linux_xen does that however it should not do it. In all fairness
>> this check is a bit of old as pretty much any upstream kernel
>> is being built by default from distros to boot with Xen. If it does
>> not, Xen will print a message telling the user that Linux does not
>> have the required components.
>>
> It depends on kernel config. Not everybody uses one-size-fits-all 
> major distro kernels (no offense for distros but sometimes you need or 
> prefer customized kernels).
> What happens if one tries to load a kernel without pv_ops on top of 
> xen? Does he at least get a decent error message or just black screen?
Yes, there is an decent error message on the VGA console.
> Some distros increase xen_linux priority above those of standard linux 
> and it may happen that xen is inadvertently installed but no pv_ops 
> kernel is available. With proposed change such setup becomes 
> needlessly unbootable.
Correct. That is the unfortunate part. But I am not sure how different 
that is from somebody configuring the kernel and forgetting to compile 
in a SATA controller.
If a person does build their customized kernel they should surely know 
what they would like or not?

>> This patch removes said check.
>>
>> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>
>> === modified file 'util/grub.d/20_linux_xen.in'
>> --- util/grub.d/20_linux_xen.in    2013-03-24 13:03:33 +0000
>> +++ util/grub.d/20_linux_xen.in    2013-07-15 17:34:32 +0000
>> @@ -144,20 +144,8 @@
>>   }
>>
>>   linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* 
>> /boot/kernel-*; do
>> -    if grub_file_is_not_garbage "$i"; then
>> -        basename=$(basename $i)
>> -    version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
>> -    dirname=$(dirname $i)
>> -    config=
>> -    for j in "${dirname}/config-${version}" 
>> "${dirname}/config-${alt_version}" 
>> "/etc/kernels/kernel-config-${version}" ; do
>> -        if test -e "${j}" ; then
>> -        config="${j}"
>> -        break
>> -        fi
>> -    done
>> -        if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || 
>> grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); 
>> then echo -n "$i " ; fi
>> -    fi
>> -    done`
>> +    if grub_file_is_not_garbage "$i"; then echo -n "$i "; fi
>> +        done`
>>   if [ "x${linux_list}" = "x" ] ; then
>>       exit 0
>>   fi
>>
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/grub-devel
>>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel



  reply	other threads:[~2013-07-26 18:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15 18:00 [PATCH] remove dependency on /boot/config-* in grub.d/20_linux_xen Konrad Rzeszutek Wilk
2013-07-25 21:24 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-07-26 18:50   ` konrad wilk [this message]
2013-07-26 19:02     ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-07-29 14:52       ` Konrad Rzeszutek Wilk
2013-07-29 16:52         ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-10 20:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-11 13:51   ` Konrad Rzeszutek Wilk
2013-11-13 13:56   ` Konrad Rzeszutek Wilk
2013-11-13 13:56     ` Konrad Rzeszutek Wilk
2013-11-14 11:50     ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-14 11:50       ` Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51F2C4F7.30206@oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=grub-devel@gnu.org \
    --cc=phcoder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.