From 35cd88a7c8fbdd0ab3cba7523014bf601a8b1e13 Mon Sep 17 00:00:00 2001 From: Roman Kyrylych Date: Wed, 19 Mar 2008 11:12:19 +0200 Subject: [PATCH] Use actual device number for creating /dev/misc/rtc0 Signed-off-by: Roman Kyrylych --- rc.sysinit | 11 +++++++---- 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 -- 1.5.4.1