From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1V2n6F-0007wW-P3 for mharc-grub-devel@gnu.org; Fri, 26 Jul 2013 14:50:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2n6A-0007vY-M2 for grub-devel@gnu.org; Fri, 26 Jul 2013 14:50:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2n67-0000mm-FR for grub-devel@gnu.org; Fri, 26 Jul 2013 14:50:42 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:40812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2n67-0000hF-5A for grub-devel@gnu.org; Fri, 26 Jul 2013 14:50:39 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r6QIoYfN020053 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 26 Jul 2013 18:50:35 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6QIoXPx000845 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Jul 2013 18:50:34 GMT Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6QIoX8m000836; Fri, 26 Jul 2013 18:50:33 GMT Received: from [10.159.229.113] (/10.159.229.113) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 26 Jul 2013 11:50:33 -0700 Message-ID: <51F2C4F7.30206@oracle.com> Date: Fri, 26 Jul 2013 14:50:31 -0400 From: konrad wilk Organization: Oracle Corporation User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] remove dependency on /boot/config-* in grub.d/20_linux_xen References: <20130715180006.GA2433@phenom.dumpdata.com> <51F19775.5060305@gmail.com> In-Reply-To: <51F19775.5060305@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-Source-IP: acsinet22.oracle.com [141.146.126.238] Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by userp1040.oracle.com id r6QIoYfN020053 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 Cc: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 18:50:46 -0000 On 7/25/2013 5:24 PM, Vladimir '=CF=86-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=20 > broken unless a good facility for your needs is supplied. In this case=20 > it would be a documentation on how to detect dom0 pv_ops. We could=20 > 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=20 note in it. But then that creates a dependency of grub tools on 'libelf' and that is probably=20 unwise for just one case. I guess one could write a grub-detection code without depending on=20 libelf to do this too? The .Xen ELF header is documented=20 here:http://wiki.xenproject.org/wiki/X86_Paravirtualised_Memory_Managemen= t#Start_Of_Day >> The 20_linux_xen does that however it should not do it. In all fairnes= s >> 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=20 > major distro kernels (no offense for distros but sometimes you need or=20 > prefer customized kernels). > What happens if one tries to load a kernel without pv_ops on top of=20 > 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=20 > and it may happen that xen is inadvertently installed but no pv_ops=20 > kernel is available. With proposed change such setup becomes=20 > needlessly unbootable. Correct. That is the unfortunate part. But I am not sure how different=20 that is from somebody configuring the kernel and forgetting to compile=20 in a SATA controller. If a person does build their customized kernel they should surely know=20 what they would like or not? >> This patch removes said check. >> >> Signed-off-by: Konrad Rzeszutek Wilk >> >> =3D=3D=3D 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=3D`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-*=20 >> /boot/kernel-*; do >> - if grub_file_is_not_garbage "$i"; then >> - basename=3D$(basename $i) >> - version=3D$(echo $basename | sed -e "s,^[^0-9]*-,,g") >> - dirname=3D$(dirname $i) >> - config=3D >> - for j in "${dirname}/config-${version}"=20 >> "${dirname}/config-${alt_version}"=20 >> "/etc/kernels/kernel-config-${version}" ; do >> - if test -e "${j}" ; then >> - config=3D"${j}" >> - break >> - fi >> - done >> - if (grep -qx "CONFIG_XEN_DOM0=3Dy" "${config}" 2> /dev/null |= |=20 >> grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=3Dy" "${config}" 2> /dev/null);=20 >> then echo -n "$i " ; fi >> - fi >> - done` >> + if grub_file_is_not_garbage "$i"; then echo -n "$i "; fi >> + done` >> if [ "x${linux_list}" =3D "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