From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nceTF-0004uf-8I for mharc-grub-devel@gnu.org; Thu, 07 Apr 2022 22:35:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nceTC-0004tP-Qe for grub-devel@gnu.org; Thu, 07 Apr 2022 22:35:32 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:34436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nceTA-0006UJ-8x for grub-devel@gnu.org; Thu, 07 Apr 2022 22:35:29 -0400 Received: by mail-lf1-x134.google.com with SMTP id x33so6315993lfu.1 for ; Thu, 07 Apr 2022 19:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=tZGKyc8lTGxZg4zPMS5uAvSJOndcKasIqtBHAkCa84I=; b=pN55RLKJ1WioZoa93BWEXNdteucLlIRGiA/R/V3eAMmhnVj/B0mtyn/e/111hJ9tXL /LlFqHHA+Bs1aWxEiDWFDGJuHDMEaeYILZH1Tnq0amFKfrao9dNyAD6qaWK93X5F+fKJ UC/4f2cUO2kG8NLxLnOOvgwILMcs45b8/eDypPF/8YVjClLiCXahii96OlvU0ge715ej 6v6QeJdNg/fJCxHde0XFWweAx6y6c39SvfdYT/cXR62v9wlI4Tg2Jo8TQ+x8X5gDw5o+ J5covrbvSXUVPgKSoLJCe73ELkSRyz1ezSeExyyJww9b5URxlkOVUUHzDF4FN4GwYcuG L5vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=tZGKyc8lTGxZg4zPMS5uAvSJOndcKasIqtBHAkCa84I=; b=HdXXlZyOv7Gn918MuqAKd1dz3Tap8N61PMPwHHU6JtrZP9ASSfleF66R3SB5C2ReWB AtMZCVmBE6xogkLDUwxMvPOir+gQSrLnkKBHa8Tuc6i4SLMHvxoDCi/N31c0c09cKmvS iMrzWL+qFnElkDwV3Q5MSHdDXrfKseOGWB7zed2sRpWfpLmdWHoEQ5ulZr5IK0VcgCZU HIcdJ2REseTStMzsM0rthQyKPbvLXuVIkf1KtFcTWwv3hGyM3A5NiNdwv6ZFD6BpkW4a gTl/HpiGG/BxiZpWm4muA2bojmT/D1lNHbyDKHioBrf66dN1sWpodpsHJ3ALuLZQSWsc kiYg== X-Gm-Message-State: AOAM530IO0w9oJo4u4ZAc36ZJuhy3aKXWvfPqndshwt0DW1OcSrXjOLJ PWbW4HBcNUCnkDulO/fTAQzqqzCRE0I= X-Google-Smtp-Source: ABdhPJzOtT8Cn+csDRIPCBok+otXDZzQtdPlbVvp3Lku83rif7uVbpZthw1Ev0EQBVtgq8TqN3zBzg== X-Received: by 2002:a05:6512:238f:b0:44a:2440:2f23 with SMTP id c15-20020a056512238f00b0044a24402f23mr11365178lfv.321.1649385324092; Thu, 07 Apr 2022 19:35:24 -0700 (PDT) Received: from dj3ntoo (160.sub-72-110-43.myvzw.com. [72.110.43.160]) by smtp.gmail.com with ESMTPSA id h16-20020a19ca50000000b0044a25081cf9sm2316603lfj.133.2022.04.07.19.35.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 19:35:23 -0700 (PDT) Date: Thu, 7 Apr 2022 21:35:19 -0500 From: Oskari Pirhonen To: grub-devel@gnu.org Subject: Re: [PATCH v2] util/grub.d/linux: Improve initramfs detection Message-ID: Mail-Followup-To: grub-devel@gnu.org References: <20220407154418.phb77brvyzmhbyfi@tomti.i.net-space.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZgHrO7/9FW2+k4O5" Content-Disposition: inline In-Reply-To: <20220407154418.phb77brvyzmhbyfi@tomti.i.net-space.pl> Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=xxc3ncoredxx@gmail.com; helo=mail-lf1-x134.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2022 02:35:32 -0000 --ZgHrO7/9FW2+k4O5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 07, 2022 at 05:44:18PM +0200, Daniel Kiper wrote: > On Sun, Mar 27, 2022 at 10:41:31PM -0500, Oskari Pirhonen wrote: > > Add detection for initramfs of the form *.img.old. For example, Gentoo's > > sys-kernel/genkernel installs it as initramfs-*.img and moves any > > existing one to initramfs-*.img.old. >=20 > You are mentioning initramfs* files but the patch adds also initrd* > files. Could you explain that in the commit message? Yeah, I can do that. >=20 > > Signed-off-by: Oskari Pirhonen >=20 > You are breaking indention in the patch. >=20 > > --- > > v1 -> v2: > > - don't reorder the checks > > - include 20_linux_xen.in > > > > util/grub.d/10_linux.in | 17 +++++++++-------- > > util/grub.d/20_linux_xen.in | 29 +++++++++++++++-------------- > > 2 files changed, 24 insertions(+), 22 deletions(-) > > > > diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in > > index ca068038e..cb049e943 100644 > > --- a/util/grub.d/10_linux.in > > +++ b/util/grub.d/10_linux.in > > @@ -215,14 +215,15 @@ while [ "x$list" !=3D "x" ] ; do > > done > > > > initrd_real=3D > > - for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${v= ersion}.gz" \ > > - "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}" \ > > - "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ > > - "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do > > + for i in "initrd.img-${version}" "initrd-${version}.img" \ > > + "initrd-${alt_version}.img.old" "initrd-${version}.gz" \ > > + "initrd-${alt_version}.gz.old" "initrd-${version}" \ > > + "initramfs-${version}.img" "initramfs-${alt_version}.img.old" \ > > + "initrd.img-${alt_version}" "initrd-${alt_version}.img" \ > > + "initrd-${alt_version}" "initramfs-${alt_version}.img" \ > > + "initramfs-genkernel-${version}" "initramfs-genkernel-${alt_ve= rsion}" \ > > + "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ >=20 > Here... >=20 > > + "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do >=20 > Ditto... >=20 > > if test -e "${dirname}/${i}" ; then > > initrd_real=3D"${i}" > > break > > diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in > > index f45559ff8..5a1b7b7d4 100644 > > --- a/util/grub.d/20_linux_xen.in > > +++ b/util/grub.d/20_linux_xen.in > > @@ -283,20 +283,21 @@ while [ "x${xen_list}" !=3D "x" ] ; do > > alt_version=3D`echo $version | sed -e "s,\.old$,,g"` > > linux_root_device_thisversion=3D"${LINUX_ROOT_DEVICE}" > > > > - initrd_real=3D > > - for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${ve= rsion}.gz" \ > > - "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}" \ > > - "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ > > - "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" ; do > > - if test -e "${dirname}/${i}" ; then > > - initrd_real=3D"$i" > > - break > > - fi > > - done > > + initrd_real=3D >=20 > And here... >=20 > > + for i in "initrd.img-${version}" "initrd-${version}.img" \ > > + "initrd-${alt_version}.img.old" "initrd-${version}.gz" \ > > + "initrd-${alt_version}.gz.old" "initrd-${version}" \ > > + "initramfs-${version}.img" "initramfs-${alt_version}.img.old" \ > > + "initrd.img-${alt_version}" "initrd-${alt_version}.img" \ > > + "initrd-${alt_version}" "initramfs-${alt_version}.img" \ > > + "initramfs-genkernel-${version}" "initramfs-genkernel-${alt_ve= rsion}" \ >=20 > I would leave these two file names in separate lines. Same above... OK. >=20 > > + "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ > > + "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do > > + if test -e "${dirname}/${i}" ; then > > + initrd_real=3D"${i}" > > + break > > + fi > > + done >=20 > Again, broken indention... It is almost in every line of this patch. That is actually something I wanted to address in a separate thread. The indentation/style feels kind of all over the place in the few files in grub.d/ that I glanced at. Some lines are indented with spaces, others with tabs. Sometimes variables are substituted with $var, other times with ${var}. Sometimes if [ ... ] is used, other times if test ... is. If there isn't already an existing style guide that I can reference, I would like to establish one and then re-style these scripts to be consistent with that. But it'd have to be a separate endeavor in that case. In the meantime, how would you like me to indent the lines in this patch? - Oskari >=20 > Daniel >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel --ZgHrO7/9FW2+k4O5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQfOU+JeXjo4uxN6vCp8he9GGIfEQUCYk+fYQAKCRCp8he9GGIf EcUHAQCwizZQ7AZv3cF1WlkG5jTMC9RZuAv8h3f/fHQrKgshNQD8CJq2qzjc7RPy TfXcBMrMe1F3/hq/zN+ydvW1NE30Pw4= =Yi7z -----END PGP SIGNATURE----- --ZgHrO7/9FW2+k4O5--