Changes between Version 12 and Version 13 of doc/TorBOX/Dev/Build


Ignore:
Timestamp:
Sep 27, 2012, 11:38:03 PM (6 years ago)
Author:
proper
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • doc/TorBOX/Dev/Build

    v12 v13  
    1 {{{
    2 #!/bin/bash
    3 # Save as /home/user/TorBOX_source/Build
     1TorBOX has been renamed to Whonix.
    42
    5 # Version: TorBOX 0.2.1
     3This page has been moved. The History of this page might still be interesting.
    64
    7 # Copyright: proper
    8 #
    9 # License: GPL v3 or any later
    10 #
    11 # Any changes you pull changes into this source will be also licensed
    12 # under GPL v3 or any later. Additionally you grant proper the right to
    13 # re-license your work under a different license. If that is not acceptable,
    14 # you can either fork this source under GPL v3 or any later or contact proper.
    15 # Contact proper, if you require this source code under different license.
    16 
    17 set -x
    18 
    19 USERNAME="user"
    20 
    21 script_help() {
    22 echo \
    23 "
    24 # assumes a cloned source folder containing all the needed script:
    25 # ~/TorBOX_source/Build
    26 # ~/TorBOX_source/GetISO
    27 # ~/TorBOX_source/ModifyISO
    28 # ~/TorBOX_CreateVM
    29 # ~/TorBOX_Image
    30 # ~/TorBOX-Gateway
    31 # ~/TorBOX-Workstation
    32 # ~/torcheck
    33 
    34 # creates separate build folder
    35 # FLAGS:
    36 # -all (NOT YET IMPLEMENTED)
    37 # build both Virtual machines
    38 #
    39 # -tg
    40 # build TorBOX-Gateway VBox machine
    41 #
    42 # -tw
    43 # assumes TorBOX-Gateway is running because
    44 # downloads go already through TorBOX-Gateway.
    45 # build TorBOX-Workstation VBox machine
    46 #
    47 # -clean
    48 # deletes the whole content of the TorBOX_binary folder
    49 "
    50 }
    51 
    52 
    53 
    54 root_check() {
    55 ######################################################
    56 # Checking script environment
    57 ######################################################
    58 # Check if we are root
    59 if [ "$(id -u)" != "0" ]; then
    60      echo "ERROR: This must be run as root (sudo)!"
    61      exit 1
    62 else
    63      echo "INFO: Script running as root."
    64 fi
    65 }
    66 
    67 
    68 
    69 # If this file was created previously, delete it now.
    70 rm /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED
    71 
    72 
    73 
    74 ################################################################
    75 # tg                                                           #
    76 ################################################################
    77 if [ "$1" = "-tg" ]; then
    78       root_check
    79 
    80       $HOME/TorBOX_source/TorBOX_GetISO -download
    81       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    82 
    83       $HOME/TorBOX_source/TorBOX_ModifyISO -create
    84       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    85 
    86       $HOME/TorBOX_source/TorBOX_CreateVM -tg-pre
    87       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    88 
    89       $HOME/TorBOX_source/TorBOX_CreateVM -tg-install-os
    90       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    91 
    92       $HOME/TorBOX_source/TorBOX_CreateVM -tg-post
    93       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    94 
    95       $HOME/TorBOX_source/TorBOX_Image -tg-mount
    96       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    97 
    98       $HOME/TorBOX_source/TorBOX_Image -tg-copyinto
    99       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    100 
    101       $HOME/TorBOX_source/TorBOX_Image -tg-unmount
    102       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    103 
    104       $HOME/TorBOX_source/TorBOX_CreateVM -tg-install-script
    105       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    106 
    107       $HOME/TorBOX_source/TorBOX_CreateVM -tg-export
    108       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    109 
    110       echo "INFO: No errors."
    111       exit 0
    112 fi
    113 
    114 
    115 
    116 ################################################################
    117 # tw                                                           #
    118 ################################################################
    119 if [[ "$1" = "-tw" ]]; then
    120       root_check
    121 
    122       # Assumes TorBOX-Gateway has already been created, i.e.
    123       # operating system iso already downloaded.
    124 
    125       $HOME/TorBOX_source/TorBOX_CreateVM -tw-pre
    126       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    127 
    128       # Assumes TorBOX-Gateway is running, because downloads go already through TorBOX-Gateway.
    129 
    130       $HOME/TorBOX_source/TorBOX_CreateVM -tw-install-os
    131       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    132 
    133       $HOME/TorBOX_source/TorBOX_CreateVM -tw-post
    134       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    135 
    136       $HOME/TorBOX_source/TorBOX_Image -tw-mount
    137       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    138 
    139       $HOME/TorBOX_source/TorBOX_Image -tw-copyinto
    140       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    141 
    142       $HOME/TorBOX_source/TorBOX_Image -tw-unmount
    143       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    144 
    145       # Assumes TorBOX-Gateway is running, because downloads go already through TorBOX-Gateway.
    146 
    147       $HOME/TorBOX_source/TorBOX_CreateVM -tw-install-script
    148       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    149 
    150       $HOME/TorBOX_source/TorBOX_CreateVM -tw-export
    151       if [ -f /home/$USERNAME/TorBOX_binary/TORBOX_BUILD_FAILED ]; then echo "BUILD SCRIPT ERROR: Failed!"; exit 0; fi
    152 
    153 exit 0
    154 fi
    155 
    156 ################################################################
    157 # -all                                                         #
    158 ################################################################
    159 if [[ "$1" = "-all" ]]; then
    160 root_check
    161 
    162 
    163 
    164 exit 0
    165 fi
    166 
    167 
    168 
    169 ################################################################
    170 # -clean                                                       #
    171 ################################################################
    172 if [[ "$1" = "-all" ]]; then
    173 root_check
    174 
    175 TorBOX_GetISO -delete
    176 TorBOX_ModifyISO -delete
    177 TorBOX_Image -tg-unmount
    178 TorBOX_Image -tw-unmount
    179 TorBOX_CreateVM -tg-delete
    180 TorBOX_CreateVM -tw-delete
    181 
    182 echo "TorBOX_Build: Done."
    183 exit 0
    184 fi
    185 
    186 
    187 
    188 ################################################################
    189 # -help                                                        #
    190 ################################################################
    191 if [[ "$1" = "-help" ]]; then
    192 script_help
    193 exit 0
    194 fi
    195 
    196 
    197 
    198 ################################################################
    199 # no option chosen                                             #
    200 ################################################################
    201 if [[ "$1" = "" ]]; then
    202 echo "
    203 INFO: No option chosen.
    204 
    205 Please append -help to find out more.
    206 "
    207 exit 0
    208 fi
    209 }}}
     5http://sourceforge.net/projects/whonix/files/old-development-only/old-development-only.tar.gz/download