snapcraft kernel plugin puts module and firmware under 15.04-era lib/ directory

Bug #1658177 reported by Luke Williams
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Critical
Loïc Minier

Bug Description

I built a custom kernel with custom modules built in. I can build the kernel snap and build the custom image using ubuntu-image and install it on my device with no issues, however, when I try to list the installed modules, no modules are installed and I get an error message saying that the /lib/modules/`uname -r`/modules.dep.bin is missing, which, if I go to /lib/modules/ the directory is empty. However, if I browse to /snap/kernel/x1/lib/modules/`uname -r`/ there everything is.

I included the kernel snap, my redacted model, and the kernel snap snapcraft.yaml. I build the image with the following command:

sudo /snap/bin/ubuntu-image -c edge -o fb-snappy.img --extra-snaps fb-kernel_3.18.25_amd64.snap fb-onl.model

I'm running ubuntu-image 0.12+real1

Let me know if you need any other information.

Thanks,
Luke

Revision history for this message
Luke Williams (wililupy) wrote :
Revision history for this message
Luke Williams (wililupy) wrote :
Revision history for this message
Luke Williams (wililupy) wrote :
Revision history for this message
John Lenton (chipaca) wrote :

Can you tell us the contents of /proc/cmdline, and the output of “ls /var/lib/snapd/snaps” and “snap list”? Thanks.

Revision history for this message
Oliver Grawert (ogra) wrote :

hmm, the use of CONFOG_LOCALVERSION makes your modules dir be called "3.18.25-OpenNetworkLinux" ... the snapcraft.yaml does not use this version string (lacking the -OpenNetworkLinux) ... try adding this proper so the snap version actually matches the content versioning ...

Revision history for this message
Oliver Grawert (ogra) wrote :

(or alternatively you could just drop the LOCALVERSION option indeed)

Revision history for this message
Michael Vogt (mvo) wrote :

The issue that snappy is tripping over is that it expects the following toplevel dirs in a kernel snap: "firmware" and "modules". It looks like in this kernel snap both dirs also only provided under "./lib". Please check the reference kernels as an example.

Revision history for this message
Michael Vogt (mvo) wrote :

I.e. if you move the two subdirs of "./lib" form your kernel snap to "./" the mounting should work.

Revision history for this message
Luke Williams (wililupy) wrote :

That did work by moving the the subdirs to the ./ directory.

Is there a reason why when you build the kernel snap, it doesn't do this by default? Should I create a bug against snapcraft as to why the kernel plugin is building the /lib/modules/`uname -r` directory?

Thank you everyone for the help on this.

John Lenton (chipaca)
affects: ubuntu-image → snapcraft
summary: - custom kernel doesn't mount /lib/modules/`uname -r` in custom image
+ snapcraft kernel plugin puts module and firmware under 15.04-era lib/
+ directory
Revision history for this message
Loïc Minier (lool) wrote :

Trying to build the specific snapcraft.yaml attached to this bug, I wondered where to get extra sources from; I took linux 3.18.25 and applied two patches from this series, and used the config from this:
https://github.com/opencomputeproject/OpenNetworkLinux/tree/master/packages/base/any/kernels/3.18.25/

(Is this correct?)

Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Loïc Minier (lool)
milestone: none → 2.27
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
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.