GPIOLOCK(4)
π GPIOLOCK(4) β the kernel interfaces manual page, bestie edition π
okay so real talk, this is a page from the Kernel Interfaces Manual and it's about gpiolock, which is genuinely one of those "wait that's so cool" drivers once you get what it does. buckle up π¦
β¨ NAME β¨
gpiolock β support for multi-position keylocks attached to GPIO pins π
like, actual physical keylocks. with keys. attached to pins. iconic.
πΈ SYNOPSIS πΈ
gpiolock* at gpio? offset ? mask ?
gpiolock* at gpio?
both forms are valid, no cap β the long one if you're specifying where the pins live, the short one if you're not π
π« DESCRIPTION π«
The gpiolock driver lets you connect multi-position keylocks over GPIO pins. yes, literally a keylock, like the ones on a server chassis, wired into your kernel ποΈβ¨
so here's the vibe: the keylock driver registers with an in-kernel keylock supporting system, and it provides kauth(9) support through an experimental security model. note the word experimental β it's giving "we're trying something new, be cool about it" π§ͺ
you can query the keylock state using the hw.keylock sysctl variables. super convenient, lowkey the best part π«Ά
important limits, don't skip these:
- Only locks with 2-4 positions are currently supported. that's the range. 2 to 4. periodt π
- The pin number is specified in the kernel configuration with the
offsetlocator. - The
masklocator denotes the pins used for the lock β minimum 2, maximum 4 pins are used.
and here's the cute part: offset and mask can also be specified when gpiolock is attached at runtime, using the GPIOATTACH ioctl(2) on the gpio(4) device. runtime config, we love to see it π
π₯ SEE ALSO π₯
go read those too, they're the supporting cast and they ate π
πΌ HISTORY πΌ
The gpiolock driver first appeared in NetBSD 6.0. a certified classic, honestly β
π AUTHORS π
The gpiolock driver was written by Marc Balmer <marc@msys.ch> β thank you king, we appreciate you π
bestie reminder: this is an experimental security model, and the lock only supports 2-4 positions with 2-4 mask pins. don't try to make it do more, it's not that kind of driver π
and that's the page! this edition of GPIOLOCK(4) comes from Debian, dated August 21, 2009 β mwah, bye bestie, go wire up a keylock πβ¨
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2009 Marc Balmer <marc@msys.ch>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms