update-secureboot-policy: fails to trigger mok loading

Bug #1883906 reported by Andy Whitcroft
This bug report is a duplicate of:  Bug #1869187: mokutil ignores timeout parameter. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mokutil (Ubuntu)
Invalid
Undecided
Unassigned
shim-signed (Ubuntu)
New
Undecided
Unassigned

Bug Description

In both eoan and bionic I have had cases where I add a new dkms package and dkms triggers update-secureboot-policy to try and enroll a key for me. When it does this I reboot and nothing is prompted and the key is not enrolled.

Tracking this through update-secureboot-policy is calling mokutil as below:

  enroll_mok()
  {
[...]
    echo "Adding '$SB_KEY' to shim:"
    printf '%s\n%s\n' "$key" "$again" | mokutil --timeout -1 --import "$SB_KEY" >/dev/null || true
  }

If I try this at the command line this is reported as invalid, dispite listing both options as valid:

 # printf "%s\n%s\n" '12345678' '12345678' | mokutil --timeout 1 --import MOK.der
 Usage:
  mokutil OPTIONS [ARGS...]

 Options:
[...]
  --import <der file...> Import keys
[...]
  --timeout <-1,0..0x7fff> Set the timeout for MOK prompt
[...]

Dropping --timeout allows the command to complete:

 # printf "%s\n%s\n" '12345678' '12345678' | mokutil --import MOK.der
 input password:
 input password again:

And on reboot I am prompted and the key is enrolled.

Revision history for this message
Andy Whitcroft (apw) wrote :

Oh and this is simply because --timeout and --import are essentially mutually exclusive. When you specify both the command is IMPORT|TIMEOUT and so not recognised.

Revision history for this message
Andy Whitcroft (apw) wrote :

So either we should invoke twice against mokutil or mokutil should accept these together.

Andy Whitcroft (apw)
Changed in mokutil (Ubuntu):
status: New → Invalid
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

So ubiquity does it right:

printf '%s\n%s\n' "$RET" "$RET" | mokutil --import /var/lib/shim-signed/mok/MOK.der >/dev/null || true
mokutil --timeout -1 >/dev/null || true

I.e. do it as two actions.

Revision history for this message
Steve Langasek (vorlon) wrote :

Duplicate of LP: #1869187.

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.