From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id sDqUAwIf82aqbQEAqHPOHw:P1 (envelope-from ) for ; Tue, 24 Sep 2024 20:20:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id sDqUAwIf82aqbQEAqHPOHw (envelope-from ) for ; Tue, 24 Sep 2024 22:20:18 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=oe23a461; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=QVU5yzeh; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727209218; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=ql7LpEx/yiBU8LYaIddxZeVJMa97eztAI5cl1rBQzYs=; b=k/WWrkFt8oQtGMtMwrd9JgGlsQwDRQ5DYoK6MseWL75fqgQfXpj5xv9vnjAAy8vF5Z7+Qv TCg3IgtHUuoitjZOSVvMYnSyum101ZuRqhmq0G86WEhkLCsR4GKqnj7GlZHag4iep6V+yZ 8apoYI/LEJdO+Xi7DSdl2P8RTvF+CEllmhaG755223W9kIKtBatKNs/Q9xczvgc61M6aQN tU51I1L2dfocW37sto17UJlTNGgOyDvQ7ZxUMaERPWnKbsS/K+BULem1Uyv8+RUaYwnCNq LbwDVDlVGnpBDdCNnGlciUuVNiJdn7SwX+UiiHfLiNlnR1nlGUWyYAcZk7fLxg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727209218; a=rsa-sha256; cv=none; b=SSJ7BKa0iFH6GKutAWsmf47tD40SumqYPzHl58mlwhbuaWTTNgY5R3flUdqGRL4xSPt49V ktUAyOsYDq748oQIL5+/82s1aSLeidSLD2eaQ2ceefbLOz7vqH0B58NUkc2KQ+K3ohF2N8 2dlfpj6KvYG9zHf8+Te9DqYsXuEixvfFkvgt9AGLwsDxwth7jOc2tRR+jAhlqSFidSQAOe yQu0Fqiss/I3brFm6gqul9eFcd8xyk+MvcV+eukaBNgXTj67dByaNKc7iwrVoaKH7pF2c4 H5taA3upB/OSiJGFYlBipifLJ4j0TWIMGRslMcoE+WlPNqwE35EuOmRljsVDQw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=oe23a461; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=QVU5yzeh; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org 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 9DF137A7D7 for ; Tue, 24 Sep 2024 22:20:17 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stBzi-0004Me-07; Tue, 24 Sep 2024 16:18:46 -0400 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 1stBzf-0004E0-RF for guix-patches@gnu.org; Tue, 24 Sep 2024 16:18:44 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1stBzf-0002kQ-69; Tue, 24 Sep 2024 16:18:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=ql7LpEx/yiBU8LYaIddxZeVJMa97eztAI5cl1rBQzYs=; b=oe23a461Gizf1+yJpPyev8jAoiizGyfc99qgRogBAFZfdgsupBdb/o0gr8qApqSkEr9bljtkVckZ8tMwdp0J9qFgkdOWiBXU0mOb4QnHdLSbB8n8M3sf9FmXqPLcsEUvzbkBLuCC/Z1kW79r2H1KnKETimzpaJqc0DKtsZ9vjO1mPJvX1O3efXjnJFLOVwtv9HMOnh9IYTLooZr+JXkJpqMnpmjrVBAZ0e2xIZOkbBfvinqN/YukLBTamhRkc1ggpd8vdKm0nBe+6eLiKQzJSyrlx2KZxcKDi1K7vpgZzTQkwFe8Y2GoA039WV6z18DYdwSUuK166Rw+4j7jArV0vA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC03-0004mo-2p; Tue, 24 Sep 2024 16:19:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72457] [PATCH v6 06/12] gnu: bootloader: depthcharge: Rewrite completely. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: pelzflorian@pelzflorian.de, lilah@lunabee.space, ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Tue, 24 Sep 2024 20:19:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72457 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72457@debbugs.gnu.org Cc: Lilah Tascheter , Florian Pelz , Lilah Tascheter , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Florian Pelz , Lilah Tascheter , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 72457-submit@debbugs.gnu.org id=B72457.172720913418312 (code B ref 72457); Tue, 24 Sep 2024 20:19:07 +0000 Received: (at 72457) by debbugs.gnu.org; 24 Sep 2024 20:18:54 +0000 Received: from localhost ([127.0.0.1]:38431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stBzq-0004lC-4F for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:18:54 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:48191 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stBzd-0004j7-Q6 for 72457@debbugs.gnu.org; Tue, 24 Sep 2024 16:18:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727202614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ql7LpEx/yiBU8LYaIddxZeVJMa97eztAI5cl1rBQzYs=; b=QVU5yzeh9xbMMcpp/rnTixKQzzl1WiXRkWMJI+2FADoNr5jDYaLu4sJFAkQ/BucQAtkH1p nfN69mRA8qSsx2pFNAvYOHoZub3hGBjdQ3GotklrV0L6zEThJ/0+muflK2+eOagugEB4tP dVKHIrW4vQ7ui4LzpaQPZXnAjFp5pSoQxesciX/WQJdM4e/T5vxlcTq8pEejU0lEaW88CZ 3lJI7GDrni9uslJItCEi/zendj6No9JKTvI2qeMMvpiiWcU3dkw1XwBHmpKZyBxMG5WWPB EofUHyHO2Y+fQKpi/LyYljX9v99KMzuHqTv+SUaGYQ1d/KEhkxjkz1WFGdorNg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id ec73d189 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 24 Sep 2024 18:30:14 +0000 (UTC) Date: Tue, 24 Sep 2024 20:29:13 +0200 Message-ID: <2e3abe65f5bc59efc50675ebb87f438a7a081325.1727201267.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches From: Herman Rimm via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.52 X-Migadu-Queue-Id: 9DF137A7D7 X-Spam-Score: -5.52 X-TUID: +pVPio6pO8om From: Lilah Tascheter * gnu/bootloader/depthcharge (install-depthcharge): Add procedure. (signed-kernel, depthcharge-configuration-file): Remove procedures. (depthcharge-veyron-speedy-bootloader): Update depthcharge-bootloader. (depthcharge-bootloader): Deprecate variable. * doc/guix.texi (Bootloader Configuration): Document bootloader. Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739 --- doc/guix.texi | 6 ++ gnu/bootloader/depthcharge.scm | 154 ++++++++++++++++----------------- 2 files changed, 81 insertions(+), 79 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index a70b89957a..4168310135 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -42448,6 +42448,12 @@ Bootloader Configuration of bootloaders for a wide range of ARM and AArch64 systems, using the @uref{https://www.denx.de/wiki/U-Boot/, U-Boot bootloader}. +@itemize +@vindex depthcharge-veyron-speedy-bootloader +@item @code{depthcharge-veyron-speedy-bootloader} +For the Asus C201. Requires a @code{'part} target, denoting the partition to +install the kernel blob as a @code{device}, @code{label}, or @code{uuid}. + @vindex grub-bootloader @code{grub-bootloader} allows you to boot in particular Intel-based machines in ``legacy'' BIOS mode. diff --git a/gnu/bootloader/depthcharge.scm b/gnu/bootloader/depthcharge.scm index 0a50374bd9..b727874a40 100644 --- a/gnu/bootloader/depthcharge.scm +++ b/gnu/bootloader/depthcharge.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019 Timothy Sample +;;; Copyright © 2024 Lilah Tascheter ;;; ;;; This file is part of GNU Guix. ;;; @@ -17,92 +18,87 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu bootloader depthcharge) - #:use-module (gnu bootloader extlinux) #:use-module (gnu bootloader) #:use-module (gnu packages bootloaders) + #:use-module (gnu system boot) #:use-module (guix gexp) + #:use-module (guix deprecation) + #:use-module (guix diagnostics) + #:use-module (guix i18n) + #:use-module (guix records) #:use-module (guix utils) - #:use-module (ice-9 match) - #:export (depthcharge-bootloader)) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-35) + #:export (depthcharge-veyron-speedy-bootloader + depthcharge-bootloader)) -(define (signed-kernel kernel kernel-arguments initrd) - (define builder - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils) - (ice-9 binary-ports) - (rnrs bytevectors)) - (set-path-environment-variable "PATH" '("bin") (list #$dtc)) +(define* (install-depthcharge arch dtb + #:key bootloader-config current-boot-alternative + #:allow-other-keys) + (when (not (null? (bootloader-configuration-menu-entries bootloader-config))) + (raise (formatted-message + (G_ "extra menu-entries are not supported for depthcharge!")))) + (with-targets (bootloader-configuration-targets bootloader-config) + ;; use 'part instead of 'disk, cause we write an image directly into a + ;; partition instead of the extra-partition disk space + (('part => (disk :device)) + (match-menu-entry + (boot-alternative->menu-entry current-boot-alternative) + (linux linux-arguments initrd) + #~(begin + (use-modules (ice-9 binary-ports) (rnrs bytevectors)) + (set-path-environment-variable "PATH" '("bin") (list #$dtc)) - ;; TODO: These files have to be writable, so we copy them. - ;; This can probably be fixed by using a ".its" file, just - ;; be careful not to break initrd loading. - (copy-file #$kernel "zImage") - (chmod "zImage" #o755) - (copy-file (string-append (dirname #$kernel) "/lib/dtbs/" - "rk3288-veyron-speedy.dtb") - "rk3288-veyron-speedy.dtb") - (chmod "rk3288-veyron-speedy.dtb" #o644) - (copy-file #$initrd "initrd") - (chmod "initrd" #o644) + ;; TODO: These files have to be writable, so we copy them. + ;; This can probably be fixed by using a ".its" file, just + ;; be careful not to break initrd loading. + (copy-file #$linux "zImage") + (chmod "zImage" #o755) + (copy-file (string-append (dirname #$linux) "/lib/dtbs/" #$dtb) + "dtb") + (chmod "dtb" #o644) + (copy-file #$initrd "initrd") + (chmod "initrd" #o644) - (invoke (string-append #$u-boot-tools "/bin/mkimage") - "-D" "-I dts -O dtb -p 2048" - "-f" "auto" - "-A" "arm" - "-O" "linux" - "-T" "kernel" - "-C" "None" - "-d" "zImage" - "-a" "0" - "-b" "rk3288-veyron-speedy.dtb" - "-i" "initrd" - "image.itb") - (call-with-output-file "bootloader.bin" - (lambda (port) - (put-bytevector port (make-bytevector 512 0)))) - (with-output-to-file "kernel-arguments" - (lambda () - (display (string-join (list #$@kernel-arguments))))) - (invoke (string-append #$vboot-utils "/bin/vbutil_kernel") - "--pack" #$output - "--version" "1" - "--vmlinuz" "image.itb" - "--arch" "arm" - "--keyblock" (string-append #$vboot-utils - "/share/vboot-utils/devkeys/" - "kernel.keyblock") - "--signprivate" (string-append #$vboot-utils - "/share/vboot-utils/devkeys/" - "kernel_data_key.vbprivk") - "--config" "kernel-arguments" - "--bootloader" "bootloader.bin")))) - (computed-file "vmlinux.kpart" builder)) + (invoke #+(file-append u-boot-tools "/bin/mkimage") + "-D" "-I dts -O dtb -p 2048" + "-f" "auto" ; format + "-A" #$arch ; architecture + "-O" "linux" ; os + "-T" "kernel" ; image type + "-C" "None" ; compression + "-d" "zImage" ; image data + "-a" "0" ; load address (hex) + "-b" "dtb" ; dtb for device + "-i" "initrd" ; initrd + "image.itb") + (call-with-output-file "bootloader.bin" + (lambda (port) + (put-bytevector port (make-bytevector 512 0)))) + (call-with-output-file "kernel-arguments" + (lambda (port) + (display (string-join (list #$@linux-arguments)) port))) + (invoke #+(file-append vboot-utils "/bin/vbutil_kernel") + "--version" "1" + "--vmlinuz" "image.itb" + "--arch" #$arch + "--keyblock" + #$(file-append vboot-utils + "/share/vboot-utils/devkeys/kernel.keyblock") + "--signprivate" + #$(file-append vboot-utils + "/share/vboot-utils/devkeys/kernel_data_key.vbprivk") + "--config" "kernel-arguments" + "--pack" "vmlinux.kpart") + (write-file-on-device "vmlinux.kpart" + (stat:size (stat "vmlinux.kpart")) + #$disk 0)))))) -(define* (depthcharge-configuration-file config entries - #:key - (system (%current-system)) - (old-entries '()) - #:allow-other-keys) - (match entries - ((entry) - (let ((kernel (menu-entry-linux entry)) - (kernel-arguments (menu-entry-linux-arguments entry)) - (initrd (menu-entry-initrd entry))) - ;; XXX: Make this a symlink. - (signed-kernel kernel kernel-arguments initrd))) - (_ (error "Too many bootloader menu entries!")))) - -(define install-depthcharge - #~(lambda (bootloader device mount-point) - (let ((kpart (string-append mount-point - "/boot/depthcharge/vmlinux.kpart"))) - (write-file-on-device kpart (stat:size (stat kpart)) device 0)))) - -(define depthcharge-bootloader +(define depthcharge-veyron-speedy-bootloader (bootloader (name 'depthcharge) - (package #f) - (installer install-depthcharge) - (configuration-file "/boot/depthcharge/vmlinux.kpart") - (configuration-file-generator depthcharge-configuration-file))) + (installer (cute install-depthcharge "arm" "rk3288-veyron-speedy.dtb" + <...>)))) + +(define-deprecated/alias depthcharge-bootloader + depthcharge-veyron-speedy-bootloader) -- 2.45.2