From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aEFd6-0003TJ-VT for mharc-grub-devel@gnu.org; Wed, 30 Dec 2015 07:13:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEFd3-0003Rz-Pn for grub-devel@gnu.org; Wed, 30 Dec 2015 07:13:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aEFd2-00057P-Qj for grub-devel@gnu.org; Wed, 30 Dec 2015 07:13:21 -0500 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:34534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEFd2-000577-KS for grub-devel@gnu.org; Wed, 30 Dec 2015 07:13:20 -0500 Received: by mail-wm0-x22c.google.com with SMTP id u188so37627900wmu.1 for ; Wed, 30 Dec 2015 04:13:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=X9ZVzrIFIi5b6nKp4i7TW+vrc2y9nn89CL/XBq6qQYo=; b=0uys9uLKxDBPkFTYwfedcSQ0n/mZnKLRgxPuwQ8FpLhcrHRN3eXCFWdA2o7CUVv+Tj 10m2LeDpXOOujhhO7BZo6X27Ln/8gA+D/3hpr9vLQv+MlUqD70BCMNs6JVX9+7WLQ49K y5dkOv9jDVW4Cl5dk7ZNC69+LX0IZ1BJW9G9LIwRf7y/AUzEfFd+jmVmUKrNekUrvNVJ HYJSmpTxvfW1LtNaQ6FElc1vkUP2NG4cYk/crbP2EpvA28ydjWnZJS0I2Ie9xO+PRocq l35ikadSInRGz3IKBjbMBHT1v/X/FhTHiiJWL+X1OJvZop7GS/cZAyADgAe3BOKJo3o7 nIFw== X-Received: by 10.194.87.201 with SMTP id ba9mr70902609wjb.125.1451477600111; Wed, 30 Dec 2015 04:13:20 -0800 (PST) Received: from ?IPv6:2a02:120b:2c2b:b80:a2a8:cdff:fe64:b3b5? ([2a02:120b:2c2b:b80:a2a8:cdff:fe64:b3b5]) by smtp.gmail.com with ESMTPSA id x10sm30859035wjx.8.2015.12.30.04.13.18 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Dec 2015 04:13:19 -0800 (PST) Subject: Re: [PATCH] 30_os-prober: derive --class from os-prober generated label To: The development of GNU GRUB References: <1451113768-16100-1-git-send-email-arvidjaar@gmail.com> From: =?UTF-8?Q?Vladimir_'=cf=86-coder/phcoder'_Serbinenko?= Message-ID: <5683CA58.2010202@gmail.com> Date: Wed, 30 Dec 2015 13:13:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.4.0 MIME-Version: 1.0 In-Reply-To: <1451113768-16100-1-git-send-email-arvidjaar@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GwLs9upCCRn1pFeGbVPo8569AsdT3Qh9c" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22c 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: Wed, 30 Dec 2015 12:13:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --GwLs9upCCRn1pFeGbVPo8569AsdT3Qh9c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Go ahead On 26.12.2015 08:09, Andrey Borzenkov wrote: > Currently only Windows gets distinguished icons, everything else is dis= played > using the same generic one. Add additional --class based on os-prober r= eturned > label, which usually is expected to match primary distribution name. >=20 > Also use it for Windows as well - chainloader prober nay actually retur= n > different strings (Windows, MS-DOS, Windows9xME). >=20 > --- > util/grub.d/30_os-prober.in | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) >=20 > diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in > index 5fc4f0c..5604ce2 100644 > --- a/util/grub.d/30_os-prober.in > +++ b/util/grub.d/30_os-prober.in > @@ -135,6 +135,9 @@ for OS in ${OSPROBED} ; do > LONGNAME=3D"${LABEL}" > fi > =20 > + # os-prober returns text string followed by optional counter > + CLASS=3D"--class $(echo "${LABEL}" | LC_ALL=3DC sed 's,[[:digit:]]*$= ,,' | cut -d' ' -f1 | tr 'A-Z' 'a-z' | LC_ALL=3DC sed 's,[^[:alnum:]_],_,= g')" > + > gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2 > =20 > case ${BOOT} in > @@ -142,7 +145,7 @@ for OS in ${OSPROBED} ; do > =20 > onstr=3D"$(gettext_printf "(on %s)" "${DEVICE}")" > cat << EOF > -menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows = --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${= DEVICE}")' { > +menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class o= s \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")= ' { > EOF > save_default_entry | grub_add_tab > prepare_grub_to_access_device ${DEVICE} | grub_add_tab > @@ -174,7 +177,7 @@ EOF > DEVICE=3D${DEVICE%@*} > onstr=3D"$(gettext_printf "(on %s)" "${DEVICE}")" > cat << EOF > -menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows = --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DE= VICE}")' { > +menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class o= s \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' = { > EOF > save_default_entry | sed -e "s/^/\t/" > prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" > @@ -230,7 +233,7 @@ EOF > =20 > if [ "x$is_top_level" =3D xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" !=3D= xy ]; then > cat << EOF > -menuentry '$(echo "$OS $onstr" | grub_quote)' --class gnu-linux --clas= s gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_de= vice_id' { > +menuentry '$(echo "$OS $onstr" | grub_quote)' $CLASS --class gnu-linux= --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$= boot_device_id' { > EOF > save_default_entry | grub_add_tab > printf '%s\n' "${prepare_boot_cache}" >=20 --GwLs9upCCRn1pFeGbVPo8569AsdT3Qh9c 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 iF4EAREKAAYFAlaDylgACgkQmBXlbbo5nOsMzAEAn2bA7c5lg/I8lH+xPBDew6CV 3ywUPIA7R4zgUeodqHMA/0iDpL1fUgIkCTYM2IyxJybXNkYTfa7zdrqdZ5sYAk22 =3V+S -----END PGP SIGNATURE----- --GwLs9upCCRn1pFeGbVPo8569AsdT3Qh9c--