unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: angry rectangle <angryrectangle@cock.li>
To: 53005@debbugs.gnu.org
Subject: bug#53005: cryptsetup-static aborts opening LUKS2 volume with Argon2i PBKDF
Date: Thu, 18 Aug 2022 23:31:17 -0400	[thread overview]
Message-ID: <87zgg0q4xq.fsf@cock.li> (raw)
In-Reply-To: <87v8yz1sae.fsf@simonsouth.net>

[-- Attachment #1: Type: text/plain, Size: 280 bytes --]

I too have been affected by this bug for a long time and hope it will be fixed one day.
For end-users, attached is a drop-in workaround you can use to make guix utilize the old cryptsetup build. It's sloppy, but at least the system can boot again.
Thanks for the research, Simon.

[-- Attachment #2: workaround --]
[-- Type: text/plain, Size: 2649 bytes --]

;; workaround for https://issues.guix.gnu.org/53005
;;
;; How to use:
;; Run this code in your operating system config file.
;; Then replace `luks-device-mapping' with `alt-luks-device-mapping'.
;;
;; i may have forgotten some use-modules. use your brain if necessary.
\f
;; to-do: it would be better to use package transformation procedures to fix cryptsetup from the current guix
(use-modules (guix inferior) (guix channels) (srfi srfi-1))
(define channels
  (list (channel
         (name 'guix)
         (url "https://git.savannah.gnu.org/git/guix.git")
         (commit
          "0996fcc657593955845c2761d7eb0f656149fe11"))))
(define inferior (inferior-for-channels channels))
(define old-cryptsetup-static (first (lookup-inferior-packages inferior "cryptsetup-static")))
\f
(use-modules (gnu system uuid))
(use-modules (ice-9 match))
(use-modules (guix modules))
;; copied from guix.
;; the whole point is to edit the `file-append' line.
;; (if i knew a way to modify gexp, this could simply modify the output of the old procedure.)
(define (my-open-luks-device source targets)
  "Return a gexp that maps SOURCE to TARGET as a LUKS device, using
'cryptsetup'."
  (with-imported-modules (source-module-closure
                          '((gnu build file-systems)
                            (guix build utils))) ;; For mkdir-p
    (match targets
      ((target)
       #~(let ((source #$(if (uuid? source)
                             (uuid-bytevector source)
                             source)))
           ;; XXX: 'use-modules' should be at the top level.
           (use-modules (rnrs bytevectors) ;bytevector?
                        ((gnu build file-systems)
                         #:select (find-partition-by-luks-uuid
                                   system*/tty))
                        ((guix build utils) #:select (mkdir-p)))
           (mkdir-p "/run/cryptsetup/")
           (zero? (system*/tty
                   #$(file-append old-cryptsetup-static "/sbin/cryptsetup")
                   "open" "--type" "luks"
                   (if (bytevector? source)
                       (or (let loop ((tries-left 10))
                             (and (positive? tries-left)
                                  (or (find-partition-by-luks-uuid source)
                                      (begin (sleep 1)
                                             (loop (- tries-left 1))))))
                           (error "LUKS partition not found" source))
                       source)
                   #$target)))))))
(define alt-luks-device-mapping
  (mapped-device-kind
   (inherit luks-device-mapping)
   (open my-open-luks-device)))

  parent reply	other threads:[~2022-08-19  8:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 14:36 bug#53005: cryptsetup-static aborts opening LUKS2 volume with Argon2i PBKDF Simon South
2022-01-04 14:44 ` Simon South
2022-01-08  1:52 ` Simon South
2022-01-10 23:34 ` Simon South
2022-01-10 23:34   ` bug#53005: [PATCH 1/1] gnu: glibc: Preserve "__pthread_key_create" symbol Simon South
2022-01-12 19:21     ` Leo Famulari
2022-01-12 21:22       ` Simon South
2022-05-01  9:49         ` Tom Fitzhenry
2022-08-19  3:31 ` angry rectangle [this message]
2024-02-07 19:59 ` bug#53005: cryptsetup-static aborts opening LUKS2 volume with Argon2i PBKDF Simon South

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgg0q4xq.fsf@cock.li \
    --to=angryrectangle@cock.li \
    --cc=53005@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).