Kernel snap :: snapcraft exited with code 2

snapcraft got exited with error code 2 during kernel snap preparation.

  CC      fs/drop_caches.o
  CC      fs/fhandle.o
  CC      fs/dcookies.o
  AR      fs/built-in.a
Failed to run 'make -j4 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- PATH=/home/honeywell/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/aarch64-linux-gnu/bin Image.gz modules freescale/imx8mm-var-som-symphony.dtb' for 'kernel': Exited with code 2.
Verify that the part is using the correct parameters and try again.

How can I cross check the parameters value as mentioned in the message?
Is there any option to get detailed messages ?

Kernel output related parts are mentioned below


kconfigs:
- CONFIG_SECURITY_APPARMOR=y
- CONFIG_AUDIT=y
- CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
- CONFIG_DEFAULT_SECURITY_APPARMOR=y
kernel-image-target: Image.gz
kernel-device-trees:
- freescale/imx8mm-var-som-symphony
kernel-initrd-modules:
- squashfs
build-packages:
- cpio
- libssl-dev

Note: Able to compile the kernel using above mentioned same make command as standalone compilation.(Separate compilation without snapcraft)

well, have you looked at the actual error in your build log ? thats just the final message but not the error itself … scrolling back should reveal a bit more info…

Thank you, there were few errors.

1 Like

I got another errors related to firmware_install.
make -j4 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- PATH=/home/vm418177/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/aarch64-linux-gnu/bin CONFIG_PREFIX=/home/honeywell/uc/kernel_snap/uc_kernel_builder/parts/kernel/install modules_install INSTALL_MOD_PATH=/home/honeywell/uc/kernel_snap/uc_kernel_builder/parts/kernel/install firmware_install INSTALL_FW_PATH=/home/honeywell/uc/kernel_snap/uc_kernel_builder/parts/kernel/install/lib/firmware
make: *** No rule to make target ‘firmware_install’. Stop.
make: *** Waiting for unfinished jobs…
INSTALL arch/arm64/lib/xor-neon.ko
INSTALL crypto/blowfish_common.ko

Do I need to specify firmware part in the yaml? I am not clear.Is there any reference for same.

ah, you should simply add:

    kernel-with-firmware: false

to the part that builds the kernel … that will make it not try to build the in-kernel firmware blobs

I am able to generate kernel snap. Since I am not sure about kernel-initrd-modules, I removed that part from yaml as well as kernel-with-firmware: false

1 Like