source: make-mini-image/config/29-tzdata @ 2905

Last change on this file since 2905 was 1827, checked in by mabarracus, 4 years ago

Final config & renamed scripts

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/bash
2set -e
3
4source CONFIG
5source functions
6
7ensure BASE NAME
8
9echo "Setting timezone ..."
10
11cat > ./${BASE}/${NAME}/script.sh << _EOF
12
13#set -x
14export DEBIAN_FRONTEND=noninteractive
15
16dpkg --purge --force-depends tzdata
17
18rm -f /etc/timezone
19rm -f /etc/localtime
20
21echo Europe/Madrid > /etc/timezone
22
23echo tzdata     tzdata/Zones/Europe     select  Madrid > /tmp/tzdata.preseed
24echo tzdata     tzdata/Areas    select  Europe >> /tmp/tzdata.preseed
25
26debconf-set-selections /tmp/tzdata.preseed
27
28apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install tzdata
29
30#if [ `cat /etc/timezone|grep Madrid|wc -l` != "1" ]; then
31#    echo Method 2
32#    echo set tzdata/Areas Europe | debconf-communicate
33#    echo set tzdata/Zones/Europe Madrid |debconf-communicate
34#    dpkg-reconfigure -f noninteractive tzdata
35#fi
36#
37#if [ `cat /etc/timezone|grep Madrid|wc -l` != "1" ]; then
38#    echo Method 3
39#    echo Europe/Madrid > /etc/timezone
40#    rm -f /etc/localtime
41#    ln -s /usr/share/zoneinfo/Europe/Madrid /etc/localtime
42#fi
43#
44# Need D-BUS
45# timedatectl set-timezone Europe/Madrid
46
47_EOF
48
49if [ "x${VERBOSE}" = "x0" ]; then
50    exec &> /dev/null
51fi
52
53ltsp-chroot --arch ${ARCH} --base ${BASE} -pcma ${NAME} bash /script.sh
54
55if [ "$?" != "0" ]; then
56    exit 1
57fi
58
59rm -f ./${BASE}/${NAME}/script.sh
60
61exit 0
Note: See TracBrowser for help on using the repository browser.