[Bug 1582013] [NEW] cryptomount -u incorrectly loops over uuids

Andreas Hasenack andreas at canonical.com
Sun May 15 19:38:15 UTC 2016


Public bug reported:

I have a probably unusual setup in a VM where I need to luksOpen 3 disks
during boot (I'm using ZFS raidz1 on 3 luks-encrypted disks).

"""
During boot, I get a rather puzzling error:
error: can't find command f94f182a584c4b40bf6d
error: can't find command 82fae0edbdc74b938550

Press any key to continue...
"""

The generated grub.cfg file explains it. It has this bit repeated all over the place:
(...)
cryptomount -u 3c26d0e32abf412a8b5ea1f837bf9346
f94f182a584c4b40bf6d93d04990a02a
82fae0edbdc74b9385502c6a8db496ba
(...)

That should actually be 3 cryptomount -u lines, not just one.

I tracked it down to grub-mkconfig_lib in this bit of code:
  if [ x$GRUB_ENABLE_CRYPTODISK = xy ]; then
      for uuid in "`"${grub_probe}" --device $@ --target=cryptodisk_uuid`"; do
          echo "cryptomount -u $uuid"
      done
  fi

For some reason, the IFS this code is using isn't working to parse the
output of grub_probe.

I ran the command manually in my shell, and it looks fine:
# /usr/sbin/grub-probe --device /dev/mapper/crypt1 /dev/mapper/crypt2 /dev/mapper/crypt3 --target=cryptodisk_uuid
3c26d0e32abf412a8b5ea1f837bf9346
f94f182a584c4b40bf6d93d04990a02a
82fae0edbdc74b9385502c6a8db496ba

I made a few attempts at different values of IFS, but couldn't get it to
correctly use one cryptomount line per uuid. It must be something
simple, but I couldn't figure it out, sorry.

This doesn't prevent my system from booting, I just have to press ENTER
when it errors like that, or wait a few seconds. Since I have to be at
the console anyway to type the passphrases, it's not a blocker, just an
annoyance.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: grub-pc 2.02~beta2-36ubuntu3
ProcVersionSignature: Ubuntu 4.4.0-22.39-generic 4.4.8
Uname: Linux 4.4.0-22-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
Date: Sun May 15 19:26:14 2016
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: grub2 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug xenial

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1582013

Title:
  cryptomount -u incorrectly loops over uuids

Status in grub2 package in Ubuntu:
  New

Bug description:
  I have a probably unusual setup in a VM where I need to luksOpen 3
  disks during boot (I'm using ZFS raidz1 on 3 luks-encrypted disks).

  """
  During boot, I get a rather puzzling error:
  error: can't find command f94f182a584c4b40bf6d
  error: can't find command 82fae0edbdc74b938550

  Press any key to continue...
  """

  The generated grub.cfg file explains it. It has this bit repeated all over the place:
  (...)
  cryptomount -u 3c26d0e32abf412a8b5ea1f837bf9346
  f94f182a584c4b40bf6d93d04990a02a
  82fae0edbdc74b9385502c6a8db496ba
  (...)

  That should actually be 3 cryptomount -u lines, not just one.

  I tracked it down to grub-mkconfig_lib in this bit of code:
    if [ x$GRUB_ENABLE_CRYPTODISK = xy ]; then
        for uuid in "`"${grub_probe}" --device $@ --target=cryptodisk_uuid`"; do
            echo "cryptomount -u $uuid"
        done
    fi

  For some reason, the IFS this code is using isn't working to parse the
  output of grub_probe.

  I ran the command manually in my shell, and it looks fine:
  # /usr/sbin/grub-probe --device /dev/mapper/crypt1 /dev/mapper/crypt2 /dev/mapper/crypt3 --target=cryptodisk_uuid
  3c26d0e32abf412a8b5ea1f837bf9346
  f94f182a584c4b40bf6d93d04990a02a
  82fae0edbdc74b9385502c6a8db496ba

  I made a few attempts at different values of IFS, but couldn't get it
  to correctly use one cryptomount line per uuid. It must be something
  simple, but I couldn't figure it out, sorry.

  This doesn't prevent my system from booting, I just have to press
  ENTER when it errors like that, or wait a few seconds. Since I have to
  be at the console anyway to type the passphrases, it's not a blocker,
  just an annoyance.

  ProblemType: Bug
  DistroRelease: Ubuntu 16.04
  Package: grub-pc 2.02~beta2-36ubuntu3
  ProcVersionSignature: Ubuntu 4.4.0-22.39-generic 4.4.8
  Uname: Linux 4.4.0-22-generic x86_64
  NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
  ApportVersion: 2.20.1-0ubuntu2
  Architecture: amd64
  Date: Sun May 15 19:26:14 2016
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: grub2
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1582013/+subscriptions



More information about the foundations-bugs mailing list