chiark / gitweb /
do not create /dev/rtc symlink, let systemd search for it if needed
authorKay Sievers <kay@vrfy.org>
Wed, 24 Apr 2013 17:12:44 +0000 (19:12 +0200)
committerKay Sievers <kay@vrfy.org>
Wed, 24 Apr 2013 17:20:51 +0000 (19:20 +0200)
The export of the RTCs hctosys flag is uneccesary, the kernel takes care
of the persistemt clock management itself, without any need for:
  CONFIG_RTC_HCTOSYS=y
  CONFIG_RTC_HCTOSYS_DEVICE="rtc0"

"Chaotic hardware platforms" without native kernel persistent clock
support will find the proper RTC with the logic rtc_open() without
the need for a custom symlink.

rules/50-udev-default.rules
src/shared/hwclock.c

index 179065211a2325d70001eccd078abbe6bb9b9cd0..234dc3b915e71fc063b6446e39562d44930a619e 100644 (file)
@@ -1,6 +1,5 @@
 # do not edit this file, it will be overwritten on update
 
-SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc"
 SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}"
 
 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
@@ -15,8 +14,6 @@ SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620"
 SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty"
 KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"
 
-SUBSYSTEM=="rtc", ATTR{hctosys}=="1", MODE="0644"
-
 SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640"
 
 SUBSYSTEM=="input", KERNEL=="mouse*|mice|event*", MODE="0640"
index a3b33ed4cc90dc2fad7bc594c2e65a48cf2e6d99..837f51f9478839385b60c9823ebb67374f9991de 100644 (file)
@@ -47,15 +47,14 @@ static int rtc_open(int flags) {
         int fd;
         DIR *d;
 
-        /* First, we try to make use of the /dev/rtc symlink. If that
-         * doesn't exist, we open the first RTC which has hctosys=1
-         * set. If we don't find any we just take the first RTC that
-         * exists at all. */
-
-        fd = open("/dev/rtc", flags);
-        if (fd >= 0)
-                return fd;
-
+        /*
+         * Some "chaotic platforms" have multiple RTCs and we need to
+         * find the "system RTC", which is in some setups /dev/rtc1.
+         *
+         * First, we try to find the RTC which has hctosys=1 set. If we
+         * don't find any we just take the first RTC that exists at all,
+         * then try to open /dev/rtc0.
+         */
         d = opendir("/sys/class/rtc");
         if (!d)
                 goto fallback;