# v6.4 # Here are the finstall fuctions to translate. # # This is FAH ("Folding At Home") installation script. # To get to know more about FAH go to http://folding.stanford.edu. # # To run this script You should download finstall & finstall.uk and use command # 'chmod +x finstall finstall.uk; ./finstall.uk' or if the default shell is not # Bash, use 'chmod +x finstall finstall.uk; bash -c "./finstall.uk"'. # # Read ./finstall to get to know what it is all about. # # Constructed by Ivo Sarak. Translated by ........... # Send Your comments, help and suggestions to ivo at vendomar.ee. # echo_no_finstall(){ cat << EOF There is no 'finstall' script in '$PWD' directory. EOF } echo_too_old_finstall(){ cat << EOF 'finstall' is pre1.2! EOF } echo_finstall_is_not_suitable(){ cat << EOF 'finstall' and '$1' are incompatible. EOF } #Messages to display at installer startup: FAH_Install_Greetings(){ cat << EOF This is FAH ("Folding At Home") installation script (ver. $FAH_Install_Version). To get to know more about FAH, go to http://folding.stanford.edu. EOF } echo_warning_no_cpus(){ cat << EOF !WARNING! No /proc/cpuinfo file or sysctl utility! Can not detect the CPU count, assuming 'CPU_COUNT=1'. EOF } echo_warning_no_bash_shell_found(){ cat << EOF !WARNING! No Bash shell found! Using default 'bash' location. EOF } echo_warning_no_wget_or_curl(){ cat << EOF !WARNING! No wget or curl! Can not download FAH client nor any other file, forcing 'nofetch'. EOF } echo_warning_no_md5(){ cat << EOF !WARNING! No md5sum/md5! Can not verify MD5SUM of FAH client, forcing 'nomd5'. EOF } echo_warning_no_screen_utility(){ cat << EOF !WARNING! No screen! You can not use 'screen' utility, forcing 'noscreen'. EOF } echo_check_tools_begin(){ cat << EOF Testing the availability of external utils... EOF } echo_check_tools_end(){ cat << EOF ...done. Using flags: EOF } echo_creating(){ cat << EOF Creating $1... EOF } echo_created(){ cat << EOF ...$1 created. EOF } Show_WineNotes(){ cat << EOF ------------------------------------- Wine ------------------------------------ *To run FAH Win32 console client You need to have Wine installed. *You may get a lot of font error messages when starting FAH Win32 client under Wine, but eventually it should start up just fine. *You may need to change WINE configuration depending how You intend to use FAH: 1. Use as a service at bootup - You must set "GraphicsDriver" = "ttydrv" under [main] in ~/.wine/config file. With this change You will render all other WINE applications useless unless these are also console based as FAH. 2. Use it as a regular application under X11 - You must set "GraphicsDriver" = "x11drv" or You will be unable to configure the FAH. If You want FAH under WINE (X11 or console/service) and also other WINE applications working - just make dedicated user account for FAH and make all necessary changes to WINE configuration depending how You will run it. *It is not advisable to overwrite FAH Linux client files with the Win32 version of it, because the differences between the file formats will likely cause loss of all unfinished/unsent WUs. EOF } Show_OpenBSDNotes(){ cat << EOF ----------------------------------- OpenBSD ----------------------------------- *FAH Linux client and other 3rd-party FAH utils on OpenBSD will require installed and working Linux emulation: 1. Install /usr/ports/emulators/redhat/base from the 3.8 ports collection, or get the redhat_base-8.0p5 package from the OpenBSD FTP site (or a mirror). 2. Make sure Linux emulation is enabled in the kernel: sysctl -w kernel.emul.linux=1 echo 'sysctl -w kernel.emul.linux=1 # Enable running Linux binaries' >> /etc/sysctl.conf EOF } Show_FreeBSDNotes(){ cat << EOF ----------------------------------- FreeBSD ----------------------------------- *FAH Linux client and other 3rd-party FAH utils on FreeBSD will require installed and working Linux emulation: http://www.stanford.edu/group/pandegroup/folding/faq.html#run.FreeBSD EOF } Show_WineAttention(){ cat << EOF !!!ATTENTION!!!" WINE exceptions: 1. Even if the Wine is fully operational the FAH client may give You lots of font error messages. 2. If Wine should fail to run then try to fix it or use native FAH Linux client. 3. When running FAH Win32 Client under Wine keep in mind that each FAH client MUST have unique MachineID set in config - usage of "setid" is recommended. 4. If You get an error 'x11drv: Can't open display:', then You must change WINE configuration: Under the [wine] section of ~/.wine/config change "GraphicsDriver" = "x11drv" to "GraphicsDriver" = "ttydrv". Attention: Running "GraphicsDriver" set to "ttydrv" under X11 will disable keyboard support and as a result of it You can not configure the client. You have to use "x11drv" when configuring the FAH client under X11. EOF } WineNote(){ cat << EOF WINE specific note: If You want to use FAH Win32 Client under Wine as a system service or not under X11 then You may need to change the ~/.wine/config. Wine will ask for X11, but usually there isn't any around during system startup. Simple fix to this ('x11drv: Can't open display:') from http://forum.folding-community.org/viewtopic.php?p=43609#43609: Under the [wine] section of ~/.wine/config change "GraphicsDriver" = "x11drv" "GraphicsDriver" = "ttydrv" and off You go... Attention: Running "GraphicsDriver" set to "ttydrv" under X11 will disable keyboard support and as a result of it You can not configure the client. You have to use "x11drv" when configuring the FAH client under X11 - "ttydrv" will work under X11 enough to run the client, but not to configure it. EOF } MacOSXNote(){ cat << EOF MacOSX specific note: If You want to use FAH MacOSX Client as a system service then it is possible to use "crontab" as described earlier or set the "fah" StartupItems by making /Library/StartupItems/fah directory and copying $Fdir/fah and $Fdir/StartupParameters.plist into this directory. EOF } Show_SambaNotes(){ cat << EOF Note: Ask root user of this machine to run $Fdir/finstallSamba to configure and add $Fdir as share to /etc/samba/smb.conf. ------------------------------------ SAMBA ------------------------------------ EOF } Show_FinalNotes(){ cat << EOF You can start the FAH client(s) by running '$Fdir/folding start' or start ./FaH scripts directly inside CPU directories. Note: If You would like to set some FAH flags, take a look inside ./FaH and/or read the finstall documentation. There are couple of ways how to run FAH client(s) at system bootup as a service: a) You should copy $Fdir/folding to your system service directory (ie: /etc/init.d/ (*)) and then start it with '/etc/init.d/folding start'. Also, You may have to run 'chkconfig --add folding' (**). (*) Your distribution may not support this kind of service startup or you may have one of those cases (RedHat 8.0) where despite all efforts, FAH refuses to start up when it is registered to run as a service. To overcome this issue, add '/etc/init.d/folding start' to /etc/rc.d/rc.local or another startup script that your system or distribution uses (Mandrake - rc.boot, SuSe - boot.local, ...) You may also need to remove 'folding' from runnable services by disabling it (setup->System services) or by running 'chkconfig --del folding' if needed. (**) There is no 'chkconfig' on Debian, use 'update-rc.d folding defaults' to add 'folding' services and 'update-rc.d folding remove' to remove 'folding' services. Note: MacOSX does not have "/etc/init.d" service startup method, use Crontab or StartupItems to get the FAH client(s) going. b) Another way to start FAH as a service is to use "crontab": http://teammacosx.homeunix.com/forum/cgi-bin/ikonboard.pl?s=630986ed363be3092a8737a56af58b87;act=ST;f=10;t=173 Short "crontab" howto: Start "crontab -e", press "i", add "@reboot $Fdir/folding start >/dev/null" to the end of file, press [Esc] key, type ":x" and press [Enter]. EOF if [ "$wine" = "true" ]; then echo "" WineNote echo "" fi if [ "$macosx" = "true" ]; then echo "" MacOSXNote echo "" fi cat << EOF Note: Only root user can modify system services (normal users have crontab option). Let root user to run $Fdir/installService to install FAH to be runned as service at system startup. Note1: FAH client(s) will be started under user $USER's privileges. Note2: If you try to start FAH client(s) as different user, you will be prompted for user $USER's password. Constructed by Ivo Sarak. Send Your comments, help and suggestions to ivo at vendomar dot ee. You can get some additional information from http://ra.vendomar.ee/~ivo/FAHLinux.txt or locally: $Fdir/FAHLinux.txt Finstall at folding-community.org: http://forum.folding-community.org/viewtopic.php?t=2283 Finstall documentation (finstall/folding FAQ): http://ra.vendomar.ee/~ivo/finstallFAQ.txt or locally: $Fdir/finstallFAQ.txt EOF } AskForChoice(){ #Ask for y/n type choice. #Input: $Message #Output: $Answer ("true"="yes" or "false"="no") local answerOK answerOK="false" while [ "$answerOK" = "false" ] do echo -n "$Message" read Answer if [ "$tr_OK" = "true" ] ; then Answer=$(echo $(echo "$Answer" | tr A-Z a-z)) #echo $Answer fi if [ "$Answer" = "yes" -o "$Answer" = "y" -o "$Answer" = "no" -o "$Answer" = "n" ]; then answerOK="true" #true=yes and false=no: if [ "$Answer" = "yes" -o "$Answer" = "y" ]; then Answer="true" else Answer="false" fi fi done } echo_FAH_DIR_is_invalid(){ cat << EOF FAH CPU subdirectory name Dir is invalid! Dir is set to '$Dir', but name must not be empty or contain '/'. EOF } echo_setting_up_FAH(){ cat << EOF Setting up FAH client(s) for $1 processor(s). EOF } echo_directory_is_present(){ cat << EOF Directory $1 is present... EOF } echo_directory_is_not_present(){ cat << EOF Directory $1 is not present... EOF } echo_making_directory(){ cat << EOF Making $1... EOF } echo_can_not_make_directory(){ cat << EOF You do not have proper rights to create directory $1. Change FAH directory location (Fdir) or convince the root of this box to make this directory available for You. EOF } echo_installation_terminated_as_fah_is_already_running(){ cat << EOF Installation terminated as FAH is currently running from $2 Terminate FAH and run $1 again. EOF } echo_removing_file(){ cat << EOF Removing $1... EOF } echo_removed(){ cat << EOF ...removed. EOF } echo_skipping_downloading_of_FAH_client(){ cat << EOF Skipping downloading of the FAH client. EOF } echo_downloading_FAH(){ cat << EOF Downloading FAH client ($1): EOF } echo_there_is_no_wget_or_curl(){ cat << EOF There is no wget/curl available or these can not be used! EOF } echo_file_in_directory(){ cat << EOF $1 in $2: EOF } echo_documentation(){ cat << EOF ---Documentation--- Downloading finstall FAQ: EOF } echo_downloading_general_HOWTO(){ cat << EOF Downloading general FAH on Linux HOWTO: EOF } echo_skipping_md5sum(){ cat << EOF Skipping MD5SUM verification. EOF } echo_verify_md5sum(){ cat << EOF Please verify the $1 MD5SUM value. Note: You can get this value at $2 behind platform specific $1 binary download link in 'MD5-sum of download' column. MD5SUM value of downloaded $1: EOF } echo_no_md5sum_available(){ cat << EOF There is no md5sum/md5 available or it can not be used! EOF } echo_no_FAH_client_found(){ cat << EOF No FAH client ($1) found at $2! Revise the URL ($3$1), wget/curl presence or download $1 manually, place it to $2 and use 'nofetch' option. EOF } echo_ask_for_3rd_party_tools(){ cat << EOF ---3rd party FAH utilities--- Some 3rd party FAH utilities can be used by folding script: 1. Dick Howell's 'qd' and 'fpd' (http://linuxminded.xs4all.nl/?target=software-qd-tools.plc) EOF } echo_no_3rd_party_tool_can_be_fetched(){ cat << EOF *** No 3rd party tool can be fetched! *** EOF } echo_3rd_party_tool_qd(){ cat << EOF Dick Howell's 'Program to dump data from file' utility ($1): EOF } echo_3rd_party_tool_qd_data1(){ cat << EOF Dick Howell's 'Program to dump data from file' utility data file ($1): EOF } echo_3rd_party_tool_qd_data2(){ cat << EOF Larry Perry's 'Electron Microscope III' data file ($1): EOF } echo_3rd_party_tool_fpd(){ cat << EOF Dick Howell's 'Graphics display of FAH protein for Linux' ($1): EOF } echo_machineid_asking(){ cat << EOF FAH 4.00 will check the MachineID value and terminate itself if it does find another FAH client running with the same MachineID. To overcome this, You either must start the client(s) twice or install every client with unique MachineID value. EOF } error_too_many_FAH_clients(){ cat << EOF !!!ERROR!!!" You want to install too many FAH clients ($1)! You can not set MachineID value larger than 8 and as of it, You can not run more than 8 FAH clients per user. To overcome this: 1. If it is fresh install of FAH - make up to 8 CPU subdirectories of foldinghome by hand and run additional FAH clients as instructed in 2.A, 2.B; 2. If it is update of FAH - reduce the CPU directory count to 8 and A. when using Wine and Win32 FAH client - make another FAH user to run other FAH clients under there; B. when using native Linux FAH client - make another FAH user to run other FAH clients under there and run 'rm -ifdr /tmp/fah' before You start these; C. when using MacOSX - I suspect that 2.A should apply; EOF } echo_setup_FAH_clients(){ cat << EOF Setup of FAH client #$1: EOF } echo_file_is_present(){ cat << EOF File $1 is present... EOF } echo_removed_it(){ cat << EOF ...removed it. EOF } echo_file_is_not_present(){ cat << EOF File $1 is not present. EOF } echo_making_a_file_entry(){ cat << EOF Making a '$1' entry... EOF } echo_making_a_file(){ cat << EOF Making a '$1' file... EOF } echo_but_no_file_found_in_directory(){ cat << EOF ...but no '$1' found in $2! EOF } echo_removing_client_configuration(){ cat << EOF Removing current client configuration ($1/$2$3/client.cfg)... EOF } echo_done(){ cat << EOF ...done. EOF } echo_there_is_already_config_in_directory(){ cat << EOF There is already a client.cfg (client configuration) file in $1/$2$3/... EOF } echo_keeping_it(){ cat << EOF ...keeping it. EOF } echo_last_known_good_config(){ cat << EOF Last known 'good' copy of client.cfg is at directory of FAH client #$1. EOF } echo_trying_to_copy_previous_config(){ cat << EOF Trying to copy config from previous client... EOF } echo_copying_previous_config(){ cat << EOF ...copying $1/$2$3/client.cfg to $1/$2$4... EOF } echo_but_nothing_found(){ cat << EOF ...but nothing found! EOF } echo_skipping_running_of_FAH(){ cat << EOF Skipping running of the FAH client... EOF } echo_configuring_FAH_client_in_directory(){ cat << EOF Configuring FAH client in directory $1/$2$3: EOF } echo_freebsd_attention(){ cat << EOF ATTENTION: If the Linux emulation is not installed, You will get an error message: "ELF binary type "3" not known." "Abort trap ./FaH -configonly" In that case install Linux emulation and run this script again. EOF } echo_starting_FaH(){ cat << EOF Starting './FaH -configonly 2>/dev/null': EOF } echo_no_valid_config_file_found(){ cat << EOF ***!!! NO client.cfg FOUND !!!***************************************************** Before using ./folding script, You must run the FAH client and configure it! Example: cd $1/$2$3 ./FaH -configonly Or run $4 again, without 'norun' or 'auto' option. *********************************************************************************** EOF } #MACOS X specific files: echo_making_macosx_files(){ cat << EOF Making FAH service description files and installation scripts for MacOSX: EOF } echo_making_openbsd_files(){ cat << EOF Making FAH service installation script for OpenBSD: EOF } echo_making_gentoo_files(){ cat << EOF Making FAH service installation scripts for Gentoo Linux: EOF } echo_making_linux_files(){ cat << EOF Making FAH service installation scripts for Linux: EOF } echo_making_FAH_backup_script(){ cat << EOF Making FAH backup script: EOF } echo_FAH_client_installation_completed(){ cat << EOF FAH client installation completed! EOF } echo_samba(){ cat << EOF ------------------------------------ SAMBA ------------------------------------ EOF } echo_waiting_for_n_seconds(){ cat << EOF Waiting for $1 seconds... EOF } echo_no_directory_access(){ cat << EOF ...but it is not writable for You! Change FAH directory location (Fdir) or convince the root of this box to make this directory available for You. EOF } echo_invalid_argument(){ cat << EOF Invalid argument #$1: '$2' Usage: $3 {|DoNothing}|{nofetch|nomd5|norun|keepcfg|copycfg|no3rd|freebsd|wine|skip3rd|fcliA|fcliB|nodocs|get3rd|setid|keepid|auto|screen|noscreen|samba|macosx|linux|setcfg|openbsd|gentoo|smp}+ EOF } message_do_you_want_to_continue(){ Message="Do You want to continue with the install (y/n)?: " } message_do_you_want_to_read_faq(){ Message="Do You want to read finstall FAQ (y/n)?: " } message_is_this_correct_md5sum_value(){ Message="Is this the correct MD5SUM value of $Fclient (y/n)?: " } message_do_you_want_to_use_3rd_party_tools(){ Message="Do You want to use any of these 3rd party FAH utilities (y/n)?: " } message_do_you_want_automatic_machineid_changing(){ Message="Do You want to use automatic MachineID changing (y/n)?: " } message_do_you_want_to_reconfigure(){ Message="Do You want to reconfigure this FAH client (y/n)?: " } message_do_you_want_to_use_same_config(){ Message="Do You want to use it for this client and for all remaining configureless clients as well (y/n)?: " } message_do_you_want_to_reset_config(){ Message="Do You want to reset configurations of other remaining FAH clients (y/n)?: " } echo_dirs_option_over_ridden(){ cat << EOF NOTE: 'dirs $DirNum' is being over-ridden since previous CPU subdirectories were found! EOF }