slitaz-arm view rootfs/etc/init.d/system.sh @ rev 151

Use Busybox ntpd to set system clock
author Christophe Lincoln <pankso@slitaz.org>
date Wed Apr 30 17:15:20 2014 +0200 (2014-04-30)
parents 7fae2a06e947
children ffc70eae1fe2
line source
1 #!/bin/sh
2 #
3 # /etc/init.d/system.sh : SliTaz ARM hardware configuration
4 #
5 # This script configures the sound card and screen. It also configures
6 # system language, keyboard and TZ.
7 #
8 . /etc/init.d/rc.functions
9 . /etc/rcS.conf
11 # Activate swap partition
12 if fgrep -q "swap" /etc/fstab; then
13 swapon -a
14 fi
16 # Sound configuration: restore or init
17 if [ -d "/proc/asound" ] && [ -x "/usr/sbin/alsactl" ]; then
18 echo "Initializing sound card..."
19 alsactl init
20 fi
22 # Locale config
23 [ -s "/etc/locale.conf" ] || echo "LANG=C" > /etc/locale.conf
24 . /etc/locale.conf
25 echo -n "Setting system locale: $LANG"
26 export LC_ALL=${LANG}; status
28 # Keymap config
29 [ -s "/etc/keymap.conf" ] || echo "us" > /etc/keymap.conf
30 kmap=$(cat /etc/keymap.conf)
31 echo -n "Loading console keymap: $kmap"
32 tazkeymap $kmap >/dev/null; status
34 # Timezone config
35 [ -s "/etc/TZ" ] || echo "UTC" > /etc/TZ
36 tz=$(cat /etc/TZ)
37 echo -n "Setting time zone to: $tz"
38 export TZ=${tz}; status
40 # For device without HW clock
41 if [ "$NTPD_HOST" ]; then
42 echo "Syncing system time..."
43 ntpd -q -p ${$NTPD_HOST}; status
44 fi
46 # DEPRECATED: Xorg dont need any config file anymore but the 60-Keyboard.conf
47 # Xorg configuration: $HOME is not yet set
48 if [ ! -s "/etc/X11/xorg.conf" ] && [ -x "/usr/bin/Xorg" ]; then
49 echo "Configuring Xorg server..." && HOME="/root"
50 tazx config-xorg 2>/var/log/xorg.configure.log
51 fi