]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/initscripts/system/setclock
apache2: Properly re-execute Apache on restart
[ipfire-2.x.git] / src / initscripts / system / setclock
index cc977ddbc0c2021d7e2582c9fec06696eea2b5d8..963507f9ace48e51c0d696d5c5aa28dfe7f5d249 100644 (file)
@@ -1,16 +1,23 @@
 #!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/setclock
-#
-# Description : Setting Linux Clock
-#
-# Authors     : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version     : 00.00
-#
-# Notes       :
-#
-########################################################################
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007-2022  IPFire Team  <info@ipfire.org>                     #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
 
 . /etc/sysconfig/rc
 . ${rc_functions}
@@ -22,6 +29,14 @@ case ${1} in
 
                boot_mesg "Setting system clock..."
 
+               FDT_COMPAT_FILE="/sys/firmware/devicetree/base/compatible"
+               # RTC may not be automatically loaded on some
+               # non-x86 machines
+               if [ -f "${FDT_COMPAT_FILE}" ] && \
+                       ( grep -q "traverse,ten64" "${FDT_COMPAT_FILE}" ); then
+                       modprobe rtc-rx8025
+               fi
+
                # udev not create the rtc symlink if rtc is in the kernel
                if [ ! -e /dev/rtc ]; then
                        if [ -e /dev/rtc0 ]; then