- bnc#830060 - Dracut is missing warpclock/hwclock Add dracut-warpclock_module.patch OBS-URL: https://build.opensuse.org/request/show/225030 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=111
52 lines
1.3 KiB
Diff
52 lines
1.3 KiB
Diff
From bb18c6dea7727d32191fbc40c504bc1f52bcf9c3 Mon Sep 17 00:00:00 2001
|
|
From: Hannes Reinecke <hare@suse.de>
|
|
Date: Thu, 5 Dec 2013 09:29:28 +0100
|
|
Subject: [PATCH] 00warpclock: Set correct timezone
|
|
|
|
Add module for setting correct timezone.
|
|
|
|
Signed-off-by: Hannes Reinecke <hare@suse.de>
|
|
|
|
Index: dracut-036/modules.d/00warpclock/module-setup.sh
|
|
===================================================================
|
|
--- /dev/null
|
|
+++ dracut-036/modules.d/00warpclock/module-setup.sh
|
|
@@ -0,0 +1,23 @@
|
|
+#!/bin/bash
|
|
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
|
+# ex: ts=8 sw=4 sts=4 et filetype=sh
|
|
+
|
|
+# called by dracut
|
|
+check() {
|
|
+ [ -e /etc/localtime -a -e /etc/adjtime ]
|
|
+}
|
|
+
|
|
+# called by dracut
|
|
+depends() {
|
|
+ return 0
|
|
+}
|
|
+
|
|
+# called by dracut
|
|
+install() {
|
|
+ inst /usr/share/zoneinfo/UTC
|
|
+ inst /etc/localtime
|
|
+ inst /etc/adjtime
|
|
+ inst_hook pre-trigger 00 "$moddir/warpclock.sh"
|
|
+ inst /sbin/hwclock
|
|
+}
|
|
+
|
|
Index: dracut-036/modules.d/00warpclock/warpclock.sh
|
|
===================================================================
|
|
--- /dev/null
|
|
+++ dracut-036/modules.d/00warpclock/warpclock.sh
|
|
@@ -0,0 +1,9 @@
|
|
+#!/bin/sh
|
|
+
|
|
+if test -e /etc/adjtime ; then
|
|
+ while read line ; do
|
|
+ if test "$line" = LOCAL ; then
|
|
+ hwclock --systz
|
|
+ fi
|
|
+ done < /etc/adjtime
|
|
+fi
|