From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sMzhAJyY52N5ZAAAbAwnHQ (envelope-from ) for ; Sat, 11 Feb 2023 14:31:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MClgAJyY52MVZAEAauVa8A (envelope-from ) for ; Sat, 11 Feb 2023 14:31:08 +0100 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 7B0E62C612 for ; Sat, 11 Feb 2023 14:31:07 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQpxa-00059D-PD; Sat, 11 Feb 2023 08:30:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQDBC-0000ez-9K for bug-guix@gnu.org; Thu, 09 Feb 2023 15:06:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQDBC-0001yo-11 for bug-guix@gnu.org; Thu, 09 Feb 2023 15:06:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pQDBB-0006Ns-SI for bug-guix@gnu.org; Thu, 09 Feb 2023 15:06:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#54528: [PATCH] fix store-prefix for menu-entries References: <87v8w51yny.fsf@gmail.com> In-Reply-To: <87v8w51yny.fsf@gmail.com> Resent-From: Stefan Karrmann Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 09 Feb 2023 20:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54528 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 54528@debbugs.gnu.org Received: via spool by 54528-submit@debbugs.gnu.org id=B54528.167597312024476 (code B ref 54528); Thu, 09 Feb 2023 20:06:01 +0000 Received: (at 54528) by debbugs.gnu.org; 9 Feb 2023 20:05:20 +0000 Received: from localhost ([127.0.0.1]:33826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQDAW-0006Mi-9L for submit@debbugs.gnu.org; Thu, 09 Feb 2023 15:05:20 -0500 Received: from mout.web.de ([212.227.15.3]:57797) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQDAU-0006MQ-7G for 54528@debbugs.gnu.org; Thu, 09 Feb 2023 15:05:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1675973112; bh=8eK+OQsynl2bmEtK64a6xyJUgvgeiHcVBAnl5Fc2Czk=; h=X-UI-Sender-Class:Date:From:To:Subject; b=Z04Il//3jazoANwf+NmvK2uEbyAyw17/XGKM0GUMSr6AoOeCyf0oLmYc6xdajAWTm vAs090hbG9dV7oQZKbGmnFAuctsoau0+XBJHdWakhCNpXDklS8yaULx6uJfFv00UOs D75bYjmwQAlVA903dfdoI0Fw2u5obAmSeZpaLwPNlfHtWoGALG0HQYlAZCeeizgEtT moO38xo+hjzN+HKiVFHc2VvH2+jxj+GwaOrkP2nLbIutIwwNODI67cGWjs1c0SNkYQ 66tSARpD52eeg43pS+5LcQC0zoa5Uci7ePNHlLbsyYY4NIW7ChYMZbqHKwSlFX6kc9 MqNe01eTaImJA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from localhost ([188.98.113.37]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N1d7s-1oSvT60fPs-0122fD for <54528@debbugs.gnu.org>; Thu, 09 Feb 2023 21:05:12 +0100 Date: Thu, 9 Feb 2023 21:05:09 +0100 From: Stefan Karrmann Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2WUJwI1uGCBXFW+S" Content-Disposition: inline X-Provags-ID: V03:K1:RwP7qUwyZdgsbuPKohz31QJRoeL1EtxO4sCnf2Rf4NQp4RtSCJa DCATOLok/6Oia8tLrHWvQD9OwjK5bUxRJx8j9Ju7UsyAf4RWJCI0txOQRJrFbjbbcyB0Hml WdIk/t9PniWRlVlR01IWtg7mUqhy2/cXwmmywjJjpeXiX2JjbmUSFCnb/pkc56R+Q5JkNex GwMYpAvtuhG+qJqn6E8oQ== UI-OutboundReport: notjunk:1;M01:P0:ahlxntbRn5M=;u9fcQ7lc2rRI7MoFm8lleDNlJ4G YyrIli7dem1KL4/aLOrjyvmUKwddJGERw2Eg49nmyh21LMPidMQ+wIS5ViSsDdyRIfNaAcuF4 Mm2/bQ5PZQ49mCnC/Dgtquy5Sh8b0dRSo0+QAcq3RgtDIEzZcj64jqC6CKsVNPPWAZc80P9wc /AJlcOlNMDAmDJFKyJfPr6Hppn5y1oawA5GnW0aa2bPuCZO60X/+7igcNtZe9s3iWOkReTZd0 r5GRFrIQphS2R+JTsdcaBA3wJphNpzDnSbnsx6eZ1bReIXf3jFwNL1vexf9AXc/7xXFlEBLBd DFLvoN3qh26mWl0CRaqeuK4l8+wsY7YxqnYtJKJTv9q9501FryetZ8yL0sxHSTLQkwyYB3yaL 7ubLtrAEWyan5ThOe75tvDQtjZuGUqkxirEnR+Gp3SSBBDUeDHy2sulFrpQXIEiy8HaHfxfnP +26GsosjlEJTiEBreDCLLDuh5LCtP22m2hTct5oWRE5vdP01dVG1kExQUMeh4KOcWQ/3yNRcX PJ1zLWjcumrV/HfIthHFyZ2O1eCRYdAkaTuHycOtaN2SWqt1opjW+rnKVs+4Jkz8RLaOPOIH8 rZ2Xhtw1jH6Y1AtNUL193TaAcWUBZriuCVDRZIrOBxyHZ3SnJpyTL1V69ZEc/1jaOOElN+4s9 7E4T87bTALZW17Cmc7QNZQGd157yuYKOWszgmQKpdppZ3STDo3/EIWRWXFIStbaRS6VQAAQ7x yVjo3V5Dy4jbTQRm0RIhqmsEPpEYNJQ7dJfluM7G1DJbgjzW2R53A0LGX6VqApvGSeBSlKRGP ZOj1J6VgHWlQdX0h5WYmiVdGVwnEC+GWpBJAXITSZfPXdhBtRC0PYH+k76OFACPby5QPxNp+S K1GBa9Txn3O4tShTBBmruJjvii1S5r+fVGMekyT85/4VR/B/vJvD/0G+7zdI5BglYxbcaICy3 /X3B2A== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sat, 11 Feb 2023 08:30:20 -0500 X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=web.de header.s=s29768273 header.b="Z04Il//3"; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=web.de (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676122267; a=rsa-sha256; cv=none; b=JBBhjjHuDaV/pSITgOI+DIeGDWcCaRclpvAdlq5J0E3Apvx/8meUdpA7CBGNSBh4Dv90AN CLd9Uq0+OzbF1sworMEGsj1X474oUARPqxHySkxsCoS+Sib0diS05gVhGiNjCZY3bEY7fB pj/Utn2wNlqbm/Ezknrsesn1UtOYG2l2jhGhnT/h/wV2LfbF58FqlEDzYV4/LLYunDOdZ6 RNVmBL9NxppSWuyzynm009MDYeYUwN3p4HmSRL2ZNWgewHfJBb9gtEMSla1tKXeTpJb76Q GWKWdPyuiBsHgT0uS7cUq2IgVhnTbnc4UfwXMEtUWCOg15TNFbiYpV6OeOuG+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676122267; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=OVDzl5e/cP+d3yBJS2i/ZcSIy2TTEQrT/Tv+XZMbB6w=; b=N5puxM0A5gtzd2Yb+m0CPEMyWV2wHIcOGC2Gjr9ptJzcTUnUg5Oq6P+OT+D47zK6YOdChO YCRH3ZEXmPslfOAvVX0He/cMScjaE7hzYNc6LRzvSi43p7nrkALwGcdfsFRgVsY1iEw6er dfxtRhvrX86Es4cQUTnNqKbckclzaEL7vfGoqcqXIauw6ZnuvjqJlehjM1I0o2/4YOhnZQ Ef8iki6dD4ZgCdN4EcoH5osX8tnX1zODOcC5hSKH0ZrQRkvgd9VgvmlEqHLsgE49Jo/1GF RpM71MJrF+xPNEI1WN/FLpCBN7Af1oXSpYJL01p8nskluP2/mbXGRwsX2PbNag== X-Migadu-Queue-Id: 7B0E62C612 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=web.de header.s=s29768273 header.b="Z04Il//3"; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=web.de (policy=none) X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -2.21 X-Spam-Score: -2.21 X-TUID: 5/Syu58MN1y5 --2WUJwI1uGCBXFW+S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Dear Maxim Cournoyer, here is a patch, that fixes the global store-prefix for grub menu-entries on commit 58a95d599ee5d0dc6419d038b7317e1b77b11519 git apply fix-store-prefix-for-menu-entry.patch Kind regards, =2D- Dr. Stefan Karrmann --2WUJwI1uGCBXFW+S Content-Type: text/x-diff; charset=us-ascii Content-Description: fix-store-prefix-for-menu-entry.patch Content-Disposition: attachment; filename="fix-btrfs-subvol-prefix-in-menu-entry.patch" diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index ecd44e7f3c..048b9ff8fd 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -378,22 +378,25 @@ (define (menu-entry->gexp entry) (device-mount-point (menu-entry-device-mount-point entry)) (multiboot-kernel (menu-entry-multiboot-kernel entry)) (chain-loader (menu-entry-chain-loader entry))) + ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. + ;; Use the right file names for LINUX and INITRD in case + ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a + ;; separate partition. Then we don't use STORE-DIRECTORY-PREFIX. + ;; When STORE-DIRECTORY-PREFIX is defined, prepend it the linux and + ;; initrd paths, to allow booting from a Btrfs subvolume. + (define (normalize-or-grub path) + "Normalize PATH if and only if DEVICE-MOUNT-POINT is \"/\"." + (if (and (string? device-mount-point) + (string= "/" device-mount-point)) + (normalize-file path + device-mount-point + store-directory-prefix) + path)) (cond (linux (let ((arguments (menu-entry-linux-arguments entry)) - (linux (normalize-file linux - device-mount-point - store-directory-prefix)) - (initrd (normalize-file (menu-entry-initrd entry) - device-mount-point - store-directory-prefix))) - ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. - ;; Use the right file names for LINUX and INITRD in case - ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a - ;; separate partition. - - ;; When STORE-DIRECTORY-PREFIX is defined, prepend it the linux and - ;; initrd paths, to allow booting from a Btrfs subvolume. + (linux (normalize-or-grub linux)) + (initrd (normalize-or-grub (menu-entry-initrd entry)))) #~(format port "menuentry ~s { ~a linux ~a ~a --2WUJwI1uGCBXFW+S--