From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SJF5q-0004CZ-PY for mharc-grub-devel@gnu.org; Sat, 14 Apr 2012 22:21:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJF5n-0004Be-DB for grub-devel@gnu.org; Sat, 14 Apr 2012 22:21:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJF5l-0006QL-5T for grub-devel@gnu.org; Sat, 14 Apr 2012 22:21:30 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:49754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJF5k-0006Ph-SG for grub-devel@gnu.org; Sat, 14 Apr 2012 22:21:29 -0400 Received: from [192.168.0.4] (d14-69-47-19.try.wideopenwest.com [69.14.19.47]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id 2507B1B404E for ; Sun, 15 Apr 2012 02:21:24 +0000 (UTC) Message-ID: <4F8A30A0.7060401@gentoo.org> Date: Sat, 14 Apr 2012 22:21:20 -0400 From: Mike Gilbert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: Improve support for genkernel in 10_linux References: <4F80B7AE.9000607@gentoo.org> <4F84F2D4.9030305@gentoo.org> <4F857384.10907@gmail.com> In-Reply-To: X-Enigmail-Version: 1.4 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig61EDA9C7B06F848CCD85774E" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 140.211.166.183 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: Sun, 15 Apr 2012 02:21:32 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig61EDA9C7B06F848CCD85774E Content-Type: multipart/mixed; boundary="------------000201020201050504030705" This is a multi-part message in MIME format. --------------000201020201050504030705 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/11/2012 11:52 AM, Mike Gilbert wrote: > 2012/4/11 Vladimir '=CF=86-coder/phcoder' Serbinenko : >> On 11.04.2012 04:56, Mike Gilbert wrote: >>> On 04/07/2012 05:54 PM, Mike Gilbert wrote: >>>> Secondly, genkernel looks for the "real_root" kernel command line op= tion >>>> to determine the root filesystem. This is a holdover from the days w= hen >>>> we used true initrd images and we needed to use root=3D/dev/ram0. >>>> >>> It was brought to my attention that genkernel's initramfs code will i= n >>> fact utilize "root" if "real_root" is unset. This part of my previous= >>> patch is therefore pointless. >>> >>> I have attached a revised patch containing only the changes necessary= to >>> detect a genkernel initramfs image. >>> >> pushd/popd isn't POSIX so we can't use it in our scripts. Also I don't= >> feel like glob expansion is the right thing to use here. Why not infer= >> the architecture from uname ? >=20 > That should also work. Here's the logic that genkernel uses to populate= ARCH: >=20 > ARCH=3D`uname -m` > case "${ARCH}" in > i?86) > ARCH=3D"x86" > ;; > mips|mips64) > ARCH=3D"mips" > ;; > arm*) > ARCH=3Darm > ;; > *) > ;; > esac >=20 > I'm thinking it would be a good idea to rename ARCH to something like > GENKERNEL_ARCH. We should also let the user override this in > /etc/default/grub. >=20 > Does that sound ok? I have modified my patch to implement what I describe above. --------------000201020201050504030705 Content-Type: text/x-patch; name="grub-2.00-genkernel.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="grub-2.00-genkernel.patch" =3D=3D=3D modified file 'ChangeLog' --- ChangeLog 2012-04-07 18:11:04 +0000 +++ ChangeLog 2012-04-11 19:51:47 +0000 @@ -1,3 +1,7 @@ +2012-04-11 Mike Gilbert + + * util/grub.d/10_linux.in: Fix detection of genkernel initramfs. + 2012-04-07 Vladimir Serbinenko =20 * grub-core/normal/charset.c (grub_ucs4_to_utf8): Return number of =3D=3D=3D modified file 'util/grub.d/10_linux.in' --- util/grub.d/10_linux.in 2012-03-10 14:21:25 +0000 +++ util/grub.d/10_linux.in 2012-04-11 19:26:45 +0000 @@ -150,7 +150,8 @@ EOF } =20 -case x`uname -m` in +machine=3D`uname -m` +case "x$machine" in xi?86 | xx86_64) list=3D`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do if grub_file_is_not_garbage "$i" ; then echo -n "$i " = ; fi @@ -161,6 +162,15 @@ done` ;; esac =20 +if test "x${GENKERNEL_ARCH-unset}" =3D xunset; then + case "$machine" in + i?86) GENKERNEL_ARCH=3D"x86" ;; + mips|mips64) GENKERNEL_ARCH=3D"mips" ;; + arm*) GENKERNEL_ARCH=3D"arm" ;; + *) GENKERNEL_ARCH=3D"$machine" ;; + esac +fi + prepare_boot_cache=3D prepare_root_cache=3D boot_device_id=3D @@ -186,8 +196,8 @@ "initrd-${version}" "initramfs-${version}.img" \ "initrd.img-${alt_version}" "initrd-${alt_version}.img" \ "initrd-${alt_version}" "initramfs-${alt_version}.img" \ - "initramfs-genkernel-${version}" \ - "initramfs-genkernel-${alt_version}"; do + "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ + "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do if test -e "${dirname}/${i}" ; then initrd=3D"$i" break --------------000201020201050504030705-- --------------enig61EDA9C7B06F848CCD85774E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iF4EAREIAAYFAk+KMKAACgkQC77qH+pIQ6SdkAD6AjYFTdmx1S8F0Zm7Hev0fD08 zSA9QfdRbO92i3PwGIoBAKbnOhPEDkJpb4OmUP3VjR7GaUmD9aOWpkj2PNURj5OX =743o -----END PGP SIGNATURE----- --------------enig61EDA9C7B06F848CCD85774E--