aboutsummaryrefslogtreecommitdiffstats
path: root/bash-completion/hwclock
diff options
context:
space:
mode:
authorBastian Krause <bst@pengutronix.de>2022-01-21 16:09:43 +0100
committerKarel Zak <kzak@redhat.com>2022-01-28 11:37:47 +0100
commitb22b78b1be6df917d5c449d2f5e45d0a67f14502 (patch)
treee53e524530db4461321989e9ba0d2e684f7213d1 /bash-completion/hwclock
parent6097b12df708a91651972f73cac2984692196073 (diff)
downloadutil-linux-b22b78b1be6df917d5c449d2f5e45d0a67f14502.tar.gz
hwclock: add --param-set option
Implement the RTC_PARAM_SET RTC ioctl in hwclock. The ioctl interface was introduced with [1], which went mainline in Kernel v5.16. The parameters are independent of hardware/driver. This means we can read and set parameters in a generic way. The new --param-set hwclock function accepts aliases for parameters currently existent (Kernel v5.16). They can be extended later on. As fallback and for values, hexadecimal (if prefixed with 0x) and decimal values, as defined in [2], are accepted. Example: $ hwclock --param-set bsm=0x0 [1] https://lore.kernel.org/all/20211018151933.76865-1-alexandre.belloni@bootlin.com/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/rtc.h Signed-off-by: Bastian Krause <bst@pengutronix.de>
Diffstat (limited to 'bash-completion/hwclock')
-rw-r--r--bash-completion/hwclock5
1 files changed, 5 insertions, 0 deletions
diff --git a/bash-completion/hwclock b/bash-completion/hwclock
index 06e0ce79e8..6b4c01724d 100644
--- a/bash-completion/hwclock
+++ b/bash-completion/hwclock
@@ -23,6 +23,10 @@ _hwclock_module()
COMPREPLY=( $(compgen -W "param" -- $cur) )
return 0
;;
+ '--param-set')
+ COMPREPLY=( $(compgen -W "param=value" -- $cur) )
+ return 0
+ ;;
'-h'|'-?'|'--help'|'-v'|'-V'|'--version')
return 0
;;
@@ -49,6 +53,7 @@ _hwclock_module()
--delay
--epoch
--param-get
+ --param-set
--update-drift
--noadjfile
--adjfile