Linux unable to open rtc device

подскажите пожалуйста, что делать с hwclock

здравствуйте! уважаемые знатоки Linux, помогите пожалуйста. проблема такая. запускаю на промышленном компе команду hwclock, а мне в ответ: hwclock: can’t open ‘/dev/misc/rtc’: No such file or directory . такой директории правда нет. но есть файл /dev/rtc. Что можно сделать? ооочень надо, чтобы запускалась именно команда hwclock, так там с помощью нее сделана синхронизация времени (не буду вдаваться в подробности. ), а она не выполняется.

что, так сложно в man заглянуть?

это прямо так надо в командной строке написать? можете пояснить что делается этой командой. нет сейчас возможности в ман заглянуть. кстати добавлю,что hwclock из busybox-а.

сделал как вы писали. вот что получил:

]# hwclock —rtc=/dev/rtc
hwclock: unrecognized option `—rtc=/dev/rtc’
BusyBox v1.17.3 (2010-11-17 16:31:44 YEKT) multi-call binary.

Usage: hwclock [-r|—show] [-s|—hctosys] [-w|—systohc] [-l|—localtime] [-u|—utc] [-f FILE]

Query and set hardware clock (RTC)

Options:
-r Show hardware clock time
-s Set system time from hardware clock
-w Set hardware clock to system time
-u Hardware clock is in UTC
-l Hardware clock is in local time
-f FILE Use specified device (e.g. /dev/rtc2)

hwclock -f /dev/rtc

сделал как вы писали. вот что получил:

]# hwclock —rtc=/dev/rtc
hwclock: unrecognized option `—rtc=/dev/rtc’
BusyBox v1.17.3 (2010-11-17 16:31:44 YEKT) multi-call binary.

Usage: hwclock [-r|—show] [-s|—hctosys] [-w|—systohc] [-l|—localtime] [-u|—utc] [-f FILE]

Query and set hardware clock (RTC)

Options:
-r Show hardware clock time
-s Set system time from hardware clock
-w Set hardware clock to system time
-u Hardware clock is in UTC
-l Hardware clock is in local time
-f FILE Use specified device (e.g. /dev/rtc2)

вот что получил. хотя ведь /dev/rtc есть точно.

root@maket_rez /mnt/sys/BIN]# hwclock -f /dev/rtc
hwclock: can’t open ‘/dev/rtc’: No such device
[root@maket_rez /mnt/sys/BIN]#

а поддержка rtc в ядре есть? в /proc/devices rtc присутствует?

дело в том, что в моем контроллере нет такого файлика. там просто файл-образ ядра, и корневая файловая система. вообще вся система собрана на busybox, там нет каталогов proc и т.д. можно какой-нибудь командой узнать есть нет поддержка эта?

dmesg | grep rtc

[root@maket_rez /dev]# dmesg | grep rtc
Using IPI Shortcut mode

че-то у меня такое чувство, что в ядре наверно не включена эта поддержка.

у меня тоже. должно быть нечто типа

rtc0: alarms up to one year, y3k, 114 bytes nvram, hpet irqs

Источник

Linux unable to open rtc device

The instructions should also work for Arch Linux with one exception: It is suggested to write an script for sysvinit. But sysvinit is depreciated and replaced with systemd in Arch. If you want to create a deamon for systemd, have a look at https://wiki.archlinux.org/index.php/Systemd.

If you have an internet connection most of the time, I personally wouldn’t bother to buy a rtc. You can manually set date with:

Читайте также:  Windows смартфон для android приложений

Re: hctosys.c unable to open device rtc

Re: hctosys.c unable to open device rtc

Re: hctosys.c unable to open device rtc

I had a call to make and can be corrected if I’m wrong.
The error causes no problems, just a «hey, you don’t have that hardware. «

If however you did have the hardware and it wasn’t built, it’s a big job getting it to work (including compiling the kernel)

You could always put loglevel=2 in /boot/cmdline.txt

Re: hctosys.c unable to open device rtc

I am aware that this doesn’t cause an issue anywhere else . I still want to get rid of it.

Can’t I just disable this? My rpi will only ever use internet time.

I don’t want to loglevel=2 for a few reasons.

Re: hctosys.c unable to open device rtc

Isn’t there a file that can be edited or removed that would disable it? I see the error text is in the subject line, but what about the line or lines just before it?

I see four rtc files in /usr/ called rtc, but do not have Pi online right now to paste file paths in here.

Try running following to see the files:

find /usr/ -name rtc

There could be other associated files, but removing those might do what you want. But back system up, who knows if that action might damage anything else.

Argh, I see that removes rtc but not the file calling it, I would guess you need to run a find on that other file and see if you can edit out the call to rtc, doing so without error could be tricky.

Re: hctosys.c unable to open device rtc

Re: hctosys.c unable to open device rtc

I wonder if there may be some way to put a setting in the other txt file in /boot besides cmdline. I wonder if a line in /boot/config.txt that set —hctosys, you might try googling this stuff if you haven’t.

If you are writing something that looks for the errors in your logs, you could always set it to ignore the rtc error.

Yeah, does look like it was compiled into kernel. But isn’t compiling your own kernel more work that it is worth? I would guess every time that the system gets updated, you would have to recompile, that can get old fast unless you enjoy it.

It does not look like the folks who wrote this stuff thought an error message about hardware not being present is not a big enough deal, for them to make it possible for us to disable it.

Re: hctosys.c unable to open device rtc

Re: hctosys.c unable to open device rtc

pepedog, isn’t there some parameter that would enable us to set where we wanted to get system time from, that could go in cmdline.txt? I saw in other forum that other folks really appreciated what you did on this, it is just that not everybody wants it. I guess it wouldn’t be such a big deal if it didn’t create that error message. I know I disabled the service that checks the internet for time by renaming the file, I forget what it is called, but this rtc stuff does not seem to have a way to do that, that is the problem.

On setting a parameter, I can imagine choices being the ntpfd server (or whatever it is called), rtc, maybe other stuff and also one option that says Nope, do not want any of the above.

Читайте также:  Air music для windows

Re: hctosys.c unable to open device rtc

Not really, it’s a builtin module.
It’s done now
git commit -m «core/linux-raspberrypi remove RTC_HCTOSYS» -a
Awaiting build

Источник

ISST-LTE: unable to open rtc device

Affects Status Importance Assigned to Milestone
linux (Ubuntu) Edit

Bug Description

== Comment: #0 — Chanh H. Nguyen — 2015-01-09 17:30:08 ==
We use DVD to install Ubuntu 15.04 kernel 3.18.0-8-generic version on our PowerVM system. After install, I am seeing this error «/build/ buildd/ linux-3. 18.0/drivers/ rtc/hctosys. c: unable to open rtc device» on the dmesg log.

# uname -a
Linux pole1lp3 3.18.0-8-generic #9-Ubuntu SMP Mon Jan 5 22:52:15 UTC 2015 ppc64le ppc64le ppc64le GNU/Linux
root@pole1lp3:

# dmesg |grep rtc
[ 0.556763] /build/ buildd/ linux-3. 18.0/drivers/ rtc/hctosys. c: unable to open rtc device (rtc0)
[ 3.296241] rtc-generic rtc-generic: rtc core: registered rtc-generic as rtc0
root@pole1lp3:

== Comment: #2 — David Heller — 2015-01-13 20:53:50 ==
It must be an order of operations thing: something is trying to do the hctosys before the driver is loaded. A few seconds later the driver loads and it seems fine after that.

# dmesg | grep rtc
[ 0.551202] /build/ buildd/ linux-3. 18.0/drivers/ rtc/hctosys. c: unable to open rtc device (rtc0)
[ 3.353719] rtc-generic rtc-generic: rtc core: registered rtc-generic as rtc0

# find /dev -name \*rtc\*
/dev/rtc
/dev/rtc0

# hwclock
Tue 13 Jan 2015 07:36:15 PM CST -0.779773 seconds

# date
Tue Jan 13 19:38:05 CST 2015

tags: added: architecture-ppc64le bugnameltc-120243 severity-medium targetmilestone-inin—

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https:/ /wiki.ubuntu. com/Bugs/ FindRightPackag e. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https:/ /bugs.launchpad .net/ubuntu/ +bug/1410604/ +editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

Setting to package «init» on LP side, as it appears to be an init issue rather than a kernel issue.

affects: ubuntu → init-system-helpers (Ubuntu)

——- Comment From 2015-01-14 15:15 EDT——-
The same problem is seen on 14.10 as well:

# uname -a
Linux cellc10 3.16.0- 23-powerpc64- smp #31-Ubuntu SMP Tue Oct 21 18:12:52 UTC 2014 ppc64 ppc64 ppc64 GNU/Linux

# dmesg | grep rtc
[ 0.692983] /build/ buildd/ linux-3. 16.0/drivers/ rtc/hctosys. c: unable to open rtc device (rtc0)
[ 4.349881] rtc-generic rtc-generic: rtc core: registered rtc-generic as rtc0

# find /dev -name \*rtc\*
/dev/rtc
/dev/rtc0

# hwclock
Wed 14 Jan 2015 10:11:47 AM EST -0.816985 seconds

——- Comment From 2015-01-20 10:51 EDT——-
*** Bug 120596 has been marked as a duplicate of this bug. ***

Even thought this is a benign error, it is seen on all archs on every release as far back as trusty (at least). Can you please set a target for resolution? Thanks.

——- Comment From 2015-11-18 11:00 EDT——-
*** Bug 128128 has been marked as a duplicate of this bug. ***

——- Comment From 2015-12-03 06:47 EDT——-
Hi Canonical,

Is there any update on this bug?
Do you need any other information in order debug/solve this bug?

Thanks for your support.

tags: added: targetmilestone-inin1604
removed: targetmilestone-inin—

The only place known to me that does that is /etc/init. d/hwclock. sh, which is from util-linux. Something similar is also done under upstart from /etc/init/ hwclock. conf where hwclock is called with —systz. This quite plausibly opens rtc as well.

However, these two scripts aren’t being run at all any more under systemd — there it would be timedated which accesses /dev/rtc, but I don’t see how this is being activated that early (it usually doesn’t run at boot at all).

Can you please confirm whether this happens under upstart or systemd? In the latter case, can you please do

sudo journalctl -b > /tmp/journal.txt

and attach /tmp/journal.txt here? Thanks!

affects: init-system-helpers (Ubuntu) → util-linux (Ubuntu)
Changed in util-linux (Ubuntu):
status: New → Incomplete
importance: Undecided → Low

——- Comment on attachment From 2016-02-24 09:33 EDT——-

We still see this on 16.04 release.
root@pole2lp2:

# uname -r
4.4.0-6-generic
root@pole2lp2:

# dmesg |grep «rtc»
[ 25.057147] hctosys: unable to open rtc device (rtc0)
[ 484.267157] rtc-generic rtc-generic: rtc core: registered rtc-generic as rtc0
root@pole2lp2:

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Xenial Xerus (development branch)
Release: 16.04
Codename: xenial

Thanks for the journal. This shows that the error message happens way earlier than userspace/pid 1 starts. So it’s either the kernel itself, or the initramfs. I can indeed see this error message in our ppc64el scalingstack instances as well.

So I went through the initramfs-tools hooks and scripts and found /usr/share/ initramfs- tools/scripts/ local-premount/ fixrtc, which indeed does call «hwclock -s || true» (-s == —hctosys). However, while that’s promising that isn’t it: That code only runs if «fixrtc» is on the command line, which it isn’t (at least for me). Adding a set -x there also shows that it runs after the error message:

[ 0.625781] evm: HMAC attrs: 0x1
[ 0.625920] hctosys: unable to open rtc device (rtc0)
[ 0.626595] Freeing unused kernel memory: 6144K (c000000000e80000 — c000000001480000)
Loading, please wait.
starting version 229
[ 0.637968] random: udevadm urandom read with 1 bits of entropy available
Begin: Loading essential drivers . done.
Begin: Running /scripts/ init-premount . done.
Begin: Mounting root file system . Begin: Running /scripts/local-top . done.
Begin: Running /scripts/ local-premount . + PREREQ=
+ BROKEN_CLOCK=
+ ROOTDEV=
+ SYSTEMPART=
+ cat /proc/cmdline
+ value=UUID= 9f6cb10b- 904a-4b22- b9e1-80455f176c c2
+ ROOTDEV= /dev/disk/ by-uuid/ 9f6cb10b- 904a-4b22- b9e1-80455f176c c2
+ [ -z /dev/disk/ by-uuid/ 9f6cb10b- 904a-4b22- b9e1-80455f176c c2 -a -n ]
+ [ -n -a -n /dev/disk/ by-uuid/ 9f6cb10b- 904a-4b22- b9e1-80455f176c c2 ]
+ exit 0
done.
Warning: fsck not present, so skipping root file system
[ 2.608767] EXT4-fs (vda1): mounted filesystem with ordered data mode. Opts: (null)
done.
Begin: Running /scripts/ local-bottom . done.
Begin: Running /scripts/ init-bottom . done.
[ 2.657889] systemd[1]: systemd 229 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSET
UP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN)

Источник

Читайте также:  Gem install ruby mac os
Оцените статью