Dasharo / dasharo-issues

The Dasharo issue tracker
https://dasharo.com/
24 stars 0 forks source link

CONFIG_EFI_VARS warning during build #729

Open DaniilKl opened 6 months ago

DaniilKl commented 6 months ago

Device

-

Dasharo version

-

Affected component(s) or functionality

No response

Brief summary

Warning during build process

How reproducible

No response

How to reproduce

Build on commit 78d0228c3d846ba41839dc77b0e19bc9e74e3256 using command:

kas-container build meta-dts/kas-uefi-sb.yml

Expected behavior

No warnings.

Actual behavior

Warning during execution of the task do_kernel_configcheck:

(...)
WARNING: linux-yocto-5.15.36+gitAUTOINC+fcf48627ea_ebfb1822e9-r0 do_kernel_configcheck: [kernel config]: specified values did not make it into the kernel's final configuration:

    [NOTE]: 'CONFIG_EFI_VARS' last val (y) and .config val (m) do not match
    [INFO]: CONFIG_EFI_VARS : m ## .config: 1609 :configs/v5.15/standard/cfg/efi-ext.cfg (m) configs/v5.15/standard/./efivars.cfg (y) 
    [INFO]: raw config text:

        config EFI_VARS
            tristate "EFI Variable Support via sysfs"
            default n
            depends on EFI && (X86 || IA64) && EFI
            help
              If you say Y here, you are able to get EFI (Extensible Firmware
              Interface) variable information via sysfs.  You may read,
              write, create, and destroy EFI variables through this interface.
              Note that this driver is only retained for compatibility with
              legacy users: new users should use the efivarfs filesystem
              instead.

        Config 'EFI_VARS' has the following Direct dependencies (EFI_VARS=y):
                EFI(=y) && X86(=y) || IA64(undefined/n) (=y)
        Parent dependencies are:
             X86 [y] IA64 [IA64] EFI [y]
(...)

Screenshots

No response

Additional context

Though I faced the warning on commit 78d0228c3d846ba41839dc77b0e19bc9e74e3256, I do not think this commit is a root of the problem.

Solutions you've tried

No response

DaniilKl commented 5 months ago

It seems like there is some conflicts between Kernel configs, cos CONFIG_EFI_VARS is set to y in meta-dts/meta-dts-distro/recipes-kernel/kernel/linux-yocto/efivars.cfg but some configuration wants it to be m :monocle_face:.

DaniilKl commented 5 months ago

And here the config is: ./build/tmp/work/genericx86_64-dts-linux/linux-yocto/5.15.36+gitAUTOINC+fcf48627ea_ebfb1822e9-r0/kernel-meta/cfg/efi-ext.cfg.

The question is why the conflict even appears? Configs in meta-dts should overwrite all the configs in other layers, shouldn't it? Layers priority issue?

DaniilKl commented 5 months ago

Yep, and after build on the commit we get EFI_VARS set to m:

  │ Symbol: EFI_VARS [=m]                                                                                                         │  
  │ Type  : tristate                                                                                                              │  
  │ Defined at drivers/firmware/efi/Kconfig:5                                                                                     │  
  │   Prompt: EFI Variable Support via sysfs                                                                                      │  
  │   Depends on: EFI [=y] && (X86 [=y] || IA64)                                                                                  │  
  │   Location:                                                                                                                   │  
  │     -> Device Drivers                                                                                                         │  
  │       -> Firmware Drivers                                                                                                     │  
  │ (1)     -> EFI (Extensible Firmware Interface) Support

So, recipe linux-yocto overwrites configuration set in meta-dts.

DaniilKl commented 5 months ago

And yes, it seems like a layer priority issue:

