Creating a Kernel Snap fails

Asked by Emilio Lopez on 2018-07-16

My ultimate goal is to create a kernel snap for an Ubuntu Core image with an amd64 based architecture. I was previously using the "pc-kernel" snap, which was based on Linux 4.4.0. I found a bug, that has been fixed in a newer version of the Linux Kernel.

I have attempted to create a generic Ubuntu base Linux kernel from: https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/bionic.

I checked out on several git tags (which I presume should be stable releases). They are:
- Ubuntu-4.15.0-9.10
- Ubuntu-4.15.0-10.11
- Ubuntu-4.15.0-27.29
- etc.

I have been told that it is possible to create a kernel snap by simply running `snapcraft snap`. When running this command, the build fails multiple times. I get the following type of errors:

** First type **
make: *** No rule to make target 'firmware_install'. Stop.

Failed to run 'make -j8 CONFIG_PREFIX=/root/ubuntu-bionic/parts/kernel/install modules_install INSTALL_MOD_PATH=/root/ubuntu-bionic/parts/kernel/install firmware_install INSTALL_FW_PATH=/root/ubuntu-bionic/parts/kernel/install/lib/firmware' for 'kernel': Exited with code 2.
Verify that the part is using the correct parameters and try again.

** Second type **
/bin/bash: ./scripts/ubuntu-retpoline-extract-one: No such file or directory
Failed to run 'make -j2 bzImage modules' for 'kernel': Exited with code 2.
Verify that the part is using the correct parameters and try again.

Furthermore I have installed various combinations of the package dependencies but still run into the same error (https://packages.ubuntu.com/bionic/kernel/linux-image-4.15.0-24-generic).

Below is the following information for my Ubuntu 16.04 Server:

lopezem@fit-ubuntu-server:bionic$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial

lopezem@fit-ubuntu-server:bionic$ uname -a
Linux fit-ubuntu-server 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Any feedback is appreciated!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu linux-signed Edit question
Assignee:
No assignee Edit question
Solved by:
Emilio Lopez
Solved:
2018-07-20
Last query:
2018-07-20
Last reply: