aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Kyrylych <roman@archlinux.org>2008-03-19 09:12:19 (GMT)
committerRoman Kyrylych <roman@archlinux.org>2008-03-19 21:21:03 (GMT)
commit5386d7332dd77ecf4113dfc10773b529f583e797 (patch)
tree1dcc25f52910cd56b2c545e5bbd7e7c5ebacc0d1
parent6e37620983c107e13120d1e249a37b3be6d0b12d (diff)
downloadinitscripts-5386d7332dd77ecf4113dfc10773b529f583e797.tar.xz
Use actual device number for creating /dev/misc/rtc02008.03-4
Signed-off-by: Roman Kyrylych <roman@archlinux.org>
-rwxr-xr-xrc.sysinit11
1 files changed, 7 insertions, 4 deletions
diff --git a/rc.sysinit b/rc.sysinit
index d175150..0d3c64a 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -52,10 +52,13 @@ fi
/bin/grep -qw usbfs /proc/filesystems && /bin/mount -n -t usbfs none /proc/bus/usb
# enable rtc access
-/bin/mkdir /dev/misc/
-/bin/mknod /dev/misc/rtc0 c 252 0
-/bin/ln -s /dev/misc/rtc0 /dev/rtc
/sbin/modprobe rtc-cmos >/dev/null 2>&1
+RTC_MAJOR=$(/bin/grep -w rtc /proc/devices 2>/dev/null); RTC_MAJOR="${RTC_MAJOR%% *}"
+if [ -n "$RTC_MAJOR" ]; then
+ /bin/mkdir /dev/misc/
+ /bin/mknod /dev/misc/rtc0 c $RTC_MAJOR 0
+ /bin/ln -s /dev/misc/rtc0 /dev/rtc
+fi
HWCLOCK_PARAMS="--hctosys"
if [ "$HARDWARECLOCK" = "UTC" ]; then
@@ -70,7 +73,7 @@ fi
# Set clock early to fix some bugs with filesystem checks
# Clock is set again later to match rc.conf
if [ -f /etc/localtime ]; then
- /sbin/hwclock $HWCLOCK_PARAMS --noadjfile
+ /sbin/hwclock $HWCLOCK_PARAMS --noadjfile
fi
if [ -x /sbin/udevadm -a -d /sys/block ]; then