From 11909e6cda0cca5ff0f074044a7ea168dd5b1ed7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Mon, 21 Feb 2011 14:05:28 -0500 Subject: [PATCH] Handle /dev/rtc name change for newer kernels --- initscripts/pl_sysinit | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/initscripts/pl_sysinit b/initscripts/pl_sysinit index 136c254..7bfb061 100755 --- a/initscripts/pl_sysinit +++ b/initscripts/pl_sysinit @@ -147,5 +147,22 @@ echo $(date "+%H:%M:%S") "pl_sysinit: bringing network online" echo "" echo $(date "+%H:%M:%S") "pl_sysinit: attempting to sync clock" /usr/sbin/ntpdate -b -t 10 -u pool.ntp.org + +# Handle /dev/rtc name change for newer kernels +# otherwise hwclock fails +baseMaj=`uname -r | cut -d "." -f1` +baseMin=`uname -r | cut -d "." -f2` +vers=`uname -r | cut -d "." -f3 | cut -d "-" -f1` +if [ $baseMaj -eq 2 ];then + if [ $baseMin -eq 6 ]; then + if [ $vers -ge 32 ];then + if [ "$(readlink /dev/rtc)" != "/dev/rtc0" ]; then + rm -f /dev/rtc + ln -s /dev/rtc0 /dev/rtc + fi + fi + fi +fi + # save ntp clock to hardware /sbin/hwclock --systohc --utc -- 2.43.0