Best Practice for building modules and including them in Kernel Snap

2017-03-15 Thread Luke Williams
Hello,

What are the best practices for building and including kernel modules with
kernel snaps?

Prior to snapcraft 2.25, when building kernel snaps, the modules would be
located in parts/kernel/install/lib/modules// so that if I
needed to add custom modules, I could put them in this path and then run
depmod -a -b parts/kernel/install/  and it would update the
modules dependancies and symbols and then I could run snapcraft snap and
package everything up.

Now that the modules and firmware directories fall under
parts/kernel/install the depmod -b doesn't work anymore.

What I have done to make this work is I create a symlink to install as lib
and then I can run the depmod command, then I remove the lib symlink and
then run snapcraft snap and everything is good.

This seems kind of kludgy and not the right way to do this. Is there a
recommended way that this should be handled?

-- 
Thanks,


Luke Williams - Technical Partner Manager, Network Switches and Ubuntu-Core
luke.willi...@canonical.com
www.canonical.com || www.ubuntu.com
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Error using custom image

2017-01-23 Thread Luke Williams
I created a bug and uploaded my snapcraft.yaml to the bug as well as the
kernel.snap.

It is bug https://bugs.launchpad.net/ubuntu-image/+bug/1658177

The cmdline boots kernel.img from my snap using the x1 revision.
(Fb-kernel-x1.snap) which is located in /bar/lib/snapd/snaps

Let me know if you need any more information.

Thanks,
Luke

On Mon, Jan 23, 2017 at 6:09 AM Oliver Grawert <o...@ubuntu.com> wrote:

> hi,
>
> Am Freitag, den 20.01.2017, 10:24 -0800 schrieb Luke Williams:
>
> > Hi,
>
> > So I now get a listing when I use 'snap list' of the installed snaps
>
> > compared to in the past where it would ask to install a snap.
>
> > However, my /lib/modules/ directory and /lib/firmware directory are
>
> > empty, however, when I look in /snap/kernel/x1 the kernel.img,
>
> > initrd.img, the .dep and .dep.bin and the modules and firmware
>
> > directories are all there. I look in the syslog and dmesg and I don't
>
> > see any errors other than systemd cannot find my dependency file in
>
> > /lib/modules/4.8.0-RC5/modules.dep.bin.
>
> > Any ideas on this error?
>
>
>
> as john said, it would be interesting to know whats in your
>
> /proc/cmdline (i suspect there might be a confusion between x1 and
>
> 4.8.0-RC5, the boot should use the latter for the snap_kernel=
>
> variable)...
>
>
>
> also a link to the kernel snap would be interesting. did you check that
>
> the modules.dep.bin file exists inside the snap (theoretically the
>
> snapcraft kernel plugin should make sure it is created, but you never
>
> know ;) )
>
>
>
> ciao
>
> oli--
>
> Snapcraft mailing list
>
> Snapcraft@lists.snapcraft.io
>
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/snapcraft
>
>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Error using custom image

2017-01-20 Thread Luke Williams
Hi,

So I now get a listing when I use 'snap list' of the installed snaps
compared to in the past where it would ask to install a snap. However,
my /lib/modules/ directory and /lib/firmware directory are empty,
however, when I look in /snap/kernel/x1 the kernel.img, initrd.img, the
.dep and .dep.bin and the modules and firmware directories are all
there. I look in the syslog and dmesg and I don't see any errors other
than systemd cannot find my dependency file in
/lib/modules/4.8.0-RC5/modules.dep.bin.

Any ideas on this error?


On 01/20/2017 01:06 AM, Oliver Grawert wrote:
> hi,
> Am Donnerstag, den 19.01.2017, 17:52 -0800 schrieb Luke Williams:
>> In the assertion file for the image, if it is amd64, is the model and
>> gadget still pc or is it core now?
>>
> core is hardcoded in ubuntu-image to provide the rootfs, you usually do
> not need to specify it anywhere. 
>
> if you dont plan to modify the gadget, keep pc and let it also download
> from the store.
> the name of the assertion does not matter as long as you use the right
> filename in the ubuntu-image call.
>
> ciao
>   oli
>
>

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Error using custom image

2017-01-19 Thread Luke Williams
In the assertion file for the image, if it is amd64, is the model and gadget 
still pc or is it core now?

Thanks,

Luke Williams - Technical Partner Manager, Open Networking/Ubuntu-Core
email: luke.willi...@canonical.com <mailto:luke.willi...@canonical.com>
http://www.canonical.com/ <http://www.canonical.com/> | http://www.ubuntu.com 
<http://www.ubuntu.com/>






> On Jan 19, 2017, at 9:18 AM, Oliver Grawert <o...@ubuntu.com> wrote:
> 
> hi,
> Am Donnerstag, den 19.01.2017, 09:08 -0800 schrieb Luke Williams:
>> That fixed it for the most part. Now we are getting dropped to a
>> maintenance shell saying that our /lib/modules/ directory is empty. I
>> feel this might have something to do with how we are building the
>> kernel itself. 
> 
> so how do you build the kernel yourself ? 
> 
> note that you should use snapcraft and the kernel plugin to properly
> create a snap of it, which will put the modules in the right places.
> 
> this snap you then hand to ubuntu-image with the --extra-snaps option
> when creating the signed image ...
> 
> https://docs.ubuntu.com/core/en/guides/build-device/image-building
> 
> describes this process in detail ...
> 
> ciao
>   oli-- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Error using custom image

2017-01-19 Thread Luke Williams
That fixed it for the most part. Now we are getting dropped to a maintenance 
shell saying that our /lib/modules/ directory is empty. I feel this might have 
something to do with how we are building the kernel itself. 

Thanks,

Luke Williams - Technical Partner Manager, Open Networking/Ubuntu-Core
email: luke.willi...@canonical.com <mailto:luke.willi...@canonical.com>
http://www.canonical.com/ <http://www.canonical.com/> | http://www.ubuntu.com 
<http://www.ubuntu.com/>






> On Jan 18, 2017, at 10:56 AM, Sergio Schvezov <sergio.schve...@canonical.com> 
> wrote:
> 
> On Wed, 18 Jan 2017 18:42:27 +, Luke Williams wrote:
>> Hello,
>> 
>> We are trying to build a custom image with a custom kernel. The 
>> kernel build and making the image goes without a hitch, however, 
>> when we try to run it in Virtual Box, we get the following 
>> error:
>> 
>> 
>> 
>> And it fails to load. 
>> We have tried an image built with the custom kernel, one built 
>> with a yaketty kernel, and one that we just build with all stock 
>> pieces. None of them can get past this part.
>> 
>> If we use the image that we download from cdimages, that one 
>> works. When we look at the images side by side, we can’t see any 
>> differences. 
>> Is there anything you recommend we check to see why it cannot 
>> see the writable partition?
> 
> Without havig touched this in a while have you ensured you have vfat and 
> squashfs either built-in or in initramfs?
> 
> -- 
> Sent using Dekko from my Ubuntu device
> 
> -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io <mailto:Snapcraft@lists.snapcraft.io>
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft 
> <https://lists.ubuntu.com/mailman/listinfo/snapcraft>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Apparmor error when using classic mode

2017-01-14 Thread Luke Williams
Hello,

I have the following error when I try to install my snap in classic mode:

root@ubuntu:~# snap install flexswitch_1.0.0.178.0_amd64.snap --classic
--force-dangerous
error: cannot perform the following tasks:

- Setup snap "flexswitch" (unset) security profiles (cannot setup apparmor
for snap "flexswitch": cannot load apparmor profile "snap.flex
switch.flexswitch": cannot load apparmor profile: exit status 1

apparmor_parser output:

profile has merged rule with conflicting x modifiers

ERROR processing regexs for profile snap.flexswitch.flexswitch, failed to
load
)

- Setup snap "flexswitch" (unset) security profiles (cannot load apparmor
profile "snap.flexswitch.flexswitch": cannot load apparmor prof
ile: exit status 1

apparmor_parser output:

profile has merged rule with conflicting x modifiers

ERROR processing regexs for profile snap.flexswitch.flexswitch, failed to
load
)


I cannot find any information on why it is failing to install. Any thing I
should look at to see what is keeping this from working or any more
information you need to assist in troubleshooting?

I am trying to install this snap on 16.04 Server.

-- 
Thanks,


Luke Williams - Technical Partner Manager, Network Switches and Ubuntu-Core
luke.willi...@canonical.com
www.canonical.com || www.ubuntu.com
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: core_383.snap missing after reboot of Ubuntu-Core

2016-11-02 Thread Luke Williams
Figured it out with the help of community. It was due to my kernel snap having 
a specific name in my assertion and it was causing the core snap to remove 
itself after failed boot. I had to give the assertion model the generic “name” 
of my kernel snap and then point the actual kernel snap file name. Once I 
rebuilt my image that way, everything was good to go and it works properly and 
shows up in the snap list correctly, and subsequent reboots the system does not 
remove the core snap. 

Now I just have to work on my script to convert the ubuntu-core image to ONIE, 
but that is outside of this topic.


Thanks,

Luke Williams - Technical Partner Manager, Network Switches/Ubuntu-Core
email: luke.willi...@canonical.com <mailto:luke.willi...@canonical.com>
http://www.canonical.com/ <http://www.canonical.com/> | http://www.ubuntu.com 
<http://www.ubuntu.com/>





> On Nov 2, 2016, at 12:31 PM, Luke Williams <luke.willi...@canonical.com> 
> wrote:
> 
> Hello,
> 
> I have an interresting situation happening.
> 
> I created a custom ubuntu-core image with a custom kernel snap from yakkety 
> from kernel.ubuntu.com <http://kernel.ubuntu.com/>. I build the snap using 
> the included snapcraft.yaml and just changing the name and version number and 
> description and then I use ubuntu-image to build the image. I then had to 
> modify the system-boot image to get it to work properly with the ONIE install 
> scripts since for some reason prefix in grub is hard coded to 
> /EFI/ubuntu/grub directory, I had to copy the grub.cfg and grubenv to a grub 
> directory. For some reason when I changed the install script for the ONIE 
> installer to /EFI/ubuntu grub would fail and the system would just sit there 
> becuase prefix was hard coded. I got around this by doing the above 
> mentioned. I was then able to get the device to start and let me do the 
> initial configuration of the device. After I add my ssh keys from launchpad 
> to the device, I do some initial configuration by creating some udev rules 
> for the device network adapters to get the correct names. I also do a snap 
> list to check that the kernel snap and core snap and gadget snap are all 
> good, which I get the error saying no snaps installed and I should install 
> hello-world. I’ve seen this in the past, but the system tends to work as it 
> should unless I install a snap, then the system fails catastrophically and I 
> have to reflash the system since it gets all sorts of confussed as to what 
> snaps are installed. I used to fix this by making sure my kernel snap was in 
> grade stable and confinement strict, which i did in my kernel snap, but it is 
> doing this again. I’m assuming its becuase I am using the edge channel when I 
> build my image. 
> Anyways, the main reason for this email, after I do a reboot to verify my 
> udev rule and everything works correctly, the system fails to boot and I get 
> dumped to an initramfs prompt. I managed to get a screen log of everything 
> happening and I noticed that it tried to mount the core_383.snap to /root, 
> and it failed becuase it couldn’t find the file. I looked where it was trying 
> to mount from and sure enough, there is no core_383.snap file in 
> tmpmnt_writable/system-data/var/lib/snapd/snaps but instead my kernel snap 
> and an empty folder named partial. 
> If I reinstall the device with the base image, it works again, but as soon as 
> I do a reboot, I’m stuck back where I’m at. Any ideas on how to fix this or 
> prevent this snap from being deleted after initial installation? Also, why is 
> the system saying no snaps installed when its an Ubuntu-Core system?
> 
> If you need any other details or information, please let me know. The vendor 
> really wants a working image since they have a customer that wants this badly.
> 
> Thanks,
> 
> Luke Williams - Technical Partner Manager, Network Switches/Ubuntu-Core
> email: luke.willi...@canonical.com <mailto:luke.willi...@canonical.com>
> http://www.canonical.com/ <http://www.canonical.com/> | http://www.ubuntu.com 
> <http://www.ubuntu.com/>
> 
> 
> 
> 

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Errors building custom ubuntu-core images

2016-10-14 Thread Luke Williams
Its working this morning. I am using the edge channel and everything is
working like it should now.

Thanks!

On Fri, Oct 14, 2016 at 5:08 AM, Oliver Grawert <o...@ubuntu.com> wrote:

> hi,
> On Fr, 2016-10-14 at 09:07 -0300, Sergio Schvezov wrote:
> >
> > El 14/10/16 a las 05:14, John Lenton escribió:
> > >
> > > On 14 October 2016 at 01:32, Luke Williams <luke.williams@canonical
> > > .com> wrote:
> > > >
> > > > I’m getting http 500 errors when I try anything other than the
> > > > stable
> > > > channel….
> > > those 500s come from the CDN; can you retry? (snapcraft should
> > > retry
> > > 500s on download; we'll get to that at some point...)
> >
> > I hope you meant snapd/ubuntu-image here :-)
> >
> > There might be work here for snapcraft involving pushing files
> > though,
> > but this is totally orthogonal to building images ;-)
> >
> you mean ubuntu-image will not eventually become a snapcraft plugin ?
>
> :)
>
> ciao
>     oli
> --
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/snapcraft
>
>


-- 
Thanks,


Luke Williams - Technical Partner Manager, Network Switches and Ubuntu-Core
luke.willi...@canonical.com
www.canonical.com || www.ubuntu.com
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Removing a key

2016-10-13 Thread Luke Williams
Hello,

That didn’t work, it just dumped the snapcraft usage 

Thanks,

Luke Williams - Technical Partner Manager, Network Switches/Ubuntu-Core
email: luke.willi...@canonical.com <mailto:luke.willi...@canonical.com>
http://www.canonical.com/ <http://www.canonical.com/> | http://www.ubuntu.com 
<http://www.ubuntu.com/>





> On Oct 13, 2016, at 2:45 PM, Manik Taneja <ma...@canonical.com> wrote:
> 
> 
> 
> On Thu, Oct 13, 2016 at 1:48 PM, Luke Williams <luke.willi...@canonical.com 
> <mailto:luke.willi...@canonical.com>> wrote:
> 
> Hello,
> 
> I was trying to build an Ubuntu-Core image and noticed that I don't have my 
> original snap key on my newly rebuilt system (hard drive failure on my build 
> machine) so I created a new default key, but can't upload it since I already 
> have a key named default.  I ended up creating a new key with a new name, but 
> I would like to remove the original key, but can't seem to find anything on 
> how to do this. I can see the keys with snapcraft list-keys but no way to 
> remove them. Any ideas?
> 
> try this-
> 
> snapcraft revoke-key 
> 
> /manik 

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft