Skip to content

configs/sdm660_defconfig: support efi zboot #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: qcom-sdm660-6.15.y
Choose a base branch
from

Conversation

sajattack
Copy link

Add some config options to generate a vmlinuz.efi for systemd-boot.

Signed-off-by: Paul Sajna <hello@paulsajna.com>
@sajattack
Copy link
Author

sajattack commented Jul 28, 2025

CI failure: missing dependency on runner

/bin/sh: 1: hexdump: not found
truncate: Invalid number: 'arch/arm64/boot/vmlinux.bin'
make[3]: *** [../drivers/firmware/efi/libstub/Makefile.zboot:13: arch/arm64/boot/vmlinux.bin] Error 1
make[3]: *** Deleting file 'arch/arm64/boot/vmlinux.bin'
make[2]: *** [../arch/arm64/Makefile:187: vmlinuz.efi] Error 2
make[2]: *** Waiting for unfinished jobs...

@minlexx
Copy link
Member

minlexx commented Jul 28, 2025

CI failure: missing dependency on runner

/bin/sh: 1: hexdump: not found
truncate: Invalid number: 'arch/arm64/boot/vmlinux.bin'
make[3]: *** [../drivers/firmware/efi/libstub/Makefile.zboot:13: arch/arm64/boot/vmlinux.bin] Error 1
make[3]: *** Deleting file 'arch/arm64/boot/vmlinux.bin'
make[2]: *** [../arch/arm64/Makefile:187: vmlinuz.efi] Error 2
make[2]: *** Waiting for unfinished jobs...

This now turned into

Run make O=.output LOCALVERSION= -j$(nproc)
make[1]: Entering directory '/home/runner/_work/linux/linux/.output'
  SYNC    include/config/auto.conf.cmd
  GEN     Makefile
  GEN     Makefile
  CALL    ../scripts/checksyscalls.sh
  PAD     arch/arm64/boot/vmlinux.bin
  AS      arch/arm64/boot/zboot-header.o
  ZSTD22  arch/arm64/boot/vmlinuz
  OBJCOPY arch/arm64/boot/vmlinuz.o
  LD      arch/arm64/boot/vmlinuz.efi.elf
  OBJCOPY arch/arm64/boot/vmlinuz.efi
make[1]: Leaving directory '/home/runner/_work/linux/linux/.output'

Which is like the only one thing I'm worried about here, that there is no more vmlinuz and no more Image.gz, only vmlinuz.efi, which "breaks" building boot.img in my scripts... I've tried it and left this experiment for later

@minlexx
Copy link
Member

minlexx commented Jul 28, 2025

The commit that fixed absence of hexdump btw...

@sajattack
Copy link
Author

Which is like the only one thing I'm worried about here, that there is no more vmlinuz and no more Image.gz, only vmlinuz.efi, which "breaks" building boot.img in my scripts... I've tried it and left this experiment for later

maybe if I enable gzip instead of zstd it would build both? I'll try fiddling with it.

@minlexx
Copy link
Member

minlexx commented Jul 28, 2025

No, I don't think it will help, the question is can e.g grub load regular linux kernel without turning it into EFI application?

@minlexx
Copy link
Member

minlexx commented Jul 29, 2025

The https://cateee.net/lkddb/web-lkddb/EFI.html says

found in arch/arm64/Kconfig

The configuration item CONFIG_EFI:

  • prompt: UEFI runtime support
  • type: bool
  • depends on: ( CONFIG_OF && !CONFIG_CPU_BIG_ENDIAN ) && ( CONFIG_KERNEL_MODE_NEON )
  • defined in arch/arm64/Kconfig
  • found in Linux kernels: 3.16–3.19, 4.0–4.20, 5.0–5.19, 6.0–6.16

Help text:
This option provides support for runtime services provided by UEFI firmware
(such as non-volatile variables, realtime clock, and platform reset).
A UEFI stub is also provided to allow the kernel to be booted as an EFI application.
This is only useful on systems that have UEFI firmware.

I hope this will not make booting with U-Boot mandatory, not all our devices have U-Boot port

CONFIG_EFI_STUB=y
CONFIG_EFI_GENERIC_STUB=y
CONFIG_EFI_ZBOOT=y
CONFIG_EFI_ARMSTUB_DTB_LOADER=y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only some of these are user-selectable (have prompt and descriptive help text), others are probably selected automatically and therefore should not be in defconfig. That's why I think you did not generate this defconfig properly, it should be done using:

# (in build dir, which is usually a subdirectory in linux source)
make savedefconfig # generates "defconfig" file
cp defconfig ../arch/arm64/configs/sdm660_defconfig

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip, I'll come back and fix this in a bit. Feel free to push this branch if you want to fix it, but if not I'll finish up another time.

@sajattack
Copy link
Author

Which is like the only one thing I'm worried about here, that there is no more vmlinuz and no more Image.gz, only vmlinuz.efi, which "breaks" building boot.img in my scripts... I've tried it and left this experiment for later

SDM845 kernel manages to build all 3. I'll have to figure out where I went wrong.

https://gitlab.postmarketos.org/postmarketOS/pmaports/-/blob/master/device/community/linux-postmarketos-qcom-sdm845/APKBUILD?ref_type=heads#L42-54

@minlexx
Copy link
Member

minlexx commented Jul 30, 2025

sdm845 kernel package is manually copying and renaming files, I do not believe that's the intended way of doing things. Maybe that's because of how differently files are named in case of EFI enabled, but still..

We just do make install, we do have postmarketos-installkernel for a reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants