# rtc-cmos module needs to be configured

## GenHeDi

Hello,

during booting OpenRC 0.26.3 is complaining:

```
The rtc-cmos module needs to be configured in /etc/conf.d/modules or built in. 
```

My /etc/conf.d/modules looks like below:

```
cat /etc/conf.d/modules 

# Linux users can define a list of modules for a specific kernel version,

# a released kernel version, a main kernel version or all kernel versions.

# The most specific versioned variable will take precedence.

# FreeBSD users can only use the modules="foo bar" setting.

#modules_2_6_23_gentoo_r5="ieee1394 ohci1394"

#modules_2_6_23="tun ieee1394"

#modules_2_6="tun"

#modules_2="ipv6"

#modules="ohci1394"

# Linux users can give modules a different name when they load - the new name

# will also be used to pick arguments below.

# This is not supported on FreeBSD.

#modules="dummy:dummy1"

# Linux users can give the modules some arguments if needed, per version

# if necessary.

# Again, the most specific versioned variable will take precedence.

# This is not supported on FreeBSD.

#module_ieee1394_args="debug"

#module_ieee1394_args_2_6_23_gentoo_r5="debug2"

#module_ieee1394_args_2_6_23="debug3"

#module_ieee1394_args_2_6="debug4"

#module_ieee1394_args_2="debug5"

# You should consult your kernel documentation and configuration

# for a list of modules and their options.
```

Please advice what is best: build in or configured in /etc/conf.d/modules?

Regards

----------

## Ant P.

```

config RTC_DRV_CMOS

   tristate "PC-style 'CMOS'"

   depends on X86 || ARM || M32R || PPC || MIPS || SPARC64 || MN10300

   default y if X86
```

The default is built-in, therefore you should leave it built in. A better question is why did you disable it?

----------

## GenHeDi

Hello Ant P.

Well, I did not disable it intentionally.

I had a look at /usr/src/linux/drivers/rtc/Kconfig:

```
config RTC_DRV_CMOS

 tristate "PC-style 'CMOS'"

 depends on X86 || ARM || M32R || PPC || MIPS || SPARC64 || MN10300

 default y if X86

 select RTC_MC146818_LIB
```

I had a look for "RTC_MC146818_LIB" in my .config file of the current running Linux/x86 4.9.16 kernel:

```
cat .config | grep RTC_MC146818_LIB

CONFIG_RTC_MC146818_LIB=y
```

A search on "CMOS" in "make menuconfig" shows:

```
Symbol: GENERIC_CMOS_UPDATE [=y]

 Type  : boolean

 Defined at kernel/time/Kconfig:51

 Selected by: X86 [=y] 

 

 Symbol: RTC_DRV_CMOS [=m] 

 Prompt: PC-style 'CMOS' 

 Location:

 -> Device Drivers

 -> Real Time Clock (RTC_CLASS [=y])

    Defined at drivers/rtc/Kconfig:827

    Depends on: RTC_CLASS [=y] && (X86 [=y] || ARM || M32R || PPC || MIPS || SPARC64 || MN10300) 

    Selects: RTC_MC146818_LIB [=y]
```

As far as my knowledge is concerned, the driver should be built in the kernel.

Please correct me if I am wrong.

----------

## krinn

That's how it is in that kernel config, it doesn't mean the running kernel use that config still.

You could either check the running config of your kernel or dmesg for cmos clue (as easy as dmesg | grep cmos).

----------

## GenHeDi

```
dmesg | grep cmos

[   23.778134] rtc_cmos 00:03: RTC can wake from S4

[   23.778267] rtc_cmos 00:03: rtc core: registered rtc_cmos as rtc0

[   23.778292] rtc_cmos 00:03: alarms up to one month, y3k, 242 bytes nvram, hpet irqs
```

The info I provided, is the configuration of the running kernel.

----------

## NeddySeagoon

GenHeDi,

```
[   23.778134] rtc_cmos... 
```

That's very late for any kernel built ins to be initialised.

----------

## GenHeDi

how can I speed this up?

----------

## krinn

for ref:

```
[    0.547709] rtc_cmos 00:02: RTC can wake from S4
```

as you see, it's not really about speed it up, but more about finding and fixing the real issue.

you could start with dmesg output no?

----------

## GenHeDi

Hello Krinn

Thanks for your reply.

I definitely agree on finding and fixing the real issue.  

Do I understand you correctly that I should provide the complete dmesg output?

If so, what is a proper way to do this? Because it is a huge amount of text. Copy / paste into this topic is a bit over the top I suppose. 

Regards,

GenHeDi

----------

## Hu

Put the output of dmesg onto a pastebin site, then post here the URL of the pasted content.  You can use app-text/wgetpaste to simplify this.

----------

## GenHeDi

Hello,

I did put my dmesg on https://pastebin.com/7zuDuK15

Regards

----------

## GenHeDi

How can I definitly be sure if  the right module is build in, in the right way?

----------

## GenHeDi

I solved the problem with following step:

```
make menuconfig
```

In section 

```
→ Device Drivers → Real Time Clock
```

I changed 

```
<M>   PC-style 'CMOS'
```

 into  

```
<*>   PC-style 'CMOS'
```

My rc.log shows:

```
* Setting hardware clock using the system clock [Local Time] ...

 [ ok ]
```

And:

```
dmesg | grep cmos

[    2.840449] rtc_cmos 00:03: RTC can wake from S4

[    2.840612] rtc_cmos 00:03: rtc core: registered rtc_cmos as rtc0

[    2.840692] rtc_cmos 00:03: alarms up to one month, y3k, 242 bytes nvram, hpet irqs

[    2.841886] rtc_cmos 00:03: setting system clock to 2017-08-23 19:41:45 UTC (1503517305)
```

I think this is the solution.

Regards

GenHedi

----------

