package shim-signed 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Bug #1707832 reported by cristina
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I tried to update ubuntu and I got this error message. I am using MacBook late 2007 with lubuntu 16.04 LTS 64bit.

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: shim-signed 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-87.110-generic 4.4.73
Uname: Linux 4.4.0-87-generic x86_64
.proc.sys.kernel.moksbstate_disabled: 0
ApportVersion: 2.20.1-0ubuntu2.10
Architecture: amd64
BootEFIContents:
 fw
 fwupx64.efi
 System
Date: Mon Jul 31 17:22:53 2017
EFIBootMgr:
 BootCurrent: 0000
 Timeout: 0 seconds
 BootOrder: 0004
 Boot0004* Ubuntu 16.04.2 LTS HD(1,GPT,6aa06c3c-cd2f-477e-a7a8-01871ef8de84,0x800,0x100000)/File(\System\Library\CoreServices)
 BootFFFF* PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0,0,0)/HD(1,GPT,6aa06c3c-cd2f-477e-a7a8-01871ef8de84,0x800,0x100000)/File(\EFI\Ubuntu 16.04.2 LTS\System\Library\CoreServices\boot.efi)
EFITables:
 Jul 31 08:51:10 asuka kernel: efi: EFI v1.10 by Apple
 Jul 31 08:51:10 asuka kernel: efi: ACPI=0xbeeee000 ACPI 2.0=0xbeeee014 SMBIOS=0xbeec3000
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2017-05-10 (82 days ago)
InstallationMedia: Ubuntu 14.04.2 LTS "Trusty Tahr" - Release amd64 (20150218.1)
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.2
 apt 1.2.20
SourcePackage: shim-signed
Title: package shim-signed 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
cristina (cristina6x) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Steve Langasek (vorlon) wrote :

The error in your log shows:

Setting up shim-signed (1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1) ...
Installing for x86_64-efi platform.
grub-install: error: Can't create file: No such file or directory.
dpkg: error processing package shim-signed (--configure):
 subprocess installed post-installation script returned error exit status 1

Can you show the output of 'ls -lAR /boot' on this system?

Changed in shim-signed (Ubuntu):
status: New → Incomplete
Revision history for this message
cristina (cristina6x) wrote :
Download full text (17.9 KiB)

Hi Steve,

Yes, here is the output.

root@asuka:~# ls -lAR /boot
/boot:
total 176999
-rw-r--r-- 1 root root 1246311 Jun 14 05:24 abi-4.4.0-81-generic
-rw-r--r-- 1 root root 1246511 Jun 26 12:45 abi-4.4.0-83-generic
-rw-r--r-- 1 root root 1246670 Jul 18 08:00 abi-4.4.0-87-generic
-rw-r--r-- 1 root root 190356 Jun 14 05:24 config-4.4.0-81-generic
-rw-r--r-- 1 root root 190356 Jun 26 12:45 config-4.4.0-83-generic
-rw-r--r-- 1 root root 190356 Jul 18 08:00 config-4.4.0-87-generic
drwxr-xr-x 1 root root 6 May 17 12:01 efi
drwxr-xr-x 5 root root 1024 Jul 31 17:22 grub
-rw-r--r-- 1 root root 40464919 Jun 24 15:30 initrd.img-4.4.0-81-generic
-rw-r--r-- 1 root root 40466242 Jul 3 10:51 initrd.img-4.4.0-83-generic
-rw-r--r-- 1 root root 40478595 Jul 27 13:19 initrd.img-4.4.0-87-generic
drwx------ 2 root root 12288 May 10 15:08 lost+found
-rw-r--r-- 1 root root 182704 Jan 28 2016 memtest86+.bin
-rw-r--r-- 1 root root 184380 Jan 28 2016 memtest86+.elf
-rw-r--r-- 1 root root 184840 Jan 28 2016 memtest86+_multiboot.bin
-rw------- 1 root root 3883391 Jun 14 05:24 System.map-4.4.0-81-generic
-rw------- 1 root root 3883887 Jun 26 12:45 System.map-4.4.0-83-generic
-rw------- 1 root root 3884173 Jul 18 08:00 System.map-4.4.0-87-generic
-rw------- 1 root root 7092784 Jun 14 05:24 vmlinuz-4.4.0-81-generic
-rw------- 1 root root 7094712 Jun 24 15:30 vmlinuz-4.4.0-81-generic.efi.signed
-rw------- 1 root root 7092720 Jun 26 12:45 vmlinuz-4.4.0-83-generic
-rw------- 1 root root 7094648 Jul 3 10:51 vmlinuz-4.4.0-83-generic.efi.signed
-rw------- 1 root root 7095888 Jul 18 08:00 vmlinuz-4.4.0-87-generic
-rw------- 1 root root 7097816 Jul 27 13:18 vmlinuz-4.4.0-87-generic.efi.signed

/boot/efi:
total 28
drwxr-xr-x 1 root root 4 Jul 27 13:17 EFI
-rw-r--r-- 1 root root 34 May 17 11:08 mach_kernel
-rw-r--r-- 1 root root 23055 May 17 12:01 .VolumeIcon.icns

/boot/efi/EFI:
total 0
drwxr-xr-x 1 root root 5 Jul 31 17:22 ubuntu
drwxr-xr-x 1 root root 4 May 17 11:10 Ubuntu 16.04.2 LTS

/boot/efi/EFI/ubuntu:
total 64
drwxr-xr-x 1 root root 2 Jul 27 13:17 fw
-rw-r--r-- 1 root root 64352 Jul 27 13:17 fwupx64.efi
drwxr-xr-x 1 root root 3 Jul 31 17:22 System

/boot/efi/EFI/ubuntu/fw:
total 0

/boot/efi/EFI/ubuntu/System:
total 0
drwxr-xr-x 1 root root 3 Jul 31 17:22 Library

/boot/efi/EFI/ubuntu/System/Library:
total 0
drwxr-xr-x 1 root root 3 Jul 31 17:22 CoreServices

/boot/efi/EFI/ubuntu/System/Library/CoreServices:
total 124
-rw-r--r-- 1 root root 125952 Jul 31 21:53 boot.efi

/boot/efi/EFI/Ubuntu 16.04.2 LTS:
total 4
-rw-r--r-- 1 root root 34 May 17 11:08 mach_kernel
drwxr-xr-x 1 root root 3 May 17 11:10 System

/boot/efi/EFI/Ubuntu 16.04.2 LTS/System:
total 0
drwxr-xr-x 1 root root 3 May 17 11:10 Library

/boot/efi/EFI/Ubuntu 16.04.2 LTS/System/Library:
total 0
drwxr-xr-x 1 root root 6 May 17 11:10 CoreServices

/boot/efi/EFI/Ubuntu 16.04.2 LTS/System/Library/CoreServices:
total 140
-rw-r--r-- 1 root root 125952 May 17 11:10 boot.efi
-rw-r--r-- 1 root root 5751 May 17 11:10 .disk_label
-rw-r--r-- 1 root root 42 May 17 11:10 .disk_label.contentDetails
-rw-r--r-- 1 root root 268 May 17 11:10 SystemVersion.plist

/...

Revision history for this message
cristina (cristina6x) wrote : Re: [Bug 1707832] Re: package shim-signed 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
Download full text (20.7 KiB)

Hi Steve,

Yes, here is the output:

root@asuka:~# ls -lAR /boot
/boot:
total 176999
-rw-r--r-- 1 root root 1246311 Jun 14 05:24 abi-4.4.0-81-generic
-rw-r--r-- 1 root root 1246511 Jun 26 12:45 abi-4.4.0-83-generic
-rw-r--r-- 1 root root 1246670 Jul 18 08:00 abi-4.4.0-87-generic
-rw-r--r-- 1 root root 190356 Jun 14 05:24 config-4.4.0-81-generic
-rw-r--r-- 1 root root 190356 Jun 26 12:45 config-4.4.0-83-generic
-rw-r--r-- 1 root root 190356 Jul 18 08:00 config-4.4.0-87-generic
drwxr-xr-x 1 root root 6 May 17 12:01 efi
drwxr-xr-x 5 root root 1024 Jul 31 17:22 grub
-rw-r--r-- 1 root root 40464919 Jun 24 15:30 initrd.img-4.4.0-81-generic
-rw-r--r-- 1 root root 40466242 Jul 3 10:51 initrd.img-4.4.0-83-generic
-rw-r--r-- 1 root root 40478595 Jul 27 13:19 initrd.img-4.4.0-87-generic
drwx------ 2 root root 12288 May 10 15:08 lost+found
-rw-r--r-- 1 root root 182704 Jan 28 2016 memtest86+.bin
-rw-r--r-- 1 root root 184380 Jan 28 2016 memtest86+.elf
-rw-r--r-- 1 root root 184840 Jan 28 2016 memtest86+_multiboot.bin
-rw------- 1 root root 3883391 Jun 14 05:24 System.map-4.4.0-81-generic
-rw------- 1 root root 3883887 Jun 26 12:45 System.map-4.4.0-83-generic
-rw------- 1 root root 3884173 Jul 18 08:00 System.map-4.4.0-87-generic
-rw------- 1 root root 7092784 Jun 14 05:24 vmlinuz-4.4.0-81-generic
-rw------- 1 root root 7094712 Jun 24 15:30 vmlinuz-4.4.0-81-generic.efi.signed
-rw------- 1 root root 7092720 Jun 26 12:45 vmlinuz-4.4.0-83-generic
-rw------- 1 root root 7094648 Jul 3 10:51 vmlinuz-4.4.0-83-generic.efi.signed
-rw------- 1 root root 7095888 Jul 18 08:00 vmlinuz-4.4.0-87-generic
-rw------- 1 root root 7097816 Jul 27 13:18 vmlinuz-4.4.0-87-generic.efi.signed

/boot/efi:
total 28
drwxr-xr-x 1 root root 4 Jul 27 13:17 EFI
-rw-r--r-- 1 root root 34 May 17 11:08 mach_kernel
-rw-r--r-- 1 root root 23055 May 17 12:01 .VolumeIcon.icns

/boot/efi/EFI:
total 0
drwxr-xr-x 1 root root 5 Jul 31 17:22 ubuntu
drwxr-xr-x 1 root root 4 May 17 11:10 Ubuntu 16.04.2 LTS

/boot/efi/EFI/ubuntu:
total 64
drwxr-xr-x 1 root root 2 Jul 27 13:17 fw
-rw-r--r-- 1 root root 64352 Jul 27 13:17 fwupx64.efi
drwxr-xr-x 1 root root 3 Jul 31 17:22 System

/boot/efi/EFI/ubuntu/fw:
total 0

/boot/efi/EFI/ubuntu/System:
total 0
drwxr-xr-x 1 root root 3 Jul 31 17:22 Library

/boot/efi/EFI/ubuntu/System/Library:
total 0
drwxr-xr-x 1 root root 3 Jul 31 17:22 CoreServices

/boot/efi/EFI/ubuntu/System/Library/CoreServices:
total 124
-rw-r--r-- 1 root root 125952 Jul 31 21:53 boot.efi

/boot/efi/EFI/Ubuntu 16.04.2 LTS:
total 4
-rw-r--r-- 1 root root 34 May 17 11:08 mach_kernel
drwxr-xr-x 1 root root 3 May 17 11:10 System

/boot/efi/EFI/Ubuntu 16.04.2 LTS/System:
total 0
drwxr-xr-x 1 root root 3 May 17 11:10 Library

/boot/efi/EFI/Ubuntu 16.04.2 LTS/System/Library:
total 0
drwxr-xr-x 1 root root 6 May 17 11:10 CoreServices

/boot/efi/EFI/Ubuntu 16.04.2 LTS/System/Library/CoreServices:
total 140
-rw-r--r-- 1 root root 125952 May 17 11:10 boot.efi
-rw-r--r-- 1 root root 5751 May 17 11:10 .disk_label
-rw-r--r-- 1 root root 42 May 17 11:10 .disk_label.contentDetails
-rw-r--r-- 1 root root 268 May 17 11:10 SystemVersion.plist

/...

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

Ok, there's nothing obviously wrong in that output. Can you please try the following commands:

 sudo apt install strace
 sudo strace -ff -o /tmp/grub-install-trace -s 256 grub-install --target=x86_64-efi

And attach the resulting /tmp/grub-install-trace* files to this bug report?

affects: shim-signed (Ubuntu) → grub2 (Ubuntu)
Revision history for this message
cristina (cristina6x) wrote :
Download full text (4.7 KiB)

When I try those commands I get error messages (see below).

I just remembered something that might be related to this bug. A few
months ago I followed a guide to fix a boot error (the computer would
not boot into ubuntu without live DVD). I was able to fix the boot
problem, but maybe its solution is causing this bug? Here is the guide
I followed: http://heeris.id.au/2014/ubuntu-plus-mac-pure-efi-boot/#fixing-efi

cristina@asuka:~$ sudo apt install strace
[sudo] password for cristina:
Reading package lists... Done
Building dependency tree
Reading state information... Done
strace is already the newest version (4.11-1ubuntu3).
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-81 linux-headers-4.4.0-81-generic
  linux-image-4.4.0-81-generic linux-image-extra-4.4.0-81-generic
  linux-signed-image-4.4.0-81-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up grub-efi-amd64-signed (1.66.12+2.02~beta2-36ubuntu3.12) ...
Installing for x86_64-efi platform.
grub-install: error: Can't create file: No such file or directory.
dpkg: error processing package grub-efi-amd64-signed (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up shim-signed (1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1) ...
Installing for x86_64-efi platform.
grub-install: error: Can't create file: No such file or directory.
dpkg: error processing package shim-signed (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 grub-efi-amd64-signed
 shim-signed
E: Sub-process /usr/bin/dpkg returned an error code (1)
cristina@asuka:~$ sudo strace -ff -o /tmp/grub-install-trace -s 256
grub-install --target=x86_64-efi
Installing for x86_64-efi platform.
grub-install: error: Can't create file: No such file or directory.
cristina@asuka:~$

On 8/1/17, Steve Langasek <email address hidden> wrote:
> Ok, there's nothing obviously wrong in that output. Can you please try
> the following commands:
>
> sudo apt install strace
> sudo strace -ff -o /tmp/grub-install-trace -s 256 grub-install
> --target=x86_64-efi
>
> And attach the resulting /tmp/grub-install-trace* files to this bug
> report?
>
> ** Package changed: shim-signed (Ubuntu) => grub2 (Ubuntu)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1707832
>
> Title:
> package shim-signed 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1
> failed to install/upgrade: subprocess installed post-installation
> script returned error exit status 1
>
> Status in grub2 package in Ubuntu:
> Incomplete
>
> Bug description:
> I tried to update ubuntu and I got this error message. I am using
> MacBook late 2007 with lubuntu 16.04 LTS 64bit.
>
> ProblemType: Package
> DistroRelease: Ubuntu 16.04
> Package: shim-signed 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1
> ProcVersionSignature: U...

Read more...

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

On Tue, Aug 01, 2017 at 10:17:09PM -0000, cristina wrote:
> When I try those commands I get error messages (see below).

It looks like despite these errors, you should have generated some files
called '/tmp/grub-install-trace.*' - please attach them.

> I just remembered something that might be related to this bug. A few
> months ago I followed a guide to fix a boot error (the computer would
> not boot into ubuntu without live DVD). I was able to fix the boot
> problem, but maybe its solution is causing this bug? Here is the guide
> I followed: http://heeris.id.au/2014/ubuntu-plus-mac-pure-efi-boot/#fixing-efi

It's quite possible. I don't think that having an hfs+ filesystem as your
EFI System Partition is compliant with the UEFI spec, and I don't know how
grub is interacting with this; but the strace output should tell us where to
look.

Revision history for this message
cristina (cristina6x) wrote :
Download full text (3.2 KiB)

Hi Steve,

Okay, I have attached the trace files from tmp.

Thanks!

On 8/2/17, Steve Langasek <email address hidden> wrote:
> On Tue, Aug 01, 2017 at 10:17:09PM -0000, cristina wrote:
>> When I try those commands I get error messages (see below).
>
> It looks like despite these errors, you should have generated some files
> called '/tmp/grub-install-trace.*' - please attach them.
>
>> I just remembered something that might be related to this bug. A few
>> months ago I followed a guide to fix a boot error (the computer would
>> not boot into ubuntu without live DVD). I was able to fix the boot
>> problem, but maybe its solution is causing this bug? Here is the guide
>> I followed:
>> http://heeris.id.au/2014/ubuntu-plus-mac-pure-efi-boot/#fixing-efi
>
> It's quite possible. I don't think that having an hfs+ filesystem as your
> EFI System Partition is compliant with the UEFI spec, and I don't know how
> grub is interacting with this; but the strace output should tell us where
> to
> look.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1707832
>
> Title:
> package shim-signed 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1
> failed to install/upgrade: subprocess installed post-installation
> script returned error exit status 1
>
> Status in grub2 package in Ubuntu:
> Incomplete
>
> Bug description:
> I tried to update ubuntu and I got this error message. I am using
> MacBook late 2007 with lubuntu 16.04 LTS 64bit.
>
> ProblemType: Package
> DistroRelease: Ubuntu 16.04
> Package: shim-signed 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1
> ProcVersionSignature: Ubuntu 4.4.0-87.110-generic 4.4.73
> Uname: Linux 4.4.0-87-generic x86_64
> .proc.sys.kernel.moksbstate_disabled: 0
> ApportVersion: 2.20.1-0ubuntu2.10
> Architecture: amd64
> BootEFIContents:
> fw
> fwupx64.efi
> System
> Date: Mon Jul 31 17:22:53 2017
> EFIBootMgr:
> BootCurrent: 0000
> Timeout: 0 seconds
> BootOrder: 0004
> Boot0004* Ubuntu 16.04.2
> LTS HD(1,GPT,6aa06c3c-cd2f-477e-a7a8-01871ef8de84,0x800,0x100000)/File(\System\Library\CoreServices)
> BootFFFF*
> PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0,0,0)/HD(1,GPT,6aa06c3c-cd2f-477e-a7a8-01871ef8de84,0x800,0x100000)/File(\EFI\Ubuntu
> 16.04.2 LTS\System\Library\CoreServices\boot.efi)
> EFITables:
> Jul 31 08:51:10 asuka kernel: efi: EFI v1.10 by Apple
> Jul 31 08:51:10 asuka kernel: efi: ACPI=0xbeeee000 ACPI 2.0=0xbeeee014
> SMBIOS=0xbeec3000
> ErrorMessage: subprocess installed post-installation script returned error
> exit status 1
> InstallationDate: Installed on 2017-05-10 (82 days ago)
> InstallationMedia: Ubuntu 14.04.2 LTS "Trusty Tahr" - Release amd64
> (20150218.1)
> RelatedPackageVersions:
> dpkg 1.18.4ubuntu1.2
> apt 1.2.20
> SourcePackage: shim-signed
> Title: package shim-signed 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1
> failed to install/upgrade: subprocess installed post-installation script
> returned error exit status 1
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug go to:
> https://bugs.l...

Read more...

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

Thanks, the trace shows:

open("/boot/efi/EFI/ubuntu/mach_kernel", O_RDWR) = -1 ENOENT (No such file or directory)
write(2, "grub-install: error:", 20) = 20
write(2, " ", 1) = 1
write(2, "Can't create file: No such file or directory", 44) = 44

I notice that your /boot/efi directory has a /boot/efi/EFI/Ubuntu 16.04.2 LTS/mach_kernel, but not a /boot/efi/EFI/ubuntu/mach_kernel which is the directory that Ubuntu's GRUB expects to use.

If you copy /boot/efi/EFI/Ubuntu 16.04.2 LTS/mach_kernel to /boot/efi/EFI/ubuntu/mach_kernel, does the package install then succeed?

Full disclosure, I have no idea at all if this might make your system unbootable. A successful grub-install may overwrite the Apple-specific EFI boot variables with something other than what the system expects.

Revision history for this message
cristina (cristina6x) wrote :
Download full text (5.1 KiB)

Hi Steve,

I followed your instructions and copied /boot/efi/EFI/Ubuntu 16.04.2
LTS/mach_kernel to
/boot/efi/EFI/ubuntu/mach_kernel

I then installed grub manually using a modified command from same
guide I referred to earlier

sudo grub-install --target x86_64-efi --boot-directory=/boot
--efi-directory=/boot/efi --bootloader-id="ubuntu"

The install succeeded!

Please find below the terminal printout and attached trace files.

I will attempt to restart the system after I send this message. Thanks
for your help! :)

cristina@asuka:~$ sudo bash -c 'echo "This file is required for
booting" > "/boot/efi/EFI/ubuntu/mach_kernel"'
[sudo] password for cristina:
cristina@asuka:~$ sudo grub-install --target x86_64-efi
--boot-directory=/boot --efi-directory=/boot/efi
--bootloader-id="ubuntu"
Installing for x86_64-efi platform.
Installation finished. No error reported.
cristina@asuka:~$ sudo apt install strace
Reading package lists... Done
Building dependency tree
Reading state information... Done
strace is already the newest version (4.11-1ubuntu3).
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-81 linux-headers-4.4.0-81-generic
  linux-image-4.4.0-81-generic linux-image-extra-4.4.0-81-generic
  linux-signed-image-4.4.0-81-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up grub-efi-amd64-signed (1.66.12+2.02~beta2-36ubuntu3.12) ...
Installing for x86_64-efi platform.
Installation finished. No error reported.
Setting up shim-signed (1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1) ...
Installing for x86_64-efi platform.
Installation finished. No error reported.
No DKMS packages installed: not changing Secure Boot validation state.
cristina@asuka:~$ sudo strace -ff -o /tmp/grub-install-trace -s 256
grub-install --target=x86_64-efi
Installing for x86_64-efi platform.
Installation finished. No error reported.
cristina@asuka:~$

On 8/2/17, Steve Langasek <email address hidden> wrote:
> Thanks, the trace shows:
>
> open("/boot/efi/EFI/ubuntu/mach_kernel", O_RDWR) = -1 ENOENT (No such file
> or directory)
> write(2, "grub-install: error:", 20) = 20
> write(2, " ", 1) = 1
> write(2, "Can't create file: No such file or directory", 44) = 44
>
> I notice that your /boot/efi directory has a /boot/efi/EFI/Ubuntu
> 16.04.2 LTS/mach_kernel, but not a /boot/efi/EFI/ubuntu/mach_kernel
> which is the directory that Ubuntu's GRUB expects to use.
>
> If you copy /boot/efi/EFI/Ubuntu 16.04.2 LTS/mach_kernel to
> /boot/efi/EFI/ubuntu/mach_kernel, does the package install then succeed?
>
> Full disclosure, I have no idea at all if this might make your system
> unbootable. A successful grub-install may overwrite the Apple-specific
> EFI boot variables with something other than what the system expects.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1707832
>
> Title:
> package shim-signed 1.32~16.04.1+0.9+147...

Read more...

Revision history for this message
cristina (cristina6x) wrote :
Download full text (6.0 KiB)

Hi Steve,

The computer still boots successfully!

So now I have two directories in /boot/efi/EFI, one called "ubuntu" and
the other called "Ubuntu 16.04.2 LTS".

1. Would you recommend I remove the older Ubuntu 16.04.2 LTS directory?

2. Do you think this problem will occur again for future updates?

Some more info:

The ubuntu directory has a plist file in it that says product version
2.02~beta2-36ubuntu3.12

The Ubuntu 16.04.2 LTS directory has a plist file in it that says
product version 2.02~beta2-36ubuntu3.9

When I boot the computer it only shows the newer version
2.02~beta2-36ubuntu3.12.

