This is a cache of https://discuss.96boards.org/t/generating-kernel-snap-on-dragonboard-410c/1118. It is a snapshot of the page at 2024-10-31T10:00:59.761+0000.
Generating kernel snap on dragonboard 410c - DragonBoard410c - 96Boards Forum

Generating kernel snap on dragonboard 410c

I am trying to generate kernel snap on dragonboard410c.
After compiling source, it gives the error related to squashfs as listed below:

modprobe: FATAL: Module squashfs not found in directory /home/megha/Linaro_16.06/parts/kernel/install/lib/modules/4.4.9-linaro-lt-qcom
Command ‘[’/bin/sh’, ‘/tmp/tmpzc0wvuqo’, ‘modprobe’, ‘-n’, ‘–show-depends’, ‘-d’, ‘/home/megha/Linaro_16.06/parts/kernel/install’, ‘-S’, ‘4.4.9-linaro-lt-qcom’, ‘squashfs’]’ returned non-zero exit status 1

When I compile the source with manually make command then it generates squashfs.ko
But from snapcraft command it gives this error.

I suspect that squashfs is not enabled in the kernel config and that this is required by the snappy build process. Did you ask the same question on the ubuntu forums, ubuntu Core for DB410c is a third-party build meaning they might have better insight into how this code holds together.

I already enabled related the squashfs in kernel config as listed below:

kernel/arch/arm64/configs/defconfig
CONFIG_SQUASHFS=y

kernel/arch/arm64/configd/distro.config
CONFIG_SQUASHFS=m
CONFIG_SQUASHFS_FILE_CACHE=y

CONFIG_SQUASHFS_FILE_DIRECT is not set

CONFIG_SQUASHFS_DECOMP_SINGLE=y

CONFIG_SQUASHFS_DECOMP_MULTI is not set

CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set

CONFIG_SQUASHFS_XATTR=y
CONFIG_SQUASHFS_ZLIB=y

CONFIG_SQUASHFS_LZ4 is not set

CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y

CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set

CONFIG_SQUASHFS_EMBEDDED is not set

CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3

kernel/kernel/configs/distro.config
CONFIG_SQUASHFS=m
CONFIG_SQUASHFS_FILE_CACHE=y

CONFIG_SQUASHFS_FILE_DIRECT is not set

CONFIG_SQUASHFS_DECOMP_SINGLE=y

CONFIG_SQUASHFS_DECOMP_MULTI is not set

CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set

CONFIG_SQUASHFS_XATTR=y
CONFIG_SQUASHFS_ZLIB=y

CONFIG_SQUASHFS_LZ4 is not set

CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y

CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set

CONFIG_SQUASHFS_EMBEDDED is not set

CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3

Does this result in squashfs being built into the kernel (CONFIG_SQUASHFS=y) or as a module (CONFIG_SQUASHFS=m)?

From the build logs it looks to me like squashfs needs to be built as a module.

yup correct danielt, squashfs as a module. Using manually make -j4 command it generates squashfs.ko
But from “snapcraft --target-arch arm64 snap” command it gives the error of Module squashfs not found.

Please share the output of grep FS= parts/kernel/build/.config .

megha@AHMCPU2013:~/Linaro_16.06$ grep FS = parts/kernel/build/.config
grep: =: No such file or directory
parts/kernel/build/.config:# CONFIG_CFS_BANDWIDTH is not set
parts/kernel/build/.config:# CONFIG_SYSFS_DEPRECATED is not set
parts/kernel/build/.config:CONFIG_INITRAMFS_SOURCE=""
parts/kernel/build/.config:CONFIG_SYSFS_SYSCALL=y
parts/kernel/build/.config:CONFIG_SYS_SUPPORTS_HUGETLBFS=y
parts/kernel/build/.config:# CONFIG_CMA_DEBUGFS is not set
parts/kernel/build/.config:CONFIG_RFS_ACCEL=y
parts/kernel/build/.config:CONFIG_BT_DEBUGFS=y
parts/kernel/build/.config:# CONFIG_CFG80211_DEBUGFS is not set
parts/kernel/build/.config:# CONFIG_MAC80211_DEBUGFS is not set
parts/kernel/build/.config:CONFIG_DEVTMPFS=y
parts/kernel/build/.config:CONFIG_DEVTMPFS_MOUNT=y
parts/kernel/build/.config:# CONFIG_USB_SWITCH_FSA9480 is not set
parts/kernel/build/.config:# CONFIG_SCSI_PROC_FS is not set
parts/kernel/build/.config:# CONFIG_FSL_PQ_MDIO is not set
parts/kernel/build/.config:# CONFIG_FSL_XGMAC_MDIO is not set
parts/kernel/build/.config:CONFIG_WCN36XX_DEBUGFS=y
parts/kernel/build/.config:CONFIG_SERIAL_8250_FSL=y
parts/kernel/build/.config:# CONFIG_SERIAL_FSL_LPUART is not set
parts/kernel/build/.config:# CONFIG_SPI_FSL_SPI is not set
parts/kernel/build/.config:# CONFIG_SPI_FSL_DSPI is not set
parts/kernel/build/.config:CONFIG_GPIO_SYSFS=y
parts/kernel/build/.config:CONFIG_SND_PROC_FS=y
parts/kernel/build/.config:CONFIG_SND_VERBOSE_PROCFS=y
parts/kernel/build/.config:# CONFIG_SND_SOC_FSL_ASRC is not set
parts/kernel/build/.config:# CONFIG_SND_SOC_FSL_SAI is not set
parts/kernel/build/.config:# CONFIG_SND_SOC_FSL_SSI is not set
parts/kernel/build/.config:# CONFIG_SND_SOC_FSL_SPDIF is not set
parts/kernel/build/.config:# CONFIG_SND_SOC_FSL_ESAI is not set
parts/kernel/build/.config:# CONFIG_USB_GADGET_DEBUG_FS is not set
parts/kernel/build/.config:CONFIG_USB_CONFIGFS=m
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_SERIAL is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_ACM is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_OBEX is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_NCM is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_ECM is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_ECM_SUBSET is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_RNDIS is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_EEM is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_MASS_STORAGE is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_F_LB_SS is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_F_FS is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_F_UAC1 is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_F_UAC2 is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_F_MIDI is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_F_HID is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_F_UVC is not set
parts/kernel/build/.config:# CONFIG_USB_CONFIGFS_F_PRINTER is not set
parts/kernel/build/.config:# CONFIG_USB_GADGETFS is not set
parts/kernel/build/.config:# CONFIG_USB_FUNCTIONFS is not set
parts/kernel/build/.config:CONFIG_RTC_INTF_SYSFS=y
parts/kernel/build/.config:# CONFIG_FSL_EDMA is not set
parts/kernel/build/.config:# CONFIG_IIO_SYSFS_TRIGGER is not set
parts/kernel/build/.config:# CONFIG_PHY_QCOM_UFS is not set
parts/kernel/build/.config:# CONFIG_DMI_SYSFS is not set
parts/kernel/build/.config:CONFIG_EXT2_FS=y
parts/kernel/build/.config:CONFIG_EXT2_FS_XATTR=y
parts/kernel/build/.config:CONFIG_EXT2_FS_POSIX_ACL=y
parts/kernel/build/.config:CONFIG_EXT2_FS_SECURITY=y
parts/kernel/build/.config:CONFIG_EXT3_FS=y
parts/kernel/build/.config:CONFIG_EXT3_FS_POSIX_ACL=y
parts/kernel/build/.config:CONFIG_EXT3_FS_SECURITY=y
parts/kernel/build/.config:CONFIG_EXT4_FS=y
parts/kernel/build/.config:CONFIG_EXT4_FS_POSIX_ACL=y
parts/kernel/build/.config:CONFIG_EXT4_FS_SECURITY=y
parts/kernel/build/.config:CONFIG_FS_MBCACHE=y
parts/kernel/build/.config:# CONFIG_REISERFS_FS is not set
parts/kernel/build/.config:# CONFIG_JFS_FS is not set
parts/kernel/build/.config:# CONFIG_XFS_FS is not set
parts/kernel/build/.config:# CONFIG_GFS2_FS is not set
parts/kernel/build/.config:# CONFIG_OCFS2_FS is not set
parts/kernel/build/.config:# CONFIG_BTRFS_FS is not set
parts/kernel/build/.config:# CONFIG_NILFS2_FS is not set
parts/kernel/build/.config:# CONFIG_F2FS_FS is not set
parts/kernel/build/.config:# CONFIG_FS_DAX is not set
parts/kernel/build/.config:CONFIG_FS_POSIX_ACL=y
parts/kernel/build/.config:CONFIG_EXPORTFS=y
parts/kernel/build/.config:CONFIG_FSNOTIFY=y
parts/kernel/build/.config:CONFIG_AUTOFS4_FS=y
parts/kernel/build/.config:CONFIG_FUSE_FS=y
parts/kernel/build/.config:# CONFIG_OVERLAY_FS is not set
parts/kernel/build/.config:# CONFIG_FSCACHE is not set
parts/kernel/build/.config:# CONFIG_ISO9660_FS is not set
parts/kernel/build/.config:# CONFIG_UDF_FS is not set
parts/kernel/build/.config:CONFIG_FAT_FS=y
parts/kernel/build/.config:# CONFIG_MSDOS_FS is not set
parts/kernel/build/.config:CONFIG_VFAT_FS=y
parts/kernel/build/.config:# CONFIG_NTFS_FS is not set
parts/kernel/build/.config:CONFIG_PROC_FS=y
parts/kernel/build/.config:CONFIG_KERNFS=y
parts/kernel/build/.config:CONFIG_SYSFS=y
parts/kernel/build/.config:CONFIG_TMPFS=y
parts/kernel/build/.config:CONFIG_TMPFS_POSIX_ACL=y
parts/kernel/build/.config:CONFIG_TMPFS_XATTR=y
parts/kernel/build/.config:CONFIG_HUGETLBFS=y
parts/kernel/build/.config:CONFIG_CONFIGFS_FS=m
parts/kernel/build/.config:CONFIG_EFIVAR_FS=y
parts/kernel/build/.config:CONFIG_NFS_FS=y
parts/kernel/build/.config:CONFIG_NFS_V2=y
parts/kernel/build/.config:CONFIG_NFS_V3=y
parts/kernel/build/.config:# CONFIG_NFS_V3_ACL is not set
parts/kernel/build/.config:CONFIG_NFS_V4=y
parts/kernel/build/.config:# CONFIG_NFS_SWAP is not set
parts/kernel/build/.config:# CONFIG_NFS_V4_1 is not set
parts/kernel/build/.config:CONFIG_ROOT_NFS=y
parts/kernel/build/.config:# CONFIG_NFS_USE_LEGACY_DNS is not set
parts/kernel/build/.config:CONFIG_NFS_USE_KERNEL_DNS=y
parts/kernel/build/.config:CONFIG_NFSD=m
parts/kernel/build/.config:CONFIG_NFSD_V2_ACL=y
parts/kernel/build/.config:CONFIG_NFSD_V3=y
parts/kernel/build/.config:CONFIG_NFSD_V3_ACL=y
parts/kernel/build/.config:# CONFIG_NFSD_V4 is not set
parts/kernel/build/.config:CONFIG_NFS_ACL_SUPPORT=m
parts/kernel/build/.config:CONFIG_NFS_COMMON=y
parts/kernel/build/.config:# CONFIG_CEPH_FS is not set
parts/kernel/build/.config:# CONFIG_CIFS is not set
parts/kernel/build/.config:# CONFIG_NCP_FS is not set
parts/kernel/build/.config:# CONFIG_CODA_FS is not set
parts/kernel/build/.config:# CONFIG_AFS_FS is not set
parts/kernel/build/.config:CONFIG_9P_FS=y
parts/kernel/build/.config:# CONFIG_9P_FS_POSIX_ACL is not set
parts/kernel/build/.config:# CONFIG_9P_FS_SECURITY is not set
parts/kernel/build/.config:CONFIG_DEBUG_FS=y
parts/kernel/build/.config:# CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set
parts/kernel/build/.config:# CONFIG_SECURITYFS is not set

This shows that the kernel is not being built with CONFIG_SQUASHFS=m (in fact it is not being built with CONFIG_SQUASHFS=y either, there is no squashfs at all).

I’ve no idea which kernel you are trying to build but many do not enable CONFIG_MISC_FILESYTEMS making it impossible for CONFIG_SQUASHFS to be set. Try enabling CONFIG_MISC_FILESYSTEMS in the snapcraft.yaml .

Oh Thanks danielt. Now kernel snap is ready. But after flashing finale image on board, at booting stage it stuck at one point. Here I shown you a logs:

[ 19.369804] initrd: checking filesystem for writable partition
[ 19.379747] EXT4-fs (mmcblk1p9): couldn’t mount as ext3 due to feature incompatibilities
[ 19.400375] EXT4-fs (mmcblk1p9): mounted filesystem with ordered data mode. Opts: errors=remount-ro
[ 19.461187] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 19.482835] EXT4-fs (mmcblk1p9): couldn’t mount as ext3 due to feature incompatibilities
[ 19.503724] EXT4-fs (mmcblk1p9): mounted filesystem with ordered data mode. Opts: (null)
[ 19.541924] squashfs: SQUASHFS error: Filesystem uses “xz” compression. This is not supported
[ 19.629474] squashfs: SQUASHFS error: Filesystem uses “xz” compression. This is not supported
[ 19.744732] initrd: mounting /run
[ 46.856508] random: nonblocking pool is initialized

Hi Megha

The option you’re looking for is:

config SQUASHFS_XZ
        bool "Include support for XZ compressed file systems"
        depends on SQUASHFS
        select XZ_DEC
        help
          Saying Y here includes support for reading Squashfs file systems
          compressed with XZ compression.  XZ gives better compression than
          the default zlib compression, at the expense of greater CPU and
          memory overhead.

          XZ is not the standard compression used in Squashfs and so most
          file systems will be readable without selecting this option.

          If unsure, say N.

Please make sure this option is enabled in your .config .

Daniel.

Yup Daniel, exactly that is wriiten in kernel/fs/squashfs/Kconfig. In .config “CONFIG_SQUASHFS_XZ=y” is written.

Can you be explicit which .config you are looking at?

I think you are building the kernel snap from a dirty kernel tree. This means that the .config in the root directory is not the one that is actually being built by snapcraft.

Snapcraft built parts directory. And I am referring to /parts/kernel/build/.config for your suggested changes.

Curious.

However, if we go back to the code the only way (absent memory corruption) for the kernel to say “Filesystem uses “xz” compression. This is not supported” is when CONFIG_SQUASHFS_XZ is not set.

See the definitions of squashfs_xz_comp_ops in decompressor.c and xz_wrapper.c to confirm this for yourself (perhaps even add an #error just above squashfs_xz_comp_ops in both decompressor.c and xz_wrapper.c). It looks to me like you will have to experiment a bit with these to see how the .config and the code can contradict each other like this.

That issue has been resolved danielt. Now the board is boot and reach up to snappy store registration. I uploaded the same key generated onto SSO Acoount ubuntu. Still I am not able to setup profile. It shows the following error:
Creating user failed:
error: while creating user: cannot communicate with server: Post
http://localhost/v2/create-user: EOF

Great to hear you sorted out the build. What changes were needed?

Regarding the ubuntu SSO, IIRC you had this working with the official kernel binary so I suspect there’s further kernel configuration missing (maybe the wireless driver?). Does the official kernel build allow you to extract /proc/config.gz to allow you to compare configuration?

Regarding changes for build, I enabled CONFIG_SQUASHFS_XZ in snapcraft.yaml
I am trying to connect board via Ethernet. And I am not able to reach in the system without emial id verification. In the official kernel build directory, config.gz is not there.

Hi danielt,

The current scenario is board is booted, generating IP address and reach up to snappy store registration. I am able to ping on that generated IP address. But it is not accepting the email address which I already had on ubuntu SSO account (key updated on Account).

It shows the following error:

Enter an email address from your account in the store.

             Email address:    ***********@gmail.com                

    If you do not have an account, visit https://login.ubuntu.com  
    to create one.                                                 

                          Creating user failed:                         
    error: while creating user: cannot communicate with server: Post    
                  http://localhost/v2/create-user: EOF

Strange.

Can you force the kernel snap to run alongside a userspace that you have already configured correctly using the stock kernel? Basically it would be helpful to be able to login and poke about to figure out what is wrong.

Given the problems you have had so far it seems likely that the new kernel is misconfigured although without a config file from the stock kernel its hard to compare anything. I’m afraid I know (almost) zero about ubuntu (none of my machines have it installed) so I can’t really speculate what might be missing.

Hi,
how to get rid of this error…im facing the same issue…

Thanks