Comment 24 for bug 1813662

Revision history for this message
Philippe Ombredanne (pombredanne) wrote :

FYI, this is the kind of wart this issue is forcing down on me and all my users:
https://github.com/nexB/extractcode/blob/aa5da29014ce4fbffca53c09689a2623e2b78196/src/extractcode/vmimage.py#L82

> def check_linux_kernel_is_readable():
> """
> Return True if the kernel executable file can be read. This is required by
> guestfish and libguestfs and this is an oddity mostly on Ubuntu.
> See:
> - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725
> - https://bugzilla.redhat.com/show_bug.cgi?id=1670790
> - https://bugs.launchpad.net/ubuntu/+source/libguestfs/+bug/1813662
> """

I would like to create a package that fix this issue.

Is this the correct way:

1. As sudo, create the file /etc/kernel/postinst.d/statoverride with this
content, devised by Kees Cook (@kees) in
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725/comments/3 ::

    #!/bin/sh
    version="$1"
    # passing the kernel version is required
    [ -z "${version}" ] && exit 0
    dpkg-statoverride --update --add root root 0644 /boot/vmlinuz-${version}

2. Setup the exxecutable permissions::

    sudo chmod +x /etc/kernel/postinst.d/statoverride

And if yes, is this enough to create a package that adds this file?