layer                 path                                      priority
==========================================================================
meta-dts-distro       /repo/meta-dts-distro                     1
meta-networking       /work/meta-openembedded/meta-networking   5
meta-oe               /work/meta-openembedded/meta-oe           5
meta-perl             /work/meta-openembedded/meta-perl         5
meta-python           /work/meta-openembedded/meta-python       5
meta                  /work/meta-secure-core/meta               10
meta-efi-secure-boot  /work/meta-secure-core/meta-efi-secure-boot  10
meta-signing-key      /work/meta-secure-core/meta-signing-key   10
meta-tpm2             /work/meta-secure-core/meta-tpm2          10
meta-tpm              /work/meta-security/meta-tpm              10
meta                  /work/poky/meta                           5
meta-poky             /work/poky/meta-poky                      5
meta-yocto-bsp        /work/poky/meta-yocto-bsp                 5
DaniilKl commented 5 months ago

Oh oh, seems like setting priority of the leayer meta-dts-distro to 11 has broken smth.:

(...)
WARNING: hidapi-1.4.1.AUTOINC+f39c5e17a5-r0 do_fetch: Failed to fetch URL gitsm://git@github.com/ruabmbua/hidapi-rs.git;protocol=ssh;nobranch=1, attempting MIRRORS if available
ERROR: hidapi-1.4.1.AUTOINC+f39c5e17a5-r0 do_fetch: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export GIT_PROXY_COMMAND="oe-git-proxy"; export NO_PROXY="*"; export PATH="/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/build/tmp/work/core2-64-dts-linux/hidapi/1.4.1.AUTOINC+f39c5e17a5-r0/recipe-sysroot-native/usr/bin/python3-native:/work/poky/scripts:/build/tmp/work/core2-64-dts-linux/hidapi/1.4.1.AUTOINC+f39c5e17a5-r0/recipe-sysroot-native/usr/bin/x86_64-dts-linux:/build/tmp/work/core2-64-dts-linux/hidapi/1.4.1.AUTOINC+f39c5e17a5-r0/recipe-sysroot/usr/bin/crossscripts:/build/tmp/work/core2-64-dts-linux/hidapi/1.4.1.AUTOINC+f39c5e17a5-r0/recipe-sysroot-native/usr/sbin:/build/tmp/work/core2-64-dts-linux/hidapi/1.4.1.AUTOINC+f39c5e17a5-r0/recipe-sysroot-native/usr/bin:/build/tmp/work/core2-64-dts-linux/hidapi/1.4.1.AUTOINC+f39c5e17a5-r0/recipe-sysroot-native/sbin:/build/tmp/work/core2-64-dts-linux/hidapi/1.4.1.AUTOINC+f39c5e17a5-r0/recipe-sysroot-native/bin:/work/poky/bitbake/bin:/build/tmp/hosttools"; export HOME="/tmp/tmppa4nj65x"; LANG=C git -c core.fsyncobjectfiles=0 -c gc.autoDetach=false -c core.pager=cat clone --bare --mirror ssh://git@github.com/ruabmbua/hidapi-rs.git /build/downloads/git2/github.com.ruabmbua.hidapi-rs.git --progress failed with exit code 128, no output
ERROR: hidapi-1.4.1.AUTOINC+f39c5e17a5-r0 do_fetch: Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.', 'gitsm://git@github.com/ruabmbua/hidapi-rs.git;protocol=ssh;nobranch=1')
ERROR: Logfile of failure stored in: /build/tmp/work/core2-64-dts-linux/hidapi/1.4.1.AUTOINC+f39c5e17a5-r0/temp/log.do_fetch.451
ERROR: Task (/repo/meta-dts-distro/recipes-support/hidapi/hidapi_1.4.1.bb:do_fetch) failed with exit code '1'
(...)
DaniilKl commented 5 months ago

It was a typo in URL, fixed with:

