Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

coreos-modules: add GPIO support#1236

Merged
krnowak merged 2 commits intoflatcar-archive:mainfrom
raballew:main
Sep 2, 2021
Merged

coreos-modules: add GPIO support#1236
krnowak merged 2 commits intoflatcar-archive:mainfrom
raballew:main

Conversation

@raballew
Copy link
Copy Markdown
Contributor

Add GPIO Support

As described in flatcar/Flatcar#331 this PR enabled CONFIG_GPIO_SYSFS=y so that /sys/class/gpio/... is present, and /dev/gpiomem is present

How to use

Run the following between build_packages and build_image

emerge-arm64-usr sys-kernel/coreos-kernel
emerge-arm64-usr sys-kernel/coreos-modules

Testing done

./image_to_vm.sh --from=../build/images/arm64-usr/latest --board=arm64-usr --format qemu
../build/images/arm64-usr/latest/flatcar_production_qemu.sh
ssh core@localhost -p 2222
ls -lisa /dev/gpiomem
ls -lisa /sys/class/gpio/

CONFIG_GPIO_SYSFS=y so that /sys/class/gpio/... is present, and /dev/gpiomem is present
@krnowak
Copy link
Copy Markdown
Contributor

krnowak commented Sep 1, 2021

I have started a test build for it.

@krnowak
Copy link
Copy Markdown
Contributor

krnowak commented Sep 1, 2021

CI failed when building kernel for amd64 with the following message:

 * Building using config /build/amd64-usr/var/tmp/portage/sys-kernel/coreos-modules-5.10.61/files/amd64_defconfig-5.10 and /build/amd64-usr/var/tmp/portage/sys-kernel/coreos-modules-5.10.61/files/commonconfig-5.10
 * ERROR: sys-kernel/coreos-modules-5.10.61::coreos failed (configure phase):
 *   Requested options not enabled in build:
 *     CONFIG_GPIO_SYSFS
 * 
 * Call stack:
 *     ebuild.sh, line  125:  Called src_configure
 *   environment, line 2050:  Called coreos-kernel_src_configure
 *   environment, line  636:  Called die
 * The specific snippet of code:
 *           die "Requested options not enabled in build:
 * ${missing}";

The error comes from eclass/coreos-kernel.eclass. I'm not sure what happened exactly as logs are gone by now, but there seem to be some difference between amd64 and arm64, because arm64 built just fine. Maybe there is some config in arm64_defconfig-5.10 that also needs to be moved to commonconfig-5.10 to satisfy the CONFIG_GPIO_SYFS config on both arm64 and amd64.

@raballew
Copy link
Copy Markdown
Contributor Author

raballew commented Sep 1, 2021

@krnowak It seems that both CONFIG_SYSFS and CONFIG_GPIOLIB were missing on amd64. I enabled both in the commonconfig-5.10. Is there a way, I can trigger CI to check whether everything works as expected?

@krnowak
Copy link
Copy Markdown
Contributor

krnowak commented Sep 2, 2021

@krnowak It seems that both CONFIG_SYSFS and CONFIG_GPIOLIB were missing on amd64. I enabled both in the commonconfig-5.10.

Thanks, I'll restart the CI.

Is there a way, I can trigger CI to check whether everything works as expected?

Sorry, not yet. We are working on it, though. :)

@krnowak
Copy link
Copy Markdown
Contributor

krnowak commented Sep 2, 2021

CI passed. I think you can mark the PR as "ready for review" now.

@raballew raballew marked this pull request as ready for review September 2, 2021 13:37
@raballew
Copy link
Copy Markdown
Contributor Author

raballew commented Sep 2, 2021

@krnowak Done.

@dongsupark dongsupark added the main label Sep 2, 2021
@dongsupark dongsupark requested a review from a team September 2, 2021 15:43
@krnowak krnowak merged commit 2738a00 into flatcar-archive:main Sep 2, 2021
@krnowak
Copy link
Copy Markdown
Contributor

krnowak commented Sep 2, 2021

Thanks for the PR!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants