flatcar / Flatcar

Flatcar project repository for issue tracking, project documentation, etc.
https://www.flatcar.org/
Apache License 2.0
653 stars 27 forks source link

[RFE] Enable CONFIG_PPS_CLIENT_GPIO in kernel #1430

Closed space55 closed 2 months ago

space55 commented 2 months ago

Current situation

Currently, CONFIG_PPS_CLIENT_GPIO is not set, which causes PPS services to be unavailable.

Impact

I am in progress with trying to make a GPS-disciplined network clock on a Raspberry Pi, using chronyd and gpsd. This requires a PPS device to be created in /dev, which gpsd can then use to synchronize with a serial device. I am unable to load the module pps-gpio which exists on Raspbian.

Ideal future situation

Ideally, I would be able to create a /dev/pps0 device that can be used by gpsd to control chrony & set the RTC accurately.

Implementation options

The primary method I can think of is to change the kernel build config setting to set CONFIG_PPS_CLIENT_GPIO=y

Additional information

$ modprobe pps-gpio
libkmod: kmod_config_parse: /etc/modprobe.d/gpio.conf line 1: ignoring bad line starting with 'pps_gpio'
modprobe: FATAL: Module pps-gpio not found in directory /lib/modules/6.1.85-flatcar

System info:

$ cat /etc/os-release
NAME="Flatcar Container Linux by Kinvolk"
ID=flatcar
ID_LIKE=coreos
VERSION=3815.2.2
VERSION_ID=3815.2.2
BUILD_ID=2024-04-13-1325
SYSEXT_LEVEL=1.0
PRETTY_NAME="Flatcar Container Linux by Kinvolk 3815.2.2 (Oklo)"
ANSI_COLOR="38;5;75"
HOME_URL="https://flatcar.org/"
BUG_REPORT_URL="https://issues.flatcar.org"
FLATCAR_BOARD="arm64-usr"
CPE_NAME="cpe:2.3:o:flatcar-linux:flatcar_linux:3815.2.2:*:*:*:*:*:*:*"

If there are any questions, or anything I can do/test, please let me know!

pothos commented 2 months ago

The file to enable this would be sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-modules/files/commonconfig-6.6 or sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-modules/files/arm64_defconfig-6.6 in the scripts repo. Before being able to merge such a change we need to keep an eye on the filesystem usage of the boot partition (The CI for the scripts repo produces an image report artifact which reports size changes).

ader1990 commented 2 months ago

Hello, on my Orange PI, this is the size of the module - should be fine size-wise, but we need to cross check:

ls -liath /lib/modules/5.10.160-rockchip/kernel/drivers/pps/clients/pps-gpio.ko
284324 -rw-r--r-- 1 root root 13K Mar 21 15:57 /lib/modules/5.10.160-rockchip/kernel/drivers/pps/clients/pps-gpio.ko
pothos commented 2 months ago

Thanks, if it's just a module it won't be in the initrd and things are good.