diff --git a/meta-dts-distro/recipes-support/hidapi/hidapi_1.4.1.bb b/meta-dts-distro/recipes-support/hidapi/hidapi_1.4.1.bb
index db9a861ade67..e54b96199f2c 100644
--- a/meta-dts-distro/recipes-support/hidapi/hidapi_1.4.1.bb
+++ b/meta-dts-distro/recipes-support/hidapi/hidapi_1.4.1.bb
@@ -1,6 +1,6 @@
 inherit cargo

-SRC_URI += "gitsm://git@github.com/ruabmbua/hidapi-rs.git;protocol=ssh;nobranch=1"
+SRC_URI += "git://git@github.com/ruabmbua/hidapi-rs.git;protocol=ssh;nobranch=1"
 SRCREV = "f39c5e17a50ada9f8b631dbbc2c4d262553e5602"
 S = "${WORKDIR}/git"
 CARGO_SRC_DIR = ""
DaniilKl commented 5 months ago

Here are another issues:

WARNING: hidapi-1.4.1.AUTOINC+f39c5e17a5-r0 do_fetch: Failed to fetch URL git://git@github.com/ruabmbua/hidapi-rs.git;branch=main;protocol=ssh, attempting MIRRORS if available
ERROR: hidapi-1.4.1.AUTOINC+f39c5e17a5-r0 do_compile: ExecutionError('/build/tmp/work/core2-64-dts-linux/hidapi/1.4.1.AUTOINC+f39c5e17a5-r0/temp/run.do_compile.1445', 101, None, None)
(...)
\"libusb-1.0\"`\nThe pkg-config command could not be found.\n\nMost likely, you need to install a pkg-config package for your OS.\nTry `apt install pkg-config`, or `yum install pkg-config`,\nor `pkg install pkg-config` depending on your distribution.\n\nIf you've already installed it, ensure the pkg-config command is one of the\ndirectories in the PATH environment variable.\n\nIf you did not expect this build to link to a pre-installed system library,\nthen check documentation of the hidapi crate for an option to\nbuild the library from source, or disable features or dependencies\nthat require pkg-config."', build.rs:69:60
(...)
ERROR: Task (/repo/meta-dts-distro/recipes-support/hidapi/hidapi_1.4.1.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 742 tasks of which 733 didn't need to be rerun and 1 failed.
(...)
DaniilKl commented 5 months ago

Setting mets-dts-distro layer priority to 11 has not solved the problem but has brought up additional issues which should be discussed in another issue. Curious situation :monocle_face:.

DaniilKl commented 5 months ago

@TomaszAIR, referring to discussion we had: I do not see any reasons this issue is caused by EFI_VARS dependencies, in both cases (EFI_VARS set to m or y) the dependencies (which are EFI and X86) are set to y.

DaniilKl commented 5 months ago

I am out of ideas how to set EFI_VARS to y. @TomaszAIR, is there any reason to set it to y (you set it in comit f8d2c707ff16fe236459670e80c946972065d207), why not to use configuration from meta-secure-core, where it is set to m?

TomaszAIR commented 5 months ago

@DaniilKl In case of kas-uefi-sb build the efi-ext.cfg is added here https://github.com/jiazhang0/meta-secure-core/blob/fa438247c3e61d7f746687d85ef3b0dd66dc6b3f/meta-efi-secure-boot/recipes-kernel/linux/linux-yocto-efi-secure-boot.inc#L3. For 5.15 it sets EFI_VARS to m https://git.yoctoproject.org/yocto-kernel-cache/tree/cfg/efi-ext.cfg?h=yocto-5.15 (btw for 6.6 it is no longer a case https://git.yoctoproject.org/yocto-kernel-cache/tree/cfg/efi-ext.cfg?h=yocto-6.6; i think EFI_VARS config is being deprecated)

We need that config to be compiled in (in some FUM cases we are using access to efivars provided by this config) so I think we should remove efi_secure_boot_sccs from KERNEL_FEATURES in case of uefi-sb enabled builds. btw we should also switch to https://github.com/Wind-River/meta-secure-core as jiazhang0 repo is read-only now.