Thank you very much for your help!

On 8/3/17, Christopher Broski <email address hidden> wrote:
> Hi Steve,
>
> I followed your instructions and copied /boot/efi/EFI/Ubuntu 16.04.2
> LTS/mach_kernel to
> /boot/efi/EFI/ubuntu/mach_kernel
>
> I then installed grub manually using a modified command from same
> guide I referred to earlier
>
> sudo grub-install --target x86_64-efi --boot-directory=/boot
> --efi-directory=/boot/efi --bootloader-id="ubuntu"
>
> The install succeeded!
>
> Please find below the terminal printout and attached trace files.
>
> I will attempt to restart the system after I send this message. Thanks
> for your help! :)
>
> cristina@asuka:~$ sudo bash -c 'echo "This file is required for
> booting" > "/boot/efi/EFI/ubuntu/mach_kernel"'
> [sudo] password for cristina:
> cristina@asuka:~$ sudo grub-install --target x86_64-efi
> --boot-directory=/boot --efi-directory=/boot/efi
> --bootloader-id="ubuntu"
> Installing for x86_64-efi platform.
> Installation finished. No error reported.
> cristina@asuka:~$ sudo apt install strace
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> strace is already the newest version (4.11-1ubuntu3).
> The following packages were automatically installed and are no longer
> required:
> linux-headers-4.4.0-81 linux-headers-4.4.0-81-generic
> linux-image-4.4.0-81-generic linux-image-extra-4.4.0-81-generic
> linux-signed-image-4.4.0-81-generic
> Use 'sudo apt autoremove' to remove them.
> 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
> 2 not fully installed or removed.
> After this operation, 0 B of additional disk space will be used.
> Do you want to continue? [Y/n] y
> Setting up grub-efi-amd64-signed (1.66.12+2.02~beta2-36ubuntu3.12) ...
> Installing for x86_64-efi platform.
> Installation finished. No error reported.
> Setting up shim-signed (1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1) ...
> Installing for x86_64-efi platform.
> Installation finished. No error reported.
> No DKMS packages installed: not changing Secure Boot validation state.
> cristina@asuka:~$ sudo strace -ff -o /tmp/grub-install-trace -s 256
> grub-install --target=x86_64-efi
> Installing for x86_64-efi platform.
> Installation finished. No error reported.
> cristina@asuka:~$
>
>
> On 8/2/17, Steve Langasek <email address hidden> wrote:
>> Thanks, the trace shows:
>>
>> open("/boot/efi/EFI/ubuntu/mach_kernel", O_RDWR) = -1 ENOENT (No such
>> file
>> or directory)
>> write(2, "grub-install: error:", 20) = 20
>> write(2, " ", 1) = 1
>> w...

Read more...

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

> The computer still boots successfully!

Well, that's good to hear!

> So now I have two directories in /boot/efi/EFI, one called "ubuntu" and
> the other called "Ubuntu 16.04.2 LTS".

> 1. Would you recommend I remove the older Ubuntu 16.04.2 LTS directory?

> 2. Do you think this problem will occur again for future updates?

I am uncertain if removing the older directory will cause problems. It depends on whether anything is referencing it in your boot path. You may want to check the output of 'sudo efibootmgr -v' to see.

This problem should not recur on future updates now that the mach_kernel file exists.

> I then installed grub manually using a modified command from same
> guide I referred to earlier

> sudo grub-install --target x86_64-efi --boot-directory=/boot
> --efi-directory=/boot/efi --bootloader-id="ubuntu"

This should have the same result as just running 'sudo grub-install'. In fact, the use of a different --bootloader-id before, instead of the 'ubuntu' value expected by the packages, is probably what led to the problems in the config.

I'm not sure whether there is anything further we should do to improve the grub package here. The immediate cause of the failure was the following of a third-party guide, however it should not have been necessary for you to follow a third-party guide at all - the installation should have just done the right thing for you out of the box. So I'll leave this bug report open for further triaging by the grub maintainers.

Changed in grub2 (Ubuntu):
status: Incomplete → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
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.