0

I am working on a script that needs to access raspi-config at "Interface Options > I2C" directly. Is there a way to do this at the command line ?

Thanks

5
  • 1
    maybe use raspi-config in non-interactive mode? github.com/raspberrypi-ui/rc_gui/blob/master/src/rc_gui.c#L81
    – Dirk
    Nov 14, 2022 at 14:26
  • Hmm, grep nonint $(which raspi-config) does point the way to such functionality, so probably no hackyness required, which brings it back on-topic I think. All apologies.
    – goldilocks
    Nov 14, 2022 at 15:02
  • @goldilocks the Pi GUI version of config utility (which uses the nonint bits) is mostly a frontend for raspi-config
    – Dirk
    Nov 14, 2022 at 16:38
  • I realize that; those defines are for invocating raspi-config. Some of them have [s]printf style substitutions in them (eg %d) which are placeholders for an additional argument to the invocation. The other ones aren't concatenated (probably -- I only checked a few) so you should be able to use them verbatim (eg. raspi-config nonint do_boot_behaviour B1). Most of the ones that don't have dynamic args are for getting current settings tho. So for case in point here you'd have to look at raspi-config to find out what the valid args are for raspi-config nonint do_i2c %d <- integer.
    – goldilocks
    Nov 14, 2022 at 18:06
  • ...You don't have to understand C or read through the GUI source, this will all be plainly laid out in raspi-config if you follow the script parameters starting with nonint, etc. They of course have not bothered documenting this AFAICT: github.com/RPi-Distro/raspi-config @FedeKrum If this all isn't clear to you leave a comment and I could come up with an answer; otherwise please add one yourself when you get the details sorted.
    – goldilocks
    Nov 14, 2022 at 18:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.