Bob Mottram пре 9 година
родитељ
комит
e7b6f13e9b
2 измењених фајлова са 21 додато и 0 уклоњено
  1. 20
    0
      src/freedombone
  2. 1
    0
      src/freedombone-image-customise

+ 20
- 0
src/freedombone Прегледај датотеку

@@ -35,6 +35,8 @@ PROJECT_NAME='freedombone'
35 35
 export TEXTDOMAIN=$PROJECT_NAME
36 36
 export TEXTDOMAINDIR="/usr/share/locale"
37 37
 
38
+DEFAULT_LANGUAGE='en_GB'
39
+
38 40
 # username created by default within a debian image
39 41
 GENERIC_IMAGE_USERNAME='fbone'
40 42
 
@@ -522,6 +524,19 @@ function show_help {
522 524
   exit 0
523 525
 }
524 526
 
527
+function locale_setup {
528
+  if grep -Fxq "locale_setup" $COMPLETION_FILE; then
529
+      return
530
+  fi
531
+
532
+  apt-get -y install locales debconf
533
+  update-locale LANGUAGE=${DEFAULT_LANGUAGE}.UTF-8
534
+  update-locale LC_MESSAGES=${DEFAULT_LANGUAGE}.UTF-8
535
+  update-locale LC_ALL=${DEFAULT_LANGUAGE}.UTF-8
536
+  update-locale LC_CTYPE=${DEFAULT_LANGUAGE}.UTF-8
537
+
538
+  echo 'locale_setup' >> $COMPLETION_FILE
539
+}
525 540
 
526 541
 function interactive_configuration_remote_backups {
527 542
   if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
@@ -857,6 +872,9 @@ function read_configuration {
857 872
       if [[ $CONFIGURATION_FILE != '/root/freedombone.cfg' ]]; then
858 873
           cp $CONFIGURATION_FILE /root/freedombone.cfg
859 874
       fi
875
+      if grep -q "DEFAULT_LANGUAGE" $CONFIGURATION_FILE; then
876
+          DEFAULT_LANGUAGE=$(grep "DEFAULT_LANGUAGE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
877
+      fi
860 878
       if grep -q "MINIMAL_INSTALL" $CONFIGURATION_FILE; then
861 879
           MINIMAL_INSTALL=$(grep "MINIMAL_INSTALL" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
862 880
       fi
@@ -6157,6 +6175,7 @@ function initial_setup {
6157 6175
   if grep -Fxq "initial_setup" $COMPLETION_FILE; then
6158 6176
       return
6159 6177
   fi
6178
+
6160 6179
   apt-get -y remove --purge apache*
6161 6180
   apt-get -y dist-upgrade
6162 6181
   apt-get -y install ca-certificates emacs24 cpulimit
@@ -11932,6 +11951,7 @@ function install_final {
11932 11951
 
11933 11952
 
11934 11953
 read_configuration
11954
+locale_setup
11935 11955
 parse_args
11936 11956
 check_domains
11937 11957
 install_not_on_BBB

+ 1
- 0
src/freedombone-image-customise Прегледај датотеку

@@ -355,6 +355,7 @@ chroot "$rootdir" apt-get install -y sudo git dialog toilet build-essential open
355 355
 chroot "$rootdir" apt-get install -y avahi-daemon avahi-utils avahi-discover avahi-autoipd
356 356
 chroot "$rootdir" apt-get install -y iptables dnsutils net-tools network-manager iputils-ping
357 357
 chroot "$rootdir" apt-get install -y libnss-mdns libnss-myhostname libnss-gw-name nano man ntp
358
+chroot "$rootdir" apt-get install -y locales debconf
358 359
 
359 360
 sed -i "s|#host-name=.*|host-name=${PROJECT_NAME}|g" $rootdir/etc/avahi/avahi-daemon.conf
360 361