From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-4.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 Received: by atuin.qyliss.net (Postfix, from userid 496) id 9448D4154E; Wed, 16 Feb 2022 00:11:27 +0000 (UTC) Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 5D6DF41522; Wed, 16 Feb 2022 00:11:08 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id 6E5244151C; Wed, 16 Feb 2022 00:11:05 +0000 (UTC) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by atuin.qyliss.net (Postfix) with ESMTPS id 955044151B for ; Wed, 16 Feb 2022 00:10:59 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5A4515C00B2; Tue, 15 Feb 2022 19:10:58 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 15 Feb 2022 19:10:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; bh=rb6xlurlIjkgdlxSj68h18y0Ptu2NBlbTMTEPj Atp60=; b=c5X6Y2wtchOIVqVGuWnK9PzPCPzT2HB2n1MEZjQUWCKvuGoeXcwT1a rChlyVHKkHDqrDbQGwpIjQt3IYY+yXi6PgHqx2couoinHQzjMYqYj81y5wq0A/jp cayfzq9Sr9k5wcgTfhO/3glKYd5rglN8Wo0ULMSrZflft3RhCXvQMtNJwd2KiAgL QOas+KFpKYpUfACSZe+A6yD7ezy2iT/ddiuygcJ0Gy6a9dT3oI8dMJ8jeWH9XFyr 3h7wkP/EsvtLgJNQ/OOzgfl4VFWX2u1sKNsOXfMhGcblflkBdr99eT0LcfVKxbl9 WLv0qeUgVnF3X0UyioHXSpLHOLyK5qJQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=rb6xlurlIjkgdlxSj 68h18y0Ptu2NBlbTMTEPjAtp60=; b=A/fR/giYDSFoKKz3ow/2QWV4PB4C0WpeW YAe5foOQgT6QB1RaQr6gpQYvYvLos4NZaAEufuRiGGW5Zwi4b42q28Ci1TanqJQn sK3prvLS5MYFh4uS/hJ1ymMToLXx0lgZszJyKIHzSp2JvYyvqADsjIoTBUX7qcgV Ee8c3B/35e3pS4H7LySxf4cUdB9HN1BDFw9a0bmFd4NCI2D3itb5zZh+Dq6vVZN9 DByVuA4wOrN7KFnXFfTsEUmNCWJSREhYaXQxIacf+jSa+sr7HXtxVTF/y07UR4CP GLQBWec4lWXMFtNqNkQXBgb0+6IZKSxXd6hlaBnthnisO8l8p/G7w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrjeehgddujecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehgtderre dttddvnecuhfhrohhmpeetlhihshhsrgcutfhoshhsuceohhhisegrlhihshhsrgdrihhs qeenucggtffrrghtthgvrhhnpeegtdevgfeltddtjefffeffjedvgfetjeeigedvfeefte egieeivdeujeehteffhfenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhgihhthhhu sghushgvrhgtohhnthgvnhhtrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepqhihlhhishhssegvvhgvrdhqhihlihhsshdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Feb 2022 19:10:57 -0500 (EST) Received: by eve.qyliss.net (Postfix, from userid 1000) id B83AE8FC1; Wed, 16 Feb 2022 00:10:56 +0000 (UTC) Date: Wed, 16 Feb 2022 00:10:56 +0000 From: Alyssa Ross To: Yureka Subject: Re: [PATCH] use statically linked cryptsetup in initramfs Message-ID: <20220216001056.w4b3mnpoe5czhueb@eve> References: <20211212141114.3238230-1-yuka@yuka.dev> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="q5eioztdlydipp5u" Content-Disposition: inline In-Reply-To: <20211212141114.3238230-1-yuka@yuka.dev> Message-ID-Hash: QBSQLNR64U5CAE4BODMNWCV3RNCXY7N5 X-Message-ID-Hash: QBSQLNR64U5CAE4BODMNWCV3RNCXY7N5 X-MailFrom: qyliss@eve.qyliss.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: devel@spectrum-os.org X-Mailman-Version: 3.3.4 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --q5eioztdlydipp5u Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Dec 12, 2021 at 03:11:14PM +0100, Yureka wrote: > --- > host/initramfs/default.nix | 31 +++++++++++++++++++++++++++---- > 1 file changed, 27 insertions(+), 4 deletions(-) Just a note to say, I didn't apply this particular patch because you'd already fixed it in Nixpkgs by the time I saw it, but I have now (finally) integrated static cryptsetup in Spectrum, and it's working and it made the initramfs much smaller and faster to build. Thanks so much for the work you put into it! > diff --git a/host/initramfs/default.nix b/host/initramfs/default.nix > index ba6ede2..91e598f 100644 > --- a/host/initramfs/default.nix > +++ b/host/initramfs/default.nix > @@ -2,15 +2,38 @@ > > { lib, stdenv, runCommand, writeReferencesToFile, pkgsStatic > , busybox, cpio, cryptsetup, linux, lvm2 > +, fetchpatch > }: > > -let > - cryptsetup' = cryptsetup; > -in > let > inherit (lib) cleanSource cleanSourceWith concatMapStringsSep; > > - cryptsetup = cryptsetup'.override { lvm2 = lvm2.override { udev = null; }; }; > + # https://github.com/NixOS/nixpkgs/pull/148948 > + cryptsetup = (pkgsStatic.cryptsetup.override { > + lvm2 = (pkgsStatic.lvm2.override { > + udev = null; > + }).overrideAttrs (old: { > + patches = (old.patches or []) ++ [ > + (fetchpatch { > + url = "https://raw.githubusercontent.com/NixOS/nixpkgs/bf8b0d818a6c5fa65f318603756762af492c1a0c/pkgs/os-specific/linux/lvm2/no-shared.diff"; > + sha256 = "sha256-t67Osvcn92R7q9V+KDW+SyJDmajzVbnTPONlokcBU9U="; > + }) > + ]; > + configureFlags = old.configureFlags ++ [ "--enable-static_link" ]; > + makeFlags = old.makeFlags ++ [ "libdm.device-mapper" ]; > + installPhase = '' > + install -D -t $out/lib libdm/ioctl/libdevmapper.a > + make -C libdm install_include > + make -C libdm install_pkgconfig > + ''; > + outputs = [ "out" ]; > + }); > + }).overrideAttrs (old: { > + NIX_LDFLAGS = ""; > + configureFlags = old.configureFlags ++ [ > + "--enable-static-cryptsetup" > + ]; > + }); > > packages = [ > cryptsetup pkgsStatic.mdevd pkgsStatic.execline > -- > 2.34.0 > --q5eioztdlydipp5u Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEH9wgcxqlHM/ARR3h+dvtSFmyccAFAmIMQQ0ACgkQ+dvtSFmy ccAXjBAAlY7wFERIUWizCzEBhJdvZedW5B0vmdiu6NAFgFyctGt/bqnsSmswe/3o ODXzJ9NhoF/QGtMkYCveeOFckQsuwrndrCB+mZRiZxjtSHkN542EEDA4DU1QB4h8 LbMv8gduKUdUCu6pssE9s9IOXUuF0Dw2VN2BFOxzN/7LKVIPDKrtmMlfc/4NsmPc WZo5STE5VGXNXpHPH3/vUkBw0Ji0wZsqJnaLl7XmbOezevQRjSCCUtb7fAG6yy0p F+evguDcgBrJl5VapS+kb75eDxmIcnHmQi+RfNQBHA9METzx6H+BdXaP28bXIXmb Rl6/iEs6UqTVtOOyi3N8dLH/5ydYC3lj8UvmWUPdAd2H1joSOI0M0H2MpAHRvZIz FxDoL2C29MAt6IG5nLS03fsg1b8+vTBmQCj10y5x99yIuiRaLGvX81csOIqz6XVK VSpTzyTHjQ/Ohl7PquT3YI1sfwdFvyNNSzWMZnDxzUpRlUSf9K+vAkZ5bNSWzrPQ +XPBMzBN58JeBmQA9sp+xKWryy8W+AoVcfpCyDH5oo/R2Uc4DdDaE+4CuZJOlUzE 8LBPZX633wA4hdKDmRG3mhYfTphrw2enbBMt1CkGhPEzt7AkYP6ULUIdWIb9rFbE EynL292YeJM1YJhpguNErFZtApYi7UzGa0JU2A258Hw5Ghl+5n4= =WIe0 -----END PGP SIGNATURE----- --q5eioztdlydipp5u--