cryptomount -u incorrectly loops over uuids

Bug #1582013 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
New
Undecided
Unassigned

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)

Revision history for this message
Andreas Hasenack (ahasenack) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.