From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 15 16:29:09 2020 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\)) Subject: Re: [bug#41011] [PATCH] gnu: grub: Support for network boot via TFTP. 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> To: Efraim Flashner X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41011 Cc: Danny Milosavljevic , 41011@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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