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 ms1.migadu.com with LMTPS id AChSDY3+E2Z4RAAAqHPOHw:P1 (envelope-from ) for ; Mon, 08 Apr 2024 16:26:21 +0200 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 AChSDY3+E2Z4RAAAqHPOHw (envelope-from ) for ; Mon, 08 Apr 2024 16:26:21 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=V8AZMlCV; 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=1712586380; h=from:from:sender:sender: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=1WKWfZPtgZASpWRse19P3CuTAL/z/Fpc07XvH9Q+HpQ=; b=d29OsU2Wpn7UdOmAqi+xRp1GcQMJRe3hZ6aJyO5xrg194CHjHYVathzmPqEGTzmulU2znT LatTra86csZBej31yjV0UNw0+XjZP00ZA/tTI6yjZY3VyKeJ2q8mKAJLdVoKwuS1A3cG1U L+jGpPyQVuhzM28wTKpoCX3A4EoeD9sZZbTWXuznptwGMGkZdlI3Mb3Lci518zaQqKDdDd ZNE4uT68bVbZeQ+EsATVwsekjaFglpJmSLwXmlisAWI/iCSwqnq2BJ1By59A08ZUanIZwa KKL9vu2BlP1v1OgwCwTD2jW4+tF26LKbKIWd7ZjuIi/AIPyOhF5RRYJO+IPGkw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712586380; a=rsa-sha256; cv=none; b=okDCSlMZ/tTyentu/2siHWCR7ufisueGX0CY3fBHulZJB9x+eCQbT6u9LomTUBsLP2nRrZ GmEV99k/+E7fmKxmjhvFV5M2ULhe9BAIQA4EFY84JVPvT25K3wEF6qMbSA6Yq1NNdtxHcq 2dPSxXwWjuwrXmBcSKlmTZEC2g3kxoqaeowcHNNjzmcBeTnDZei936BdYohemevMiv3pPw axXc7ZlEk7Yynt/f8L8YwV3lKVoLa2Iy7uIWple4DS74JvhJDhK8Av9QZnoC7odZ1FYJr8 3HRpVLlAAFJvDwRFvlep1S+irmPJ2wQi+OEDg60rDGFDFEtObfupWkc5S8ilnA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=V8AZMlCV; 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 C204D2364B for ; Mon, 8 Apr 2024 16:26:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtpwj-0006gP-78; Mon, 08 Apr 2024 10:26:05 -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 1rtpwh-0006Yx-Vl for guix-patches@gnu.org; Mon, 08 Apr 2024 10:26:04 -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 1rtpwc-0004iG-1X; Mon, 08 Apr 2024 10:26:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rtpwj-0000uv-E1; Mon, 08 Apr 2024 10:26:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70280] [PATCH 5/5] linux-initrd: Further strip the static Guile. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Mon, 08 Apr 2024 14:26:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70280 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70280@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-Xcc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 70280-submit@debbugs.gnu.org id=B70280.17125863093102 (code B ref 70280); Mon, 08 Apr 2024 14:26:05 +0000 Received: (at 70280) by debbugs.gnu.org; 8 Apr 2024 14:25:09 +0000 Received: from localhost ([127.0.0.1]:47336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtpvo-0000nq-Ks for submit@debbugs.gnu.org; Mon, 08 Apr 2024 10:25:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtpvk-0000m3-3x for 70280@debbugs.gnu.org; Mon, 08 Apr 2024 10:25:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtpvX-0004Hn-CM; Mon, 08 Apr 2024 10:24:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=1WKWfZPtgZASpWRse19P3CuTAL/z/Fpc07XvH9Q+HpQ=; b=V8AZMlCVeJYNIvmjAxq7 vsmVHXK0uf8jsa3Cv0ekli5iCtJFp85qGVIei6zwmCJlVNlSeAIXhNmZBu9RMISf8F+k17NZ9kYvy Ttv4XHPnx40zWWLg/NzQyxhlY6sWwfqcfcma4Jm7Ymy35njyEvgjFPhcubLJuth49vUeF03C7Qapw eUTbiMLcbDRig0fKUvDZD5ZFTBj5OXtpffxLLFlehPWjqE1jr8+jNSj4aUfkJ0KC8XcDSzOA47GFx FtwTuR+rvpxQeIbdke40Ty3YlOj9K5oCGXWFn39s5f04vXs6T8Y0C6wFMs7Xp7J0DM+jbmNRPZ0L5 4zNAqZR3khwD+g==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 8 Apr 2024 16:24:35 +0200 Message-ID: <021746eea10ffcc41b5b870816210628f3685f99.1712585810.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 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: , 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-Spam-Score: -6.07 X-Spam-Score: -6.07 X-Migadu-Queue-Id: C204D2364B X-Migadu-Scanner: mx12.migadu.com X-TUID: YZeMu0/NJKGn ‘guile-static-initrd’ weighs in at 46 MiB, compared to 54 MiB for ‘guile-static-stripped’ (15% reduction). * gnu/packages/make-bootstrap.scm (make-guile-static-stripped): Add ‘directories-to-remove’ parameter and honor it. (%guile-static-initrd): New variable. * gnu/system/linux-initrd.scm (expression->initrd): Default to ‘%guile-static-initrd’. * doc/guix.texi (Initial RAM Disk): Adjust accordingly. Change-Id: I2baf06fed7a3698433e7c83b1d7726054a8c746e --- doc/guix.texi | 2 +- gnu/packages/make-bootstrap.scm | 37 ++++++++++++++++++++++++++++----- gnu/system/linux-initrd.scm | 4 ++-- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 7ca06046ba..705f7d7de2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -41339,7 +41339,7 @@ Initial RAM Disk program to run in that initrd. @deffn {Procedure} expression->initrd exp @ - [#:guile %guile-static-stripped] [#:name "guile-initrd"] + [#:guile %guile-static-initrd] [#:name "guile-initrd"] Return as a file-like object a Linux initrd (a gzipped cpio archive) containing @var{guile} and that evaluates @var{exp}, a G-expression, upon booting. All the derivations referenced by @var{exp} are diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index 7b40f395f3..4dd45a4a27 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012-2021, 2023 Ludovic Courtès +;;; Copyright © 2012-2021, 2023-2024 Ludovic Courtès ;;; Copyright © 2017, 2021 Efraim Flashner ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2019 Mark H Weaver @@ -55,7 +55,8 @@ (define-module (gnu packages make-bootstrap) %guile-bootstrap-tarball %bootstrap-tarballs - %guile-static-stripped)) + %guile-static-stripped + %guile-static-initrd)) ;;; Commentary: ;;; @@ -674,7 +675,8 @@ (define %guile-static-3.0 "guile-3.0-linux-syscalls.patch" "guile-3.0-relocatable.patch"))) -(define* (make-guile-static-stripped static-guile) +(define* (make-guile-static-stripped static-guile + #:optional (directories-to-remove '())) (package (inherit static-guile) (name (string-append (package-name static-guile) "-stripped")) @@ -702,6 +704,12 @@ (define* (make-guile-static-stripped static-guile) (mkdir (string-append out "/bin")) (copy-file guile1 guile2) + ;; Optionally remove additional directories. + (for-each (lambda (directory) + (delete-file-recursively + (string-append out "/" directory))) + '#$directories-to-remove) + ;; Verify that the relocated Guile works. #$@(if (%current-target-system) '() @@ -720,10 +728,29 @@ (define* (make-guile-static-stripped static-guile) (synopsis "Minimal statically-linked and relocatable Guile"))) (define %guile-static-stripped - ;; A stripped static Guile 3.0 binary, for use in initrds - ;; and during bootstrap. + ;; A stripped static Guile 3.0 binary for use during bootstrap. (make-guile-static-stripped %guile-static-3.0)) +(define %guile-static-initrd + ;; A stripped static Guile 3.0 binary for use in initrds. Remove various + ;; modules that are useless in an initrd. Note: Keep most of language/ + ;; because it is needed for Bournish. + (package + (inherit + (make-guile-static-stripped + %guile-static-3.0 + (append-map (lambda (directory) + (list (string-append "lib/guile/3.0/ccache/" directory) + (string-append "share/guile/3.0/" directory))) + '("language/brainfuck" + "language/ecmascript" + "language/elisp" + "oop" + "scripts" + "texinfo" + "web")))) + (name "guile-static-initrd"))) + (define (tarball-package pkg) "Return a package containing a tarball of PKG." (package diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 561cfe2fd0..00221333da 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -36,7 +36,7 @@ (define-module (gnu system linux-initrd) #:use-module ((gnu packages xorg) #:select (console-setup xkeyboard-config)) #:use-module ((gnu packages make-bootstrap) - #:select (%guile-static-stripped)) + #:select (%guile-static-initrd)) #:use-module (gnu system file-systems) #:use-module (gnu system mapped-devices) #:use-module (gnu system keyboard) @@ -62,7 +62,7 @@ (define-module (gnu system linux-initrd) (define* (expression->initrd exp #:key - (guile %guile-static-stripped) + (guile %guile-static-initrd) (gzip gzip) (name "guile-initrd") (system (%current-system))) -- 2.41.0