From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ID1SGZckYV+mRwAA0tVLHw (envelope-from ) for ; Tue, 15 Sep 2020 20:31:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mGeME5ckYV/ZBwAAB5/wlQ (envelope-from ) for ; Tue, 15 Sep 2020 20:31:19 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 068EC940714 for ; Tue, 15 Sep 2020 20:31:19 +0000 (UTC) Received: from localhost ([::1]:35704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIHbh-0008Jq-Rn for larch@yhetil.org; Tue, 15 Sep 2020 16:31:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIHaU-0008HA-NK for guix-patches@gnu.org; Tue, 15 Sep 2020 16:30:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49111) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIHaU-0003OR-Dx for guix-patches@gnu.org; Tue, 15 Sep 2020 16:30:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kIHaU-0002X8-Al for guix-patches@gnu.org; Tue, 15 Sep 2020 16:30:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41011] [PATCH] gnu: grub: Support for network boot via TFTP. Resent-From: Stefan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 15 Sep 2020 20:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41011 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: Danny Milosavljevic , 41011@debbugs.gnu.org Received: via spool by 41011-submit@debbugs.gnu.org id=B41011.16002017499626 (code B ref 41011); Tue, 15 Sep 2020 20:30:02 +0000 Received: (at 41011) by debbugs.gnu.org; 15 Sep 2020 20:29:09 +0000 Received: from localhost ([127.0.0.1]:60653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIHZc-0002VC-Vw for submit@debbugs.gnu.org; Tue, 15 Sep 2020 16:29:09 -0400 Received: from vsmx011.vodafonemail.xion.oxcs.net ([153.92.174.89]:52544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIHZb-0002Ul-AD for 41011@debbugs.gnu.org; Tue, 15 Sep 2020 16:29:08 -0400 Received: from vsmx003.vodafonemail.xion.oxcs.net (unknown [192.168.75.197]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id 0445B59D9E3; Tue, 15 Sep 2020 20:29:01 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [188.100.45.56]) by mta-7-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 5C83C539B0A; Tue, 15 Sep 2020 20:28:54 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) From: Stefan In-Reply-To: <20200914065911.GB1717@E5400> Date: Tue, 15 Sep 2020 22:28:53 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <9AAFEFF4-8ACE-4C95-975F-67C3F4FDAF81@vodafonemail.de> <20200906163559.1b56c36f@scratchpost.org> <45F0D825-F888-42E9-BDAE-7BB6FA010A6E@vodafonemail.de> <20200909003732.5c401932@scratchpost.org> <20200914065911.GB1717@E5400> X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -0.51 X-TUID: MSgxoc64jB6n Hi Efraim! >> + (boot-efi-link (match system >> + (("i686" _ ...) "/bootia32.efi") >> + (("x86_64" _ ...) "/bootx64.efi") >> + (("arm" _ ...) "/bootarm.efi") >> + (("armhf" _ ...) "/bootarm.efi") >> + (("aarch64" _ ...) "/bootaa64.efi") >> + (("riscv" _ ...) "/bootriscv32.efi") >> + (("riscv64" _ ...) "/bootriscv64.efi"))) >=20 > Don't forget the fall-through case, even if it's just > ((_ ...) "/bootTODO.efi") There was a contradicting remark by Danny: > The major advantage of using "match" is its failure mode. If the = thing matched > on is not a list (for some unfathomable reason) or if the first = element is not > matched on (!) then you get an exception--which is much better than = doing weird > unknown stuff. Actually I would prefer an error here as well. Imagine a successful = =E2=80=98guix system init=E2=80=99 silently creating a bootTODO.efi. = Booting that system will certainly fail and someone will have a hard = time to figure out that the generated bootTODO.efi is the reason. >> + (efi-bootloader (string-append (match system >> + (("i686" _ ...) = "i386-efi") >> + (("x86_64" _ ...) = "x86_64-efi") >> + (("arm" _ ...) "arm-efi") >> + (("armhf" _ ...) = "arm-efi") >> + (("aarch64" _ ...) = "arm64-efi") >> + (("riscv" _ ...) = "riscv32-efi") >> + (("riscv64" _ ...) = "riscv64-efi")) >> + "/core.efi"))) >=20 > With the fall-through case here, can this be changed to > (("i686" _ ...) "i386-efi") > (("aarch64" _ ...) "arm64-efi") > (("riscv" _ ...) "riscv32-efi") > ((_ ...) (string-append (first > (string-split > (nix-system->gnu-triplet > (or (%current-system) > (%current-target-system))) > #\_)) > "-efi")) There was a contradicting remark by Danny, which applies to the first = part as well: > Also, I have a slight preference for greppable file names even when = it's a > little more redundant I understand your point in generating the arch part. I also understand = the usage of (nix-system->gnu-triplet) to convert armhf to arm. I also = think the risk is low that the first part raises no error and this part = is doing something wrong without raising an error, too, leading to a not = booting system. So having a default here seems fine to me. However, Danny=E2=80=99s argument is convincing, too. And keeping this = block similar to the first block eases the understanding, at least mine. = My first thought seeing your suggestion was: =E2=80=9CWhy does this = block need to be different from the other and what is this code doing = differently?=E2=80=9D What do you think? Bye Stefan