[Bug 1928858] [NEW] grub-install error: "efibootmgr: not found"

2021-05-18 Thread Benjamin Curtiss
Public bug reported:

> 1) The release of Ubuntu you are using, via 'lsb_release -rd' or
System -> About Ubuntu

Description:Ubuntu 18.04.5 LTS
Release:18.04

> 2) The version of the package you are using, via 'apt-cache policy
pkgname' or by checking in Software Center

grub2-common version: 2.02-2ubuntu8.23
grub-efi-amd64-bin: 2.04-1ubuntu44

> 3) What you expected to happen

`grub-install --force "dummy"` to run correctly when installing into
UEFI

> 4) What happened instead

`grub-install --force "dummy"` failed and output the error `grub-install
error: "efibootmgr: not found"`

I create a custom ubuntu bionic installation cd, which uses the old
debian-installer grub-installer component to install grub onto the
target system. This grub-installer component runs the following command:
`grub-install --force "dummy"`

Recently when installing this custom ubuntu installation cd on a system
using UEFI, debian-installer would fail with an error message stating
"Unable to install GRUB in dummy: Executing 'grub-install dummy' failed.
This is a fatal error."

After some digging, I discovered the root of the issue. From the
/var/log/syslog of the installation, I could see that the fatal error
that occurred during the `grub-install` command was "grub-install:
error: efibootmgr: not found". Digging a bit more, I discovered that on
previous systems, the efibootmgr command was installed via the
efibootmgr package, which was a dependency of grub-efi-amd64-bin.
However, in the most recent version of grub-efi-amd64-bin, efibootmgr
had been moved from "Depends" to "Recommends", and as such was not
included on my custom ubuntu bionic installation cd. Thus, when grub-
install tried to run the efibootmgr command, it was not available.

This is the most recent bionic version of grub-efi-amd64-bin that I've
personally had installed that directly depended on efibootmgr:
https://launchpad.net/ubuntu/bionic/amd64/grub-efi-
amd64-bin/2.02-2ubuntu8.21

...and this is the most recent bionic version of grub-efi-amd64-bin at
the time of writing this bug report:
https://launchpad.net/ubuntu/bionic/amd64/grub-efi-
amd64-bin/2.04-1ubuntu44

I noticed that the upstream version of the package changed from 2.02 to
2.04 between these two versions; I suspect that is partially the cause
of this "Depends" being moved to "Recommends".

I suspect that the solution here would be one of:
- Update grub-efi-amd64-bin to re-add efibootmgr as "Depends"
- Add efibootmgr as "Depends" for grub2-common, since grub2-common is the 
package that provides the grub-install command that ultimately needs the 
efibootmgr command to be in place.
- Update grub-install to no longer depend on efibootmgr

I've attached the stderr of `grub-install --verbose --force "dummy"` as
well, just in case it could be useful. There was nothing output to
stdout when the command ran.

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

** Package changed: ubuntu-release-upgrader (Ubuntu) => grub (Ubuntu)

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

Title:
  grub-install error: "efibootmgr: not found"

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1851806] Re: 'module' object has no attribute 'O_PATH'

2019-11-14 Thread Benjamin Curtiss
Here's a reproduction of the error:

bcurtiss@bcurtiss-laptop:~$ ipython
Python 2.7.12 (default, Oct  8 2019, 14:14:10) 
Type "copyright", "credits" or "license" for more information.

IPython 2.4.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help  -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import apport_python_hook; 
apport_python_hook.apport_excepthook(Exception, Exception(), None)
Exception
---
AttributeErrorTraceback (most recent call last)
 in ()
> 1 import apport_python_hook; 
apport_python_hook.apport_excepthook(Exception, Exception(), None)

/usr/lib/python2.7/dist-packages/apport_python_hook.pyc in 
apport_excepthook(exc_type, exc_obj, exc_tb)
107 traceback.print_exception(exc_type, exc_obj, exc_tb, 
file=tb_file)
108 pr['Traceback'] = tb_file.getvalue().strip()
--> 109 pr.add_proc_info(extraenv=['PYTHONPATH', 'PYTHONHOME'])
110 pr.add_user_info()
111 # override the ExecutablePath with the script that was actually 
running

/usr/lib/python2.7/dist-packages/apport/report.pyc in add_proc_info(self, pid, 
proc_pid_fd, extraenv)
517 self.pid = int(pid)
518 pid = str(pid)
--> 519 proc_pid_fd = os.open('/proc/%s' % pid, os.O_RDONLY | 
os.O_PATH | os.O_DIRECTORY)
520 
521 try:

AttributeError: 'module' object has no attribute 'O_PATH'

In [2]: exit
bcurtiss@bcurtiss-laptop:~$ ipython3
Python 3.5.2 (default, Oct  8 2019, 13:06:37) 
Type "copyright", "credits" or "license" for more information.

IPython 2.4.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help  -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import apport_python_hook; 
apport_python_hook.apport_excepthook(Exception, Exception(), None)
Exception

In [2]: exit
bcurtiss@bcurtiss-laptop:~$

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

Title:
  'module' object has no attribute 'O_PATH'

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1851806] Re: 'module' object has no attribute 'O_PATH'

2019-11-14 Thread Benjamin Curtiss
I'm not exactly sure how to reproduce this bug, but I did encounter the
same issue. It looks like the bug was recently introduced in this
commit:
https://git.launchpad.net/ubuntu/+source/apport/commit/?h=applied/ubuntu
/xenial-security=ecd7418b02911c6649b69a592cca74cfbac8813d

```
@@ -510,22 +510,24 @@ class Report(problem_report.ProblemReport):
 - _LogindSession: logind cgroup path, if present (Used for filtering
   out crashes that happened in a session that is not running any more)
 '''
-if not pid:
-pid = self.pid or os.getpid()
-if not self.pid:
-self.pid = int(pid)
-pid = str(pid)
+if not proc_pid_fd:
+if not pid:
+pid = self.pid or os.getpid()
+if not self.pid:
+self.pid = int(pid)
+pid = str(pid)
+proc_pid_fd = os.open('/proc/%s' % pid, os.O_RDONLY | os.O_PATH | 
os.O_DIRECTORY)
 
 try:
-self['ProcCwd'] = os.readlink('/proc/' + pid + '/cwd')
+self['ProcCwd'] = os.readlink('cwd', dir_fd=proc_pid_fd)
 except OSError:
 pass
 self.add_proc_environ(pid, extraenv)
-self['ProcStatus'] = _read_file('/proc/' + pid + '/status')
-self['ProcCmdline'] = _read_file('/proc/' + pid + 
'/cmdline').rstrip('\0')
-self['ProcMaps'] = _read_maps(int(pid))
+self['ProcStatus'] = _read_file('status', dir_fd=proc_pid_fd)
+self['ProcCmdline'] = _read_file('cmdline', 
dir_fd=proc_pid_fd).rstrip('\0')
+self['ProcMaps'] = _read_maps(proc_pid_fd)
 try:
-self['ExecutablePath'] = os.readlink('/proc/' + pid + '/exe')
+self['ExecutablePath'] = os.readlink('exe', dir_fd=proc_pid_fd)
 except OSError as e:
 if e.errno == errno.ENOENT:
 raise ValueError('invalid process')
```

The problem is that os.O_PATH does not exist in python2, and only exists
in python3. However, python-apport is a python2 package.

```
bcurtiss@bcurtiss-laptop:~$ python3 -c 'import os; print(os.O_PATH)'
2097152
bcurtiss@bcurtiss-laptop:~$ python -c 'import os; print(os.O_PATH)'
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'module' object has no attribute 'O_PATH'
bcurtiss@bcurtiss-laptop:~$
```

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

Title:
  'module' object has no attribute 'O_PATH'

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1616368] Re: Unable to upgrade ubuntu server from 14.04.4 to 16.04.1

2019-02-01 Thread Benjamin Curtiss
I believe that I ran into the same issue while trying to run do-release-
upgrade to upgrade my machine from 14.04.5 to 16.04.5.

It would seem that the problem is that the plymouth package does not
properly depend on the udev package, so when both are being upgraded (as
is done during do-release-upgrade), the postinst script for plymouth is
run before the postinst script for udev. This causes the plymouth
postinst to complain about the udev service not being enabled, which
doesn't happen until after the udev postinst runs.

A log snippet from my do-release-upgrade run that shows udev postinst running 
after plymouth postinst:
```
Setting up plymouth (0.9.2-3ubuntu13.5) ...
update-initramfs: deferring update (trigger activated)
update-rc.d: warning: start and stop actions are no longer supported; falling 
back to defaults
insserv: Service udev has to be enabled to start service plymouth
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package plymouth (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up libpython-stdlib:amd64 (2.7.12-1~16.04) ...
Setting up gir1.2-glib-2.0:amd64 (1.46.0-3ubuntu1) ...
Setting up udev (229-4ubuntu21.15) ...
```

I can see from
http://archive.ubuntu.com/ubuntu/pool/main/p/plymouth/plymouth_0.9.3-1ubuntu7.debian.tar.xz
that the bionic version of plymouth does indeed have a dependency on
udev. So perhaps this same dependency just needs to also be added to the
xenial version?

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

Title:
  Unable to upgrade ubuntu server from 14.04.4 to 16.04.1

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1616368/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs