Build own core snap


#1

Hey Guys,

I want to build my own core.snap with some modifications on a RPi3

First of all I have tried to build a clean core from

https://github.com/snapcore/core

I have follow the instructions and build it on a ubuntu core in classic mode.
Then I have build an image with --extra-snaps core.snap, after the build on boot it failures on two services:

Failed to Start LSB: AppArmor Initilization and
Faild to Start Automatically Repair incorrect Owner/Permission on core devices

After then it stucks on

Reached target cloud-init and Started update UTMP run level services

What do I wrong?
or what I have todo?

Greets


#2

any suggestions on this?


#3

or did I need to include this?

into the core.snap?


#4

@tokurz Looks like some of those options are unconventional. For example, are you trying to run an Ubuntu Core device, or a classic Ubuntu device? Why are you trying to load the core snap by hand?

@awe Who’s the best person to help here?


#5

Hey @niemeyer @awe
I want to build an ubuntu core device with own core snap for my own education to understand deeper the way of the core.

Greets Tony


#6

I’d recommend to actually not do it in the classic chroot on a core device but instead install qemu-user-static on your host, create a chroot using qemu-debootstrap and run the build in there …

the snapcore/core-build code is the source for packages in the snappy PPA that the core build uses, you do not need to touch it.


#7

What part of the core snap are you trying to modify?

If you just want to build a Ubuntu Core image manually, you can follow the process here: https://docs.ubuntu.com/core/en/guides/build-device/image-building and use the core snap from the store.

Also, when I’ve needed to test changing things in the core snap, I have built the core snap natively on an Ubuntu 16.04 machine. I tried using a docker container and an lxd container, but ran into issues I don’t remember related to executing mounts. Perhaps @ogra’s advice is better here, I wasn’t able to get that setup…


#8

Hey @ogra , I have now successfully build the core snap, but wenn I try to boot it stucks in AppArmor initilization and by Automatically repair user permission service and hangs on UTMP Boot Service.

Any Ideas?

Greets


#9

well, what did you change ?


#10

nothing I build it from scratch in an chroot, also an build on the classic snap on an raspi3 its the same error


#11

did you install livecd-rootfs from the PPA into the build env first ?


#12

yep I installed these, also snapcraft fetch this also, right?


#13

snapcraft fetches the build-packages from whatever is defined in the sources.list of the building host/environment, so it is essential that the build host or container has the right entries for the PPA.


#14

Hey, this package is already installed, I have double checked.
The problem might be on other side.


#15

I have now make some changes in the chroot system, i had forget to do “dist-upgrade”, but now when I run snapcraft, the error comes:

Unable to locate package ubuntu-core

apt sources:

deb http://ppa.launchpad.net/snappy-dev/image/ubuntu xenial main
deb http://ports.ubuntu.com/ubuntu-ports xenial-updates main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports xenial main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports xenial-updates main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports xenial-proposed main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports xenial-proposed main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports xenial-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports xenial-security main restricted universe multiverse

any ideas?


#16

http://ppa.launchpad.net/snappy-dev/image/ubuntu/pool/main/u/ubuntu-core-meta/

not really i fear :frowning:

if you did apt update ubuntu-core should be found …


#17

hey @ogra,

finally i getting working the build of the core snap.
Shame on me it was an typo issue in the Makefile line…

Thx for help :slight_smile: