Pagina 1 di 1

[Risolto]Orologio kernel 3.x

Inviato: dom 5 feb 2012, 16:34
da N1cuz
Con l'aggiornamento del kernel ho notato che l'orologio è 1 ora avanti. Ho visto che anche a qualcun altro (mi pare 414N, chiedo scusa se mi sto sbagliando) è successo questo ed è stato risolto ricompilando nel kernel il modulo RTC ed RTC-Cmos.
Ho ricompilato il kernel ed ho sincronizzato l'ora con:

Codice: Seleziona tutto

ntpdate it.pool.ntp.org
Ma ad ogni riavvio l'orologio mi ritorna un ora avanti.
Non essendo sempre attaccato alla rete (anzi all'avvio non lo sono mai...) non posso mettere il comando "ntpdate" in rc.local, oltrettutto dando:

Codice: Seleziona tutto

hwclock --systohc --debug
mi dice che non esiste /dev/rtc... devo aggiungere per caso qualche altro driver oltre a cmos?

Re: Orologio kernel 3.x

Inviato: dom 5 feb 2012, 17:07
da targzeta
Da un rapido sguardo al menù del kernel sembra che ci sono due modi e mi sa che io sono ancora al vecchio modo.

La slackware usa sincronizzare l'orologio con hwclock: all'avvio con ' --hctosys' (ovvero setta l'orologio di sistema usando quello hardware) e allo shutdown con '--systohc' (ovvero setta quello hardware usando quello di sistema). Il comando in questione vuole il device '/dev/rtc'.

Il vecchio modo è quello di settare nel menù del kernel:

Codice: Seleziona tutto

Device Driver -> Character devices -> Enhanced Real Time Clock Support (legacy PC RTC driver)
se leggi le info noterai che questo driver crea il device che ci serve. Inoltre potresti anche disabilitare del tutto la voce del menù:

Codice: Seleziona tutto

Device Driver -> Real Time Clock
Il nuovo modo è quello di disalbilitare (sempre dal menù del kernel) il legacy driver 'Enhanced Real Time Clock Support' ed usare:

Codice: Seleziona tutto

Device Driver -> Real Time Clock
una volta abilitato questo menù, controlla la voce:

Codice: Seleziona tutto

/dev/rtcN (character devices)
e vedrai che ti spiega cosa fare. In pratica tu dovresti avere uno o più device chiamato '/dev/rtcN', che ti dovrebbe essere stato creato da udev. Le info dicono anche di creare il link simbolico /dev/rtc usando uno di questi. Inoltre dice che recenti versioni di udev dovrebbero farlo già da se. A questo proposito, ho notato che l'udev della current ha la seguente regola:

Codice: Seleziona tutto

SUBSYSTEM=="rtc", DRIVERS=="rtc_cmos", SYMLINK+="rtc"
quindi la domanda sorge spontanea. Ma il modulo è caricato? Dovresti poterlo vedere con lsmod, si chiama rtc_cmos. Se non è caricato, magari alla fine è solo per quello che non funziona :).

Emanuele

Re: Orologio kernel 3.x

Inviato: dom 5 feb 2012, 17:37
da N1cuz
In effetti con lsmod non vedo il modulo e con

Codice: Seleziona tutto

modprobe rtc_cmos
non ottengo nulla... Sono andato a rivedere il mio config e rtc_coms c'è...

Re: Orologio kernel 3.x

Inviato: dom 5 feb 2012, 17:58
da targzeta
Che vuol dire che non ottieni nulla? Se il modulo c'è ti viene caricato, altrimenti ti esce un messaggio di errore. C'è da dire che nel menù il modulo lo indica come rtc-cmos e non rtc_cmos, però di solito i moduli non hanno il tratino ma l'underscore.

Controlla, dopo modprobe, l'output di dmesg, magari il modulo richiede qualcosa che tu non hai, anche se è molto strano.

Emanuele

:edit: ma non è che il modulo è in built-in nel kernel no? Ma riguardo ai /dev/rtcN, ne hai qualcuno o nessuno?

Re: Orologio kernel 3.x

Inviato: dom 5 feb 2012, 18:43
da N1cuz
Si sono un c....one, il modulo è built-in, ho ricompilato il kernel proprio per quello... comunque non ho nessun rtcN in /dev...

Re: Orologio kernel 3.x

Inviato: dom 5 feb 2012, 19:14
da targzeta
E non hai neanche un rtc_cmos? Puoi postare il dmesg? E magari anche l'output del comando:

Codice: Seleziona tutto

zcat /proc/config.gz | grep RTC
Emanuele

Re: Orologio kernel 3.x

Inviato: dom 5 feb 2012, 23:18
da N1cuz
Credo che di dmesg ti interessi solo questa parte giusto? altrimenti posto tutto:

Codice: Seleziona tutto

[    4.286930] rtc_cmos 00:08: RTC can wake from S4
[    4.287801] rtc_cmos 00:08: rtc core: registered rtc_cmos as rtc0
[    4.287837] rtc0: alarms up to one month, y3k, 242 bytes nvram, hpet irqs

Codice: Seleziona tutto

# zcat /proc/config.gz | grep RTC
CONFIG_HPET_EMULATE_RTC=y
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set
# RTC interfaces
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set
# I2C RTC drivers
# CONFIG_RTC_DRV_DS1307 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_DS3232 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_ISL12022 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_BQ32K is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set
# SPI RTC drivers
# Platform RTC drivers
CONFIG_RTC_DRV_CMOS=y
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_V3020 is not set
# CONFIG_RTC_DRV_PCF50633 is not set
# on-CPU RTC drivers
Non è settato praticamente nulla....

Re: Orologio kernel 3.x

Inviato: dom 5 feb 2012, 23:19
da N1cuz
spina ha scritto:E non hai neanche un rtc_cmos?
In /dev non ho nulla di tutto ciò...

Re: Orologio kernel 3.x

Inviato: lun 6 feb 2012, 0:16
da targzeta
Tu hai tutti e due le soluzioni attive. Secono me dovresti fare una scelta, o abiliti il veccho sistema legacy, disabilitando completamente la voce:

Codice: Seleziona tutto

Device Driver -> Real Time Clock
oppure usi le nuove API disabilitando la voce:

Codice: Seleziona tutto

Device Driver -> Character devices -> Enhanced Real Time Clock Support (legacy PC RTC driver)
se vedi, le voci associate nel config sono:

Codice: Seleziona tutto

CONFIG_RTC_CLASS=y
per le nuove API e

Codice: Seleziona tutto

CONFIG_HPET_EMULATE_RTC=y
per il vecchio driver.

Emanuele

Re: Orologio kernel 3.x

Inviato: lun 6 feb 2012, 8:23
da conraid

Codice: Seleziona tutto

$ grep -i RTC /boot/config-3.2.2-cf | grep -v ^#
CONFIG_HPET_EMULATE_RTC=y
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
CONFIG_RTC_DRV_CMOS=y
ho entrambe le voci attive ed ho

Codice: Seleziona tutto

$ ls -l /dev/rtc*
lrwxrwxrwx 1 root root      4 feb  6  2012 /dev/rtc -> rtc0
crw-r--r-- 1 root root 254, 0 feb  6  2012 /dev/rtc0
anche nei config di Pat sono entrambe abilitate, tra l'altro la voce CONFIG_HPET_EMULATE_RTC è "nascosta" ed abbinata ad HPET sistema in "confronto" con TSC da quel che ho capito, e quel che intendi tu con Device Driver -> Character devices -> Enhanced Real Time Clock Support (legacy PC RTC driver) in realtà è CONFIG_RTC

Re: Orologio kernel 3.x

Inviato: lun 6 feb 2012, 14:19
da N1cuz
Non so che dire, sono andato a letto ieri sera che non funzionava nulla, oggi è tutto a posto:

Codice: Seleziona tutto

CONFIG_HPET_EMULATE_RTC=y
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
CONFIG_RTC_DRV_CMOS=y

Codice: Seleziona tutto

$ ls -l /dev/rtc*
lrwxrwxrwx 1 root root      4 Feb  6 14:16 /dev/rtc -> rtc0
crw-r--r-- 1 root root 254, 0 Feb  6 14:16 /dev/rtc0
E non ho toccato nulla.... mah!

Grazie Ema e Conraid.

Re: Orologio kernel 3.x

Inviato: mar 7 feb 2012, 0:04
da targzeta
conraid ha scritto:...e quel che intendi tu con Device Driver -> Character devices -> Enhanced Real Time Clock Support (legacy PC RTC driver) in realtà è CONFIG_RTC
Hai ragione, comunque oggi è uscito il 3.2.5 e mi accingo a passare anche io alla classe RTC abbandonando il driver legacy. Speriamo di non avere problemi :).

Emanuele