[From nobody Fri Oct 30 08:39:10 2026
Received: (at 1152515-close) by bugs.debian.org; 30 Oct 2026 08:36:09 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
 (2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-114.6 required=4.0 tests=ALL_TRUSTED,BAYES_00,
 DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,
 FOURLA,FROMDEVELOPER,GENDER,HAS_BUG_NUMBER,PGPSIGNATURE,SPF_HELO_NONE,
 SPF_PASS,USER_IN_DKIM_WELCOMELIST autolearn=ham autolearn_force=no
 version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 28; hammy, 149; neutral, 59; spammy,
 1. spammytokens:0.968-+--online
 hammytokens:0.000-+--Hx-spam-relays-external:sk:stravin,
 0.000-+--H*RT:sk:stravin, 0.000-+--Hx-spam-relays-external:311,
 0.000-+--H*RT:311, 0.000-+--H*RT:108
Return-path: &lt;guilhem@debian.org&gt;
Received: from stravinsky.debian.org ([2001:41b8:202:deb::311:108]:34798)
 by buxtehude.debian.org with esmtps
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;guilhem@debian.org&gt;) id 1xMi5o-003eH5-2s
 for 1152515-close@bugs.debian.org; Fri, 30 Oct 2026 08:36:09 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; 
 s=smtpauto.stravinsky;
 h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version:
 References:Message-ID:Subject:To:From:Date:Reply-To:Cc:
 Content-Transfer-Encoding:Content-ID:Content-Description;
 bh=sAgXNDXrO/aAazQYJXX0J9Uogi8Dj/vHcPcPv4TiPt8=; b=Fp7jobPN62QKw69oB8R6Ajd9VI
 gIrK5Ll1JHph1FvKLrM05FArHeTZh3vU64JzosTaP4t/hZQ2xd9ctUBKO9WzGD5OLNZNPFlRVgMI7
 XD+O7ma4XCtVAyFqN3iYoGOZrvKD9lIKPNvcZOcpxM/hQB0LUOcds8o/MrXxP1DtSyOSMogISZEQm
 1+261rdBV2c+nNKhEnzP/jDlSY/jv453pAP1k2NdEbek545IMDnViCV95ihCsq22lf31q/STWLvJw
 4TgU1Olk0xMau034rzOV3hNzFO4HqJtJaHU81IPCxgCmXQpCkFPEHqF+mOwbVEoY+UdoqrKyI0jKq
 YLNObH5A==;
Received: from authenticated-user by stravinsky.debian.org with esmtpsa
 (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;guilhem@debian.org&gt;) id 1xMi5k-003gvu-24;
 Fri, 30 Oct 2026 08:36:05 +0000
Received: by localhost.localdomain (Postfix, from userid 1000)
 id DD4D0420076; Fri, 30 Oct 2026 09:36:03 +0100 (CET)
Date: Fri, 30 Oct 2026 09:36:03 +0100
From: Guilhem Moulin &lt;guilhem@debian.org&gt;
To: Russell Coker &lt;russell@coker.com.au&gt;, 1152515-close@bugs.debian.org
Subject: Re: Bug#1152515: cryptsetup: The man page does not adequately
 explain the initramfs option for swap
Message-ID: &lt;auRW8iqDsHbkTnj4@debian.org&gt;
Mail-Followup-To: Guilhem Moulin &lt;guilhem@debian.org&gt;,
 Russell Coker &lt;russell@coker.com.au&gt;, 1152515-close@bugs.debian.org
References: &lt;179333550036.2.10670930381125125033.reportbug@xev&gt;
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol=&quot;application/pgp-signature&quot;; boundary=&quot;ADdtPD9uQTHnDEPr&quot;
Content-Disposition: inline
In-Reply-To: &lt;179333550036.2.10670930381125125033.reportbug@xev&gt;
X-Debian-User: guilhem

--ADdtPD9uQTHnDEPr
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, 30 Oct 2026 at 15:45:00 +1100, Russell Coker wrote:
&gt; In Trixie x-initrd.attach is the way to autostart encrypted swap on boot.

Trixie's default initrd is initramfs-tools which is what
cryptsetup-initramfs configures and what crypttab(5) from src:cryptsetup
is about.  This does not use x-initrd.attach at all.  The manual also
points to systemd's own crypttab(5) where x-initrd.attach is documented.

&gt; https://wiki.debian.org/Swap
&gt;
&gt; I have added a section to the Wiki about this which will hopefully save t=
ime
&gt; for some people.

FWIW, your suggestion

    sda3_crypt /dev/sda3 /dev/urandom =E2=80=A6,swap,=E2=80=A6,initramfs

is specific to cryptsetup-initramfs, dracut will ignore the keyword
AFAICT.  This might be what you inteded, but since you have a transient
swap there is no need to start it early in the boot process.  You can
remove the `initramfs` keyword and let systemd do it later once
execution has been handed over to it.

    sda3_crypt /dev/sda3 /dev/urandom plain,discard,cipher=3Daes-xts-plain6=
4,size=3D256,swap

This works on forky/sid as well as trixie and earlier.

I'm closing this because /usr/share/doc/cryptsetup/README.Debian.gz has
a section about encrypted swap already, which is also available online at
https://cryptsetup-team.pages.debian.net/cryptsetup/README.Debian.html#encr=
ypted-swap-partitions
(And /usr/share/doc/cryptsetup-initramfs/README.initramfs.gz has a
section for non-transient swap partitions.)

--=20
Guilhem.

--ADdtPD9uQTHnDEPr
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iQIyBAEBCgAdFiEERpy6p3b9sfzUdbME05pJnDwhpVIFAmrkVvIACgkQ05pJnDwh
pVLEcQ/3Za3ZfdVHqWst8H0ChqTejuWOyBlooXc14aU5Ew8SXfRccz8IZNn9V42q
69qiPIv0gRAwC6eWEteQ0JW4Xyb8zNs0hPZeua7eTga8I9TuBGHwlfgtkPDRTG2P
6jSv35aWP8OxxDXnlQi3lnO4uPTgchuN4XvViB+GickV9Ke495EuNvEIMclN0tFj
8/98vB+ASq65C4/fXyGco+8Pcmi6clqH9BxP2/TRiUFPb2yLSqOVL/f4NKodfIVE
vS1pAjmQeEq4tDlIYy/rWeSOKW6qZ/1oaynLhsTn3BbmF/RdaB/11BOk/q/7QJx/
4to/7qhl75hZn5KRL8GnIs3FRXbeMUN3dnmMcdL6M+0cidXGPNpmO58PEDKOxfnK
LCxFl7FNbztM16gPj0Ki/0X61iz9IJ3aB9VvUS/67AtAAHuNXksrs2h9fTJezsqU
u3s2h897WiBJ52Jh2JNHkyhPD/qA1oE+OrS1NAlDiKRypOPWixjowgnHPKyApUhX
YmsY1HA0v088JEAiVAvhZdUWzmg9jpo5pP46IN/6wKPXHeDiImgDZqcFg1TtYW6H
52j2sveF1Bi3T4Kfqpuwvkg5GunWAK1R4fX1nM/zIlA30o4ndc1+oM0UkAHpkU3f
zgBAtmzz+UFMIQuLhyU2jRrKfHr7gjM0l0bFgx2YbwNZPfFkHA==
=Ewlo
-----END PGP SIGNATURE-----

--ADdtPD9uQTHnDEPr--
]