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:

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 (

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

English Edit question
Ubuntu linux-signed Edit question
No assignee Edit question
Solved by:
Emilio Lopez
Last query:
Last reply: