浏览代码

Minimise the number of decisions during interactive install

Bob Mottram 9 年前
父节点
当前提交
3987268027
共有 7 个文件被更改,包括 355 次插入284 次删除
  1. 二进制
      man/freedombone-image.1.gz
  2. 二进制
      man/freedombone.1.gz
  3. 35
    8
      src/freedombone
  4. 300
    273
      src/freedombone-config
  5. 10
    2
      src/freedombone-image
  6. 8
    1
      src/freedombone-image-customise
  7. 2
    0
      src/freedombone-image-make

二进制
man/freedombone-image.1.gz 查看文件


二进制
man/freedombone.1.gz 查看文件


+ 35
- 8
src/freedombone 查看文件

@@ -53,6 +53,9 @@ INSTALLING_ON_BBB="no"
53 53
 # Version number of this script
54 54
 VERSION="1.01"
55 55
 
56
+# if yes then this minimises the number of descisions presented during install
57
+MINIMAL_INSTALL="yes"
58
+
56 59
 # Different system variants which may be specified within
57 60
 # the SYSTEM_TYPE option
58 61
 VARIANT_FULL="full"
@@ -473,6 +476,7 @@ function show_help {
473 476
   echo ''
474 477
   echo $'  -h --help             Show help'
475 478
   echo $'     menuconfig         Easy interactive installation'
479
+  echo $'     menuconfigfull     Full interactive installation'
476 480
   echo $'  -c --config           Installing from a configuration file'
477 481
   echo $'     --bbb              Installing on Beaglebone Black'
478 482
   echo $'  -u --user             User to install the system as'
@@ -561,11 +565,20 @@ function interactive_configuration {
561 565
       rm -f /tmp/meshuserdevice
562 566
   fi
563 567
 
564
-  freedombone-config \
565
-      -f $CONFIGURATION_FILE \
566
-      -w $FREEDOMBONE_WEBSITE \
567
-      -b $FREEDOMBONE_BITMESSAGE \
568
-      -m $MINIMUM_PASSWORD_LENGTH
568
+  if [[ $MINIMAL_INSTALL == "no" ]]; then
569
+      freedombone-config \
570
+          -f $CONFIGURATION_FILE \
571
+          -w $FREEDOMBONE_WEBSITE \
572
+          -b $FREEDOMBONE_BITMESSAGE \
573
+          -m $MINIMUM_PASSWORD_LENGTH
574
+  else
575
+      freedombone-config \
576
+          -f $CONFIGURATION_FILE \
577
+          -w $FREEDOMBONE_WEBSITE \
578
+          -b $FREEDOMBONE_BITMESSAGE \
579
+          -m $MINIMUM_PASSWORD_LENGTH
580
+          --minimal "yes"
581
+  fi
569 582
   if [ -f /tmp/meshuserdevice ]; then
570 583
       # mesh network user device installation
571 584
       rm -f /tmp/meshuserdevice
@@ -574,7 +587,7 @@ function interactive_configuration {
574 587
   if [ ! "$?" = "0" ]; then
575 588
       echo 'Command failed:'
576 589
       echo ''
577
-      echo "  freedombone-config -u $MY_USERNAME -f $CONFIGURATION_FILE -w $FREEDOMBONE_WEBSITE -b $FREEDOMBONE_BITMESSAGE -m $MINIMUM_PASSWORD_LENGTH"
590
+      echo "  freedombone-config -u $MY_USERNAME -f $CONFIGURATION_FILE -w $FREEDOMBONE_WEBSITE -b $FREEDOMBONE_BITMESSAGE -m $MINIMUM_PASSWORD_LENGTH --minimal [yes|no]"
578 591
       echo ''
579 592
       exit 73594
580 593
   fi
@@ -593,7 +606,14 @@ function interactive_configuration {
593 606
   fi
594 607
 }
595 608
 
596
-if [[ $1 == "menuconfig" ]]; then
609
+command_options=$1
610
+
611
+if [[ $command_options == "menuconfigfull" ]]; then
612
+  MINIMAL_INSTALL="no"
613
+  command_options="menuconfig"
614
+fi
615
+
616
+if [[ $command_options == "menuconfig" ]]; then
597 617
   interactive_configuration
598 618
 else
599 619
   while [[ $# > 1 ]]
@@ -760,6 +780,11 @@ else
760 780
     shift
761 781
     DEBIAN_REPO=$1
762 782
     ;;
783
+    # minimal install
784
+    --minimal)
785
+    shift
786
+    MINIMAL_INSTALL=$1
787
+    ;;
763 788
     *)
764 789
     # unknown option
765 790
     ;;
@@ -830,7 +855,9 @@ function read_configuration {
830 855
       if [[ $CONFIGURATION_FILE != '/root/freedombone.cfg' ]]; then
831 856
           cp $CONFIGURATION_FILE /root/freedombone.cfg
832 857
       fi
833
-
858
+      if grep -q "MINIMAL_INSTALL" $CONFIGURATION_FILE; then
859
+          MINIMAL_INSTALL=$(grep "MINIMAL_INSTALL" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
860
+      fi
834 861
       if grep -q "LETSENCRYPT_SERVER" $CONFIGURATION_FILE; then
835 862
           LETSENCRYPT_SERVER=$(grep "LETSENCRYPT_SERVER" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
836 863
       fi

+ 300
- 273
src/freedombone-config 查看文件

@@ -70,7 +70,7 @@ DEFAULT_DOMAIN_NAME=
70 70
 DEFAULT_DOMAIN_CODE=
71 71
 MY_EMAIL_ADDRESS=
72 72
 SYSTEM_TYPE=
73
-INSTALLING_ON_BBB=
73
+INSTALLING_ON_BBB="no"
74 74
 DDNS_PROVIDER=
75 75
 DDNS_USERNAME=
76 76
 DDNS_PASSWORD=
@@ -107,6 +107,7 @@ BATMAN_CELLID='any'
107 107
 WIFI_CHANNEL=
108 108
 CONFIGURATION_FILE=
109 109
 DH_KEYLENGTH=
110
+MINIMAL_INSTALL="no"
110 111
 
111 112
 function show_help {
112 113
     echo ''
@@ -120,6 +121,7 @@ function show_help {
120 121
     echo $'  -m --min              Minimum password length (characters)'
121 122
     echo $'  -w --www              Freedombone web site'
122 123
     echo $'  -b --bm               Freedombone support Bitmessage address'
124
+    echo $'     --minimal [yes|no] For minimalistic "consumer grade" installs'
123 125
     echo ''
124 126
     exit 0
125 127
 }
@@ -153,6 +155,10 @@ do
153 155
             shift
154 156
             FREEDOMBONE_BITMESSAGE="$1"
155 157
             ;;
158
+        --minimal)
159
+            shift
160
+            MINIMAL_INSTALL="$1"
161
+            ;;
156 162
         *)
157 163
             # unknown option
158 164
             ;;
@@ -731,269 +737,288 @@ function interactive_configuration {
731 737
     fi
732 738
     save_configuration_file
733 739
 
734
-    if [[ $(grep "INSTALLING_ON_BBB" temp.cfg | awk -F '=' '{print $2}') == "yes" ]]; then
735
-        dialog --title $"Install Target" \
736
-               --backtitle $"Freedombone Configuration" \
737
-               --yesno $"\nAre you installing onto a Beaglebone Black?" 7 60
738
-    else
739
-        dialog --title $"Install Target" \
740
-               --backtitle $"Freedombone Configuration" \
741
-               --defaultno \
742
-               --yesno $"\nAre you installing onto a Beaglebone Black?" 7 60
743
-    fi
744
-    sel=$?
745
-    case $sel in
746
-        0) INSTALLING_ON_BBB="yes";;
747
-        1) INSTALLING_ON_BBB="no";;
748
-        255) exit 1;;
749
-    esac
750
-    if [[ $INSTALLING_ON_BBB == "yes" ]]; then
751
-        USB_DRIVE=/dev/sda1
752
-        # here a short diffie-hellman key length is used, because otherwise creation of keys
753
-        # becomes impractically long on the beaglebone. It is known (as of 2015) that
754
-        # 1024bit DH may be breakable, so this is really a tradeoff between security and the
755
-        # available hardware
756
-        DH_KEYLENGTH=1024
740
+    if [[ $MINIMAL_INSTALL == "no" ]]; then
741
+        if [[ $(grep "INSTALLING_ON_BBB" temp.cfg | awk -F '=' '{print $2}') == "yes" ]]; then
742
+            dialog --title $"Install Target" \
743
+                   --backtitle $"Freedombone Configuration" \
744
+                   --yesno $"\nAre you installing onto a Beaglebone Black?" 7 60
745
+        else
746
+            dialog --title $"Install Target" \
747
+                   --backtitle $"Freedombone Configuration" \
748
+                   --defaultno \
749
+                   --yesno $"\nAre you installing onto a Beaglebone Black?" 7 60
750
+        fi
751
+        sel=$?
752
+        case $sel in
753
+            0) INSTALLING_ON_BBB="yes";;
754
+            1) INSTALLING_ON_BBB="no";;
755
+            255) exit 1;;
756
+        esac
757
+        if [[ $INSTALLING_ON_BBB == "yes" ]]; then
758
+            USB_DRIVE=/dev/sda1
759
+            # here a short diffie-hellman key length is used, because otherwise creation of keys
760
+            # becomes impractically long on the beaglebone. It is known (as of 2015) that
761
+            # 1024bit DH may be breakable, so this is really a tradeoff between security and the
762
+            # available hardware
763
+            DH_KEYLENGTH=1024
764
+        fi
765
+        save_configuration_file
757 766
     fi
758
-    save_configuration_file
759 767
 
760
-    if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
761
-        interactive_gpg
768
+    if [[ $MINIMAL_INSTALL == "no" ]]; then
769
+        if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
770
+            interactive_gpg
762 771
 
772
+            data=$(tempfile 2>/dev/null)
773
+            trap "rm -f $data" 0 1 2 5 15
774
+            SOCIAL_KEY_STR=$"\nDo you wish to enable social key management, otherwise known as \"the unforgettable key\"?\n\nThis means that fragments of your GPG key will be included with any remote backups so that if you later lose your key then it can be reconstructed from your friends servers. If you select \"no\" then you can still do social key management, but offline using physical USB thumb drives, which is more secure but less convenient."
775
+            if [[ $(grep "ENABLE_SOCIAL_KEY_MANAGEMENT" temp.cfg | awk -F '=' '{print $2}') == "yes" ]]; then
776
+                dialog --title $"Social Key Management" \
777
+                       --backtitle $"Freedombone Configuration" \
778
+                       --yesno "$SOCIAL_KEY_STR" 15 60
779
+            else
780
+                dialog --title $"Social Key Management" \
781
+                       --backtitle $"Freedombone Configuration" \
782
+                       --defaultno \
783
+                       --yesno "$SOCIAL_KEY_STR" 15 60
784
+            fi
785
+            sel=$?
786
+            case $sel in
787
+                0) ENABLE_SOCIAL_KEY_MANAGEMENT="yes";;
788
+                255) exit 1;;
789
+            esac
790
+            save_configuration_file
791
+        fi
792
+    else
793
+        # enable for the minimal case
794
+        ENABLE_SOCIAL_KEY_MANAGEMENT="yes"
795
+    fi
796
+
797
+    if [[ $MINIMAL_INSTALL == "no" ]]; then
763 798
         data=$(tempfile 2>/dev/null)
764 799
         trap "rm -f $data" 0 1 2 5 15
765
-        SOCIAL_KEY_STR=$"\nDo you wish to enable social key management, otherwise known as \"the unforgettable key\"?\n\nThis means that fragments of your GPG key will be included with any remote backups so that if you later lose your key then it can be reconstructed from your friends servers. If you select \"no\" then you can still do social key management, but offline using physical USB thumb drives, which is more secure but less convenient."
766
-        if [[ $(grep "ENABLE_SOCIAL_KEY_MANAGEMENT" temp.cfg | awk -F '=' '{print $2}') == "yes" ]]; then
767
-            dialog --title $"Social Key Management" \
768
-                   --backtitle $"Freedombone Configuration" \
769
-                   --yesno "$SOCIAL_KEY_STR" 15 60
800
+        if [[ $INSTALLING_ON_BBB != "yes" ]]; then
801
+            dialog --backtitle $"Freedombone Configuration" \
802
+                   --radiolist $"Type of Random Number Generator:" 10 40 2 \
803
+                   1 Haveged on \
804
+                   2 OneRNG off 2> $data
805
+            sel=$?
806
+            case $sel in
807
+                1) exit 1;;
808
+                255) exit 1;;
809
+            esac
810
+            case $(cat $data) in
811
+                2) HWRNG_TYPE="onerng"
812
+                   dialog --title $"OneRNG Device" \
813
+                          --msgbox $"Please ensure that the OneRNG device is disconnected. You can reconnect it later during the installation" 8 60
814
+                   ;;
815
+                255) exit 1;;
816
+            esac
770 817
         else
771
-            dialog --title $"Social Key Management" \
772
-                   --backtitle $"Freedombone Configuration" \
773
-                   --defaultno \
774
-                   --yesno "$SOCIAL_KEY_STR" 15 60
818
+            HWRNG_TYPE="beaglebone"
775 819
         fi
820
+        save_configuration_file
821
+    fi
822
+
823
+    if [[ $MINIMAL_INSTALL == "no" ]]; then
824
+        data=$(tempfile 2>/dev/null)
825
+        trap "rm -f $data" 0 1 2 5 15
826
+        dialog --backtitle $"Freedombone Configuration" \
827
+               --radiolist $"Where to download Debian packages from:" 25 45 49 \
828
+               1 $"Australia" off \
829
+               2 $"Austria" off \
830
+               3 $"Belarus" off \
831
+               4 $"Belgium" off \
832
+               5 $"Bosnia and Herzegovina" off \
833
+               6 $"Brazil" off \
834
+               7 $"Bulgaria" off \
835
+               8 $"Canada" off \
836
+               9 $"Chile" off \
837
+               10 $"China" off \
838
+               11 $"Croatia" off \
839
+               12 $"Czech Republic" off \
840
+               13 $"Denmark" off \
841
+               14 $"El Salvador" off \
842
+               15 $"Estonia" off \
843
+               16 $"Finland" off \
844
+               17 $"France 1" off \
845
+               18 $"France 2" off \
846
+               19 $"Germany 1" off \
847
+               20 $"Germany 2" off \
848
+               21 $"Greece" off \
849
+               22 $"Hungary" off \
850
+               23 $"Iceland" off \
851
+               24 $"Iran" off \
852
+               25 $"Ireland" off \
853
+               26 $"Italy" off \
854
+               27 $"Japan" off \
855
+               28 $"Korea" off \
856
+               29 $"Lithuania" off \
857
+               30 $"Mexico" off \
858
+               31 $"Netherlands" off \
859
+               32 $"New Caledonia" off \
860
+               33 $"New Zealand" off \
861
+               34 $"Norway" off \
862
+               35 $"Poland" off \
863
+               36 $"Portugal" off \
864
+               37 $"Romania" off \
865
+               38 $"Russia" off \
866
+               39 $"Slovakia" off \
867
+               40 $"Slovenia" off \
868
+               41 $"Spain" off \
869
+               42 $"Sweden" off \
870
+               43 $"Switzerland" off \
871
+               44 $"Taiwan" off \
872
+               45 $"Thailand" off \
873
+               46 $"Turkey" off \
874
+               47 $"Ukraine" off \
875
+               48 $"United Kingdom" off \
876
+               49 $"United States" on 2> $data
776 877
         sel=$?
777 878
         case $sel in
778
-            0) ENABLE_SOCIAL_KEY_MANAGEMENT="yes";;
879
+            1) exit 1;;
880
+            255) exit 1;;
881
+        esac
882
+        case $(cat $data) in
883
+            1) DEBIAN_REPO='ftp.au.debian.org';;
884
+            2) DEBIAN_REPO='ftp.at.debian.org';;
885
+            3) DEBIAN_REPO='ftp.by.debian.org';;
886
+            4) DEBIAN_REPO='ftp.be.debian.org';;
887
+            5) DEBIAN_REPO='ftp.ba.debian.org';;
888
+            6) DEBIAN_REPO='ftp.br.debian.org';;
889
+            7) DEBIAN_REPO='ftp.bg.debian.org';;
890
+            8) DEBIAN_REPO='ftp.ca.debian.org';;
891
+            9) DEBIAN_REPO='ftp.cl.debian.org';;
892
+            10) DEBIAN_REPO='ftp.cn.debian.org';;
893
+            11) DEBIAN_REPO='ftp.hr.debian.org';;
894
+            12) DEBIAN_REPO='ftp.cz.debian.org';;
895
+            13) DEBIAN_REPO='ftp.dk.debian.org';;
896
+            14) DEBIAN_REPO='ftp.sv.debian.org';;
897
+            15) DEBIAN_REPO='ftp.ee.debian.org';;
898
+            16) DEBIAN_REPO='ftp.fi.debian.org';;
899
+            17) DEBIAN_REPO='ftp2.fr.debian.org';;
900
+            18) DEBIAN_REPO='ftp.fr.debian.org';;
901
+            19) DEBIAN_REPO='ftp2.de.debian.org';;
902
+            20) DEBIAN_REPO='ftp.de.debian.org';;
903
+            21) DEBIAN_REPO='ftp.gr.debian.org';;
904
+            22) DEBIAN_REPO='ftp.hu.debian.org';;
905
+            23) DEBIAN_REPO='ftp.is.debian.org';;
906
+            24) DEBIAN_REPO='ftp.ir.debian.org';;
907
+            25) DEBIAN_REPO='ftp.ie.debian.org';;
908
+            26) DEBIAN_REPO='ftp.it.debian.org';;
909
+            27) DEBIAN_REPO='ftp.jp.debian.org';;
910
+            28) DEBIAN_REPO='ftp.kr.debian.org';;
911
+            29) DEBIAN_REPO='ftp.lt.debian.org';;
912
+            30) DEBIAN_REPO='ftp.mx.debian.org';;
913
+            31) DEBIAN_REPO='ftp.nl.debian.org';;
914
+            32) DEBIAN_REPO='ftp.nc.debian.org';;
915
+            33) DEBIAN_REPO='ftp.nz.debian.org';;
916
+            34) DEBIAN_REPO='ftp.no.debian.org';;
917
+            35) DEBIAN_REPO='ftp.pl.debian.org';;
918
+            36) DEBIAN_REPO='ftp.pt.debian.org';;
919
+            37) DEBIAN_REPO='ftp.ro.debian.org';;
920
+            38) DEBIAN_REPO='ftp.ru.debian.org';;
921
+            39) DEBIAN_REPO='ftp.sk.debian.org';;
922
+            40) DEBIAN_REPO='ftp.si.debian.org';;
923
+            41) DEBIAN_REPO='ftp.es.debian.org';;
924
+            42) DEBIAN_REPO='ftp.se.debian.org';;
925
+            43) DEBIAN_REPO='ftp.ch.debian.org';;
926
+            44) DEBIAN_REPO='ftp.tw.debian.org';;
927
+            45) DEBIAN_REPO='ftp.th.debian.org';;
928
+            46) DEBIAN_REPO='ftp.tr.debian.org';;
929
+            47) DEBIAN_REPO='ftp.ua.debian.org';;
930
+            48) DEBIAN_REPO='ftp.uk.debian.org';;
931
+            49) DEBIAN_REPO='ftp.us.debian.org';;
779 932
             255) exit 1;;
780 933
         esac
781 934
         save_configuration_file
935
+    else
936
+        DEBIAN_REPO='ftp.de.debian.org'
782 937
     fi
783 938
 
784
-    data=$(tempfile 2>/dev/null)
785
-    trap "rm -f $data" 0 1 2 5 15
786
-    if [[ $INSTALLING_ON_BBB != "yes" ]]; then
939
+    if [[ $MINIMAL_INSTALL == "no" ]]; then
940
+        data=$(tempfile 2>/dev/null)
941
+        trap "rm -f $data" 0 1 2 5 15
787 942
         dialog --backtitle $"Freedombone Configuration" \
788
-               --radiolist $"Type of Random Number Generator:" 10 40 2 \
789
-               1 Haveged on \
790
-               2 OneRNG off 2> $data
943
+               --radiolist $"Pick a domain name service (DNS):" 25 50 16 \
944
+               1 $"Digital Courage" on \
945
+               2 $"German Privacy Foundation 1" off \
946
+               3 $"German Privacy Foundation 2" off \
947
+               4 $"Chaos Computer Club" off \
948
+               5 $"ClaraNet" off \
949
+               6 $"OpenNIC 1" off \
950
+               7 $"OpenNIC 2" off \
951
+               8 $"OpenNIC 3" off \
952
+               9 $"OpenNIC 4" off \
953
+               10 $"OpenNIC 5" off \
954
+               11 $"OpenNIC 6" off \
955
+               12 $"OpenNIC 7" off \
956
+               13 $"PowerNS" off \
957
+               14 $"ValiDOM" off \
958
+               15 $"Freie Unzensierte" off \
959
+               16 $"Google" off 2> $data
791 960
         sel=$?
792 961
         case $sel in
793 962
             1) exit 1;;
794 963
             255) exit 1;;
795 964
         esac
796 965
         case $(cat $data) in
797
-            2) HWRNG_TYPE="onerng"
798
-               dialog --title $"OneRNG Device" \
799
-                      --msgbox $"Please ensure that the OneRNG device is disconnected. You can reconnect it later during the installation" 8 60
966
+            1) NAMESERVER1='85.214.73.63'
967
+               NAMESERVER2='213.73.91.35'
968
+               ;;
969
+            2) NAMESERVER1='87.118.100.175'
970
+               NAMESERVER2='94.75.228.29'
971
+               ;;
972
+            3) NAMESERVER1='85.25.251.254'
973
+               NAMESERVER2='2.141.58.13'
974
+               ;;
975
+            4) NAMESERVER1='213.73.91.35'
976
+               NAMESERVER2='85.214.73.63'
977
+               ;;
978
+            5) NAMESERVER1='212.82.225.7'
979
+               NAMESERVER2='212.82.226.212'
980
+               ;;
981
+            6) NAMESERVER1='58.6.115.42'
982
+               NAMESERVER2='58.6.115.43'
800 983
                ;;
984
+            7) NAMESERVER1='119.31.230.42'
985
+               NAMESERVER2='200.252.98.162'
986
+               ;;
987
+            8) NAMESERVER1='217.79.186.148'
988
+               NAMESERVER2='81.89.98.6'
989
+               ;;
990
+            9) NAMESERVER1='78.159.101.37'
991
+               NAMESERVER2='203.167.220.153'
992
+               ;;
993
+            10) NAMESERVER1='82.229.244.191'
994
+                NAMESERVER2='82.229.244.191'
995
+                ;;
996
+            11) NAMESERVER1='216.87.84.211'
997
+                NAMESERVER2='66.244.95.20'
998
+                ;;
999
+            12) NAMESERVER1='207.192.69.155'
1000
+                NAMESERVER2='72.14.189.120'
1001
+                ;;
1002
+            13) NAMESERVER1='194.145.226.26'
1003
+                NAMESERVER2='77.220.232.44'
1004
+                ;;
1005
+            14) NAMESERVER1='78.46.89.147'
1006
+                NAMESERVER2='88.198.75.145'
1007
+                ;;
1008
+            15) NAMESERVER1='85.25.149.144'
1009
+                NAMESERVER2='87.106.37.196'
1010
+                ;;
1011
+            16) NAMESERVER1='8.8.8.8'
1012
+                NAMESERVER2='4.4.4.4'
1013
+                ;;
801 1014
             255) exit 1;;
802 1015
         esac
1016
+        save_configuration_file
803 1017
     else
804
-        HWRNG_TYPE="beaglebone"
1018
+        # as defaults for a minimal install process these settings are debatable
1019
+        NAMESERVER1='85.214.73.63'
1020
+        NAMESERVER2='213.73.91.35'
805 1021
     fi
806
-    save_configuration_file
807
-
808
-    data=$(tempfile 2>/dev/null)
809
-    trap "rm -f $data" 0 1 2 5 15
810
-    dialog --backtitle $"Freedombone Configuration" \
811
-           --radiolist $"Where to download Debian packages from:" 25 45 49 \
812
-           1 $"Australia" off \
813
-           2 $"Austria" off \
814
-           3 $"Belarus" off \
815
-           4 $"Belgium" off \
816
-           5 $"Bosnia and Herzegovina" off \
817
-           6 $"Brazil" off \
818
-           7 $"Bulgaria" off \
819
-           8 $"Canada" off \
820
-           9 $"Chile" off \
821
-           10 $"China" off \
822
-           11 $"Croatia" off \
823
-           12 $"Czech Republic" off \
824
-           13 $"Denmark" off \
825
-           14 $"El Salvador" off \
826
-           15 $"Estonia" off \
827
-           16 $"Finland" off \
828
-           17 $"France 1" off \
829
-           18 $"France 2" off \
830
-           19 $"Germany 1" off \
831
-           20 $"Germany 2" off \
832
-           21 $"Greece" off \
833
-           22 $"Hungary" off \
834
-           23 $"Iceland" off \
835
-           24 $"Iran" off \
836
-           25 $"Ireland" off \
837
-           26 $"Italy" off \
838
-           27 $"Japan" off \
839
-           28 $"Korea" off \
840
-           29 $"Lithuania" off \
841
-           30 $"Mexico" off \
842
-           31 $"Netherlands" off \
843
-           32 $"New Caledonia" off \
844
-           33 $"New Zealand" off \
845
-           34 $"Norway" off \
846
-           35 $"Poland" off \
847
-           36 $"Portugal" off \
848
-           37 $"Romania" off \
849
-           38 $"Russia" off \
850
-           39 $"Slovakia" off \
851
-           40 $"Slovenia" off \
852
-           41 $"Spain" off \
853
-           42 $"Sweden" off \
854
-           43 $"Switzerland" off \
855
-           44 $"Taiwan" off \
856
-           45 $"Thailand" off \
857
-           46 $"Turkey" off \
858
-           47 $"Ukraine" off \
859
-           48 $"United Kingdom" off \
860
-           49 $"United States" on 2> $data
861
-    sel=$?
862
-    case $sel in
863
-        1) exit 1;;
864
-        255) exit 1;;
865
-    esac
866
-    case $(cat $data) in
867
-        1) DEBIAN_REPO='ftp.au.debian.org';;
868
-        2) DEBIAN_REPO='ftp.at.debian.org';;
869
-        3) DEBIAN_REPO='ftp.by.debian.org';;
870
-        4) DEBIAN_REPO='ftp.be.debian.org';;
871
-        5) DEBIAN_REPO='ftp.ba.debian.org';;
872
-        6) DEBIAN_REPO='ftp.br.debian.org';;
873
-        7) DEBIAN_REPO='ftp.bg.debian.org';;
874
-        8) DEBIAN_REPO='ftp.ca.debian.org';;
875
-        9) DEBIAN_REPO='ftp.cl.debian.org';;
876
-        10) DEBIAN_REPO='ftp.cn.debian.org';;
877
-        11) DEBIAN_REPO='ftp.hr.debian.org';;
878
-        12) DEBIAN_REPO='ftp.cz.debian.org';;
879
-        13) DEBIAN_REPO='ftp.dk.debian.org';;
880
-        14) DEBIAN_REPO='ftp.sv.debian.org';;
881
-        15) DEBIAN_REPO='ftp.ee.debian.org';;
882
-        16) DEBIAN_REPO='ftp.fi.debian.org';;
883
-        17) DEBIAN_REPO='ftp2.fr.debian.org';;
884
-        18) DEBIAN_REPO='ftp.fr.debian.org';;
885
-        19) DEBIAN_REPO='ftp2.de.debian.org';;
886
-        20) DEBIAN_REPO='ftp.de.debian.org';;
887
-        21) DEBIAN_REPO='ftp.gr.debian.org';;
888
-        22) DEBIAN_REPO='ftp.hu.debian.org';;
889
-        23) DEBIAN_REPO='ftp.is.debian.org';;
890
-        24) DEBIAN_REPO='ftp.ir.debian.org';;
891
-        25) DEBIAN_REPO='ftp.ie.debian.org';;
892
-        26) DEBIAN_REPO='ftp.it.debian.org';;
893
-        27) DEBIAN_REPO='ftp.jp.debian.org';;
894
-        28) DEBIAN_REPO='ftp.kr.debian.org';;
895
-        29) DEBIAN_REPO='ftp.lt.debian.org';;
896
-        30) DEBIAN_REPO='ftp.mx.debian.org';;
897
-        31) DEBIAN_REPO='ftp.nl.debian.org';;
898
-        32) DEBIAN_REPO='ftp.nc.debian.org';;
899
-        33) DEBIAN_REPO='ftp.nz.debian.org';;
900
-        34) DEBIAN_REPO='ftp.no.debian.org';;
901
-        35) DEBIAN_REPO='ftp.pl.debian.org';;
902
-        36) DEBIAN_REPO='ftp.pt.debian.org';;
903
-        37) DEBIAN_REPO='ftp.ro.debian.org';;
904
-        38) DEBIAN_REPO='ftp.ru.debian.org';;
905
-        39) DEBIAN_REPO='ftp.sk.debian.org';;
906
-        40) DEBIAN_REPO='ftp.si.debian.org';;
907
-        41) DEBIAN_REPO='ftp.es.debian.org';;
908
-        42) DEBIAN_REPO='ftp.se.debian.org';;
909
-        43) DEBIAN_REPO='ftp.ch.debian.org';;
910
-        44) DEBIAN_REPO='ftp.tw.debian.org';;
911
-        45) DEBIAN_REPO='ftp.th.debian.org';;
912
-        46) DEBIAN_REPO='ftp.tr.debian.org';;
913
-        47) DEBIAN_REPO='ftp.ua.debian.org';;
914
-        48) DEBIAN_REPO='ftp.uk.debian.org';;
915
-        49) DEBIAN_REPO='ftp.us.debian.org';;
916
-        255) exit 1;;
917
-    esac
918
-    save_configuration_file
919
-
920
-    data=$(tempfile 2>/dev/null)
921
-    trap "rm -f $data" 0 1 2 5 15
922
-    dialog --backtitle $"Freedombone Configuration" \
923
-           --radiolist $"Pick a domain name service (DNS):" 25 50 16 \
924
-           1 $"Digital Courage" on \
925
-           2 $"German Privacy Foundation 1" off \
926
-           3 $"German Privacy Foundation 2" off \
927
-           4 $"Chaos Computer Club" off \
928
-           5 $"ClaraNet" off \
929
-           6 $"OpenNIC 1" off \
930
-           7 $"OpenNIC 2" off \
931
-           8 $"OpenNIC 3" off \
932
-           9 $"OpenNIC 4" off \
933
-           10 $"OpenNIC 5" off \
934
-           11 $"OpenNIC 6" off \
935
-           12 $"OpenNIC 7" off \
936
-           13 $"PowerNS" off \
937
-           14 $"ValiDOM" off \
938
-           15 $"Freie Unzensierte" off \
939
-           16 $"Google" off 2> $data
940
-    sel=$?
941
-    case $sel in
942
-        1) exit 1;;
943
-        255) exit 1;;
944
-    esac
945
-    case $(cat $data) in
946
-        1) NAMESERVER1='85.214.73.63'
947
-           NAMESERVER2='213.73.91.35'
948
-           ;;
949
-        2) NAMESERVER1='87.118.100.175'
950
-           NAMESERVER2='94.75.228.29'
951
-           ;;
952
-        3) NAMESERVER1='85.25.251.254'
953
-           NAMESERVER2='2.141.58.13'
954
-           ;;
955
-        4) NAMESERVER1='213.73.91.35'
956
-           NAMESERVER2='85.214.73.63'
957
-           ;;
958
-        5) NAMESERVER1='212.82.225.7'
959
-           NAMESERVER2='212.82.226.212'
960
-           ;;
961
-        6) NAMESERVER1='58.6.115.42'
962
-           NAMESERVER2='58.6.115.43'
963
-           ;;
964
-        7) NAMESERVER1='119.31.230.42'
965
-           NAMESERVER2='200.252.98.162'
966
-           ;;
967
-        8) NAMESERVER1='217.79.186.148'
968
-           NAMESERVER2='81.89.98.6'
969
-           ;;
970
-        9) NAMESERVER1='78.159.101.37'
971
-           NAMESERVER2='203.167.220.153'
972
-           ;;
973
-        10) NAMESERVER1='82.229.244.191'
974
-            NAMESERVER2='82.229.244.191'
975
-            ;;
976
-        11) NAMESERVER1='216.87.84.211'
977
-            NAMESERVER2='66.244.95.20'
978
-            ;;
979
-        12) NAMESERVER1='207.192.69.155'
980
-            NAMESERVER2='72.14.189.120'
981
-            ;;
982
-        13) NAMESERVER1='194.145.226.26'
983
-            NAMESERVER2='77.220.232.44'
984
-            ;;
985
-        14) NAMESERVER1='78.46.89.147'
986
-            NAMESERVER2='88.198.75.145'
987
-            ;;
988
-        15) NAMESERVER1='85.25.149.144'
989
-            NAMESERVER2='87.106.37.196'
990
-            ;;
991
-        16) NAMESERVER1='8.8.8.8'
992
-            NAMESERVER2='4.4.4.4'
993
-            ;;
994
-        255) exit 1;;
995
-    esac
996
-    save_configuration_file
997 1022
 
998 1023
     if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
999 1024
 
@@ -1093,46 +1118,48 @@ function interactive_configuration {
1093 1118
         save_configuration_file
1094 1119
     fi
1095 1120
 
1096
-    SET_STATIC_IP="no"
1097
-    dialog --title $"Static local IP address" \
1098
-           --backtitle $"Freedombone Configuration" \
1099
-           --defaultno \
1100
-           --yesno $"\nDo you want to set a static local IP address for this system?\n\nFor example, 192.168.1.10" 10 60
1101
-    sel=$?
1102
-    case $sel in
1103
-        0) SET_STATIC_IP="yes";;
1104
-        255) exit 1;;
1105
-    esac
1121
+    if [[ $MINIMAL_INSTALL == "no" ]]; then
1122
+        SET_STATIC_IP="no"
1123
+        dialog --title $"Static local IP address" \
1124
+               --backtitle $"Freedombone Configuration" \
1125
+               --defaultno \
1126
+               --yesno $"\nDo you want to set a static local IP address for this system?\n\nFor example, 192.168.1.10" 10 60
1127
+        sel=$?
1128
+        case $sel in
1129
+            0) SET_STATIC_IP="yes";;
1130
+            255) exit 1;;
1131
+        esac
1106 1132
 
1107
-    if [[ $SET_STATIC_IP == "yes" ]]; then
1108
-        if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
1109
-            LOCAL_NETWORK_STATIC_IP_ADDRESS=$(grep 'LOCAL_NETWORK_STATIC_IP_ADDRESS' temp.cfg | awk -F '=' '{print $2}')
1133
+        if [[ $SET_STATIC_IP == "yes" ]]; then
1110 1134
             if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
1111
-                LOCAL_NETWORK_STATIC_IP_ADDRESS='192.168..'
1135
+                LOCAL_NETWORK_STATIC_IP_ADDRESS=$(grep 'LOCAL_NETWORK_STATIC_IP_ADDRESS' temp.cfg | awk -F '=' '{print $2}')
1136
+                if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
1137
+                    LOCAL_NETWORK_STATIC_IP_ADDRESS='192.168..'
1138
+                fi
1112 1139
             fi
1113
-        fi
1114
-        if [ ! $ROUTER_IP_ADDRESS ]; then
1115
-            ROUTER_IP_ADDRESS=$(grep 'ROUTER_IP_ADDRESS' temp.cfg | awk -F '=' '{print $2}')
1116 1140
             if [ ! $ROUTER_IP_ADDRESS ]; then
1117
-                ROUTER_IP_ADDRESS='192.168..'
1141
+                ROUTER_IP_ADDRESS=$(grep 'ROUTER_IP_ADDRESS' temp.cfg | awk -F '=' '{print $2}')
1142
+                if [ ! $ROUTER_IP_ADDRESS ]; then
1143
+                    ROUTER_IP_ADDRESS='192.168..'
1144
+                fi
1118 1145
             fi
1146
+            data=$(tempfile 2>/dev/null)
1147
+            trap "rm -f $data" 0 1 2 5 15
1148
+            dialog --backtitle $"Freedombone Configuration" \
1149
+                   --title $"Local Network Configuration" \
1150
+                   --form $"\nPlease enter the IP addresses:" 11 55 3 \
1151
+                   $"This system:" 1 1 "$LOCAL_NETWORK_STATIC_IP_ADDRESS" 1 16 16 15 \
1152
+                   $"Internet router:" 2 1 "$ROUTER_IP_ADDRESS" 2 16 16 15 \
1153
+                   2> $data
1154
+            sel=$?
1155
+            case $sel in
1156
+                1) exit 1;;
1157
+                255) exit 1;;
1158
+            esac
1159
+            LOCAL_NETWORK_STATIC_IP_ADDRESS=$(cat $data | sed -n 1p)
1160
+            ROUTER_IP_ADDRESS=$(cat $data | sed -n 2p)
1161
+            save_configuration_file
1119 1162
         fi
1120
-        data=$(tempfile 2>/dev/null)
1121
-        trap "rm -f $data" 0 1 2 5 15
1122
-        dialog --backtitle $"Freedombone Configuration" \
1123
-               --title $"Local Network Configuration" \
1124
-               --form $"\nPlease enter the IP addresses:" 11 55 3 \
1125
-               $"This system:" 1 1 "$LOCAL_NETWORK_STATIC_IP_ADDRESS" 1 16 16 15 \
1126
-               $"Internet router:" 2 1 "$ROUTER_IP_ADDRESS" 2 16 16 15 \
1127
-               2> $data
1128
-        sel=$?
1129
-        case $sel in
1130
-            1) exit 1;;
1131
-            255) exit 1;;
1132
-        esac
1133
-        LOCAL_NETWORK_STATIC_IP_ADDRESS=$(cat $data | sed -n 1p)
1134
-        ROUTER_IP_ADDRESS=$(cat $data | sed -n 2p)
1135
-        save_configuration_file
1136 1163
     fi
1137 1164
 
1138 1165
     if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
@@ -1453,7 +1480,7 @@ function interactive_configuration {
1453 1480
             trap "rm -f $data" 0 1 2 5 15
1454 1481
             if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
1455 1482
                 dialog --backtitle $"Freedombone Configuration" \
1456
-                       --title $"Default Domain" \
1483
+                       --title $"Your main domain name" \
1457 1484
                        --form $"\nWhich domain name should your email/XMPP/IRC/VoIP be associated with?" 11 55 3 \
1458 1485
                        $"Domain:" 1 1 "$(grep 'DEFAULT_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \
1459 1486
                        $"Code:" 2 1 "$(grep 'DEFAULT_DOMAIN_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 16 25 30 \

+ 10
- 2
src/freedombone-image 查看文件

@@ -76,6 +76,9 @@ INTERACTIVE="no"
76 76
 # Whether this is a generic image for mass redistribution on the interwebs
77 77
 GENERIC_IMAGE="no"
78 78
 
79
+# Whether to reduce the number of decisions during interactive install
80
+MINIMAL_INSTALL="yes"
81
+
79 82
 while [[ $# > 1 ]]
80 83
 do
81 84
 key="$1"
@@ -145,6 +148,10 @@ case $key in
145 148
     shift
146 149
     GENERIC_IMAGE="$1"
147 150
     ;;
151
+    --minimal)
152
+    shift
153
+    MINIMAL_INSTALL="$1"
154
+    ;;
148 155
     *)
149 156
     # unknown option
150 157
     ;;
@@ -153,7 +160,7 @@ shift
153 160
 done
154 161
 
155 162
 if [[ $INTERACTIVE == "yes" || $INTERACTIVE == "y" || $INTERACTIVE == "Yes" ]]; then
156
-    freedombone-config
163
+    freedombone-config --minimal "$MINIMAL_INSTALL"
157 164
     if [ -f freedombone.cfg ]; then
158 165
         CONFIG_FILENAME=freedombone.cfg
159 166
         DEFAULT_DOMAIN_NAME=$(cat $CONFIG_FILENAME | grep 'DEFAULT_DOMAIN_NAME' | awk -F '=' '{print $2}')
@@ -207,7 +214,8 @@ make $IMAGE_TYPE \
207 214
     CONFIG_FILENAME="$CONFIG_FILENAME" \
208 215
     IMAGE_SIZE="$IMAGE_SIZE" \
209 216
     SSH_PUBKEY="$SSH_PUBKEY" \
210
-    GENERIC_IMAGE="$GENERIC_IMAGE"
217
+    GENERIC_IMAGE="$GENERIC_IMAGE" \
218
+    MINIMAL_INSTALL="$MINIMAL_INSTALL"
211 219
 
212 220
 if [ ! "$?" = "0" ]; then
213 221
     echo $'Build failed'

+ 8
- 1
src/freedombone-image-customise 查看文件

@@ -34,6 +34,9 @@ PROJECT_NAME='freedombone'
34 34
 export TEXTDOMAIN=${PROJECT_NAME}-image-customise
35 35
 export TEXTDOMAINDIR="/usr/share/locale"
36 36
 
37
+# Whether to minimise the number of decisions during interactive install
38
+MINIMAL_INSTALL="yes"
39
+
37 40
 MY_USERNAME='debian'
38 41
 MY_PASSWORD='freedombone'
39 42
 
@@ -255,7 +258,11 @@ EOF
255 258
     echo -n "    echo \"${MY_USERNAME}:" >> $rootdir/root/.bashrc
256 259
     echo '$(printf `cat ~/login.txt`)"|chpasswd' >> $rootdir/root/.bashrc
257 260
 
258
-    echo '    freedombone menuconfig' >> $rootdir/root/.bashrc
261
+	if [[ $MINIMAL_INSTALL == "no" ]]; then
262
+		echo '    freedombone menuconfigfull' >> $rootdir/root/.bashrc
263
+	else
264
+		echo '    freedombone menuconfig' >> $rootdir/root/.bashrc
265
+	fi
259 266
     echo '    if [ "$?" = "0" ]; then' >> $rootdir/root/.bashrc
260 267
     echo '        if [ -f ~/freedombone-completed.txt ]; then' >> $rootdir/root/.bashrc
261 268
     # Remove the initial setup files

+ 2
- 0
src/freedombone-image-make 查看文件

@@ -51,6 +51,7 @@ export PROJECT_NAME
51 51
 export CONFIG_FILENAME
52 52
 export SSH_PUBKEY
53 53
 export GENERIC_IMAGE
54
+export MINIMAL_INSTALL
54 55
 
55 56
 # Locate vmdebootstrap program fetched in Makefile
56 57
 basedir=`pwd`
@@ -162,6 +163,7 @@ sudo sed -i "s|PROJECT_NAME=.*|PROJECT_NAME=${PROJECT_NAME}|g" $TEMP_CUSTOMISE
162 163
 sudo sed -i "s|CONFIG_FILENAME=.*|CONFIG_FILENAME=${CONFIG_FILENAME}|g" $TEMP_CUSTOMISE
163 164
 sudo sed -i "s|SSH_PUBKEY=.*|SSH_PUBKEY=${SSH_PUBKEY}|g" $TEMP_CUSTOMISE
164 165
 sudo sed -i "s|GENERIC_IMAGE=.*|GENERIC_IMAGE=${GENERIC_IMAGE}|g" $TEMP_CUSTOMISE
166
+sudo sed -i "s|MINIMAL_INSTALL=.*|MINIMAL_INSTALL=\"${MINIMAL_INSTALL}\"|g" $TEMP_CUSTOMISE
165 167
 
166 168
 echo $"starting $VMDEBOOTSTRAP"
167 169
 # Run vmdebootstrap script to create image