const char *name, uint64_t *id, uint64_t *value)
{
int rtc_fd;
- struct rtc_param param = { .param = 0 };
+ struct rtc_param param = { .index = ctl->param_idx };
/* handle name */
if (resolve_rtc_param_alias(name, ¶m.param) != 0
int set_param_rtc(const struct hwclock_control *ctl, const char *opt0)
{
int rtc_fd, rc = 1;
- struct rtc_param param = { .param = 0 };
+ struct rtc_param param = { .index = ctl->param_idx };
char *tok, *opt = xstrdup(opt0);
/* handle name */
#ifdef __linux__
puts(_(" --param-get <param> display the RTC parameter"));
puts(_(" --param-set <param>=<value> set the RTC parameter"));
+ puts(_(" --param-index <number> parameter index (default 0)"));
puts(_(" --vl-read read voltage low information"));
puts(_(" --vl-clear clear voltage low information"));
#endif
OPT_NOADJFILE,
OPT_PARAM_GET,
OPT_PARAM_SET,
+ OPT_PARAM_IDX,
OPT_VL_READ,
OPT_VL_CLEAR,
OPT_PREDICT,
#ifdef __linux__
{ "param-get", required_argument, NULL, OPT_PARAM_GET },
{ "param-set", required_argument, NULL, OPT_PARAM_SET },
+ { "param-index", required_argument, NULL, OPT_PARAM_IDX },
{ "vl-read", no_argument, NULL, OPT_VL_READ },
{ "vl-clear", no_argument, NULL, OPT_VL_CLEAR },
#endif
ctl.show = 0;
ctl.hwaudit_on = 1;
break;
+ case OPT_PARAM_IDX:
+ ctl.param_idx = strtou32_or_err(optarg, _("failed to parse param-index"));
+ break;
case OPT_VL_READ:
ctl.vl_read = 1;
ctl.show = 0;