2013-07-04 08:05:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Copyright 2010-2013 Frank Liepold / 1&1 Internet AG
|
|
|
|
#
|
|
|
|
# Copying and distribution of this file, with or without modification,
|
|
|
|
# are permitted in any medium without royalty provided the copyright
|
|
|
|
# notice and this notice are preserved. This file is offered as-is,
|
|
|
|
# without any warranty.
|
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
## defaults for module install_mars
|
|
|
|
##
|
|
|
|
## installs the mars module on given hosts.
|
|
|
|
## root access without password request to each host is required.
|
2013-12-10 14:32:40 +00:00
|
|
|
## see also variable main_ssh_idfile_opt (default-main.conf)
|
2013-07-04 08:05:39 +00:00
|
|
|
|
2013-12-10 14:32:40 +00:00
|
|
|
## directory (in general = checkout_mars_src_directory) to copy
|
|
|
|
## userpace tools from
|
|
|
|
install_mars_src_directory=/home/fl/mars/mars-git-hub
|
2013-11-07 09:33:43 +00:00
|
|
|
|
|
|
|
## directory to copy contributed tools from
|
2013-12-10 14:32:40 +00:00
|
|
|
## (in general = checkout_mars_contrib_src_directory)
|
2013-11-07 09:33:43 +00:00
|
|
|
install_mars_contrib_src_directory="/home/fl/mars/mars-contrib"
|
|
|
|
|
2013-07-04 08:05:39 +00:00
|
|
|
## install_mars_method_list
|
|
|
|
##
|
|
|
|
## array containing provided methods to install mars on a given host.
|
|
|
|
##
|
|
|
|
## the variable install_mars_method contains the currently chosen method.
|
|
|
|
|
|
|
|
declare -A -g install_mars_method_list
|
|
|
|
|
|
|
|
install_mars_method_list["kernel_and_modules_via_sync_from_host_to_host"]=1
|
2013-11-07 09:33:43 +00:00
|
|
|
install_mars_method="kernel_and_modules_via_sync_from_host_to_host"
|
2013-07-04 08:05:39 +00:00
|
|
|
|
|
|
|
## method kernel_and_modules_via_sync_from_host_to_host
|
|
|
|
##
|
2013-12-10 14:32:40 +00:00
|
|
|
## installs kernel and mars module from your work station on the target hosts
|
2013-07-04 08:05:39 +00:00
|
|
|
##
|
|
|
|
## it is assumed that the kernel and the corresponding moduls could be
|
|
|
|
## identified on the source host by a string (e.g. 3.2.41-generic). This
|
|
|
|
## string is saved in the variable install_mars_kernel_release
|
|
|
|
## it will be checked that there are the following files and directories:
|
|
|
|
##
|
|
|
|
## /boot/vmlinuz-<kernel name>
|
|
|
|
## /boot/System.map-<kernel name>
|
|
|
|
## /boot/config-<kernel name>
|
|
|
|
## /boot/initrd.img-<kernel name>
|
|
|
|
## /lib/modules/<kernel name>
|
|
|
|
##
|
2013-12-10 14:32:40 +00:00
|
|
|
## userspace tools are copied to directories
|
|
|
|
## install_mars_userspace_target_dir_list on every target host
|
2013-07-04 08:05:39 +00:00
|
|
|
|
2013-11-07 09:33:43 +00:00
|
|
|
install_mars_source_host="$(hostname)"
|
|
|
|
install_mars_kernel_release="3.2.47-grsec+"
|
2013-07-04 08:05:39 +00:00
|
|
|
# to get the complete filenames the string :kernel_release: is replaced by the
|
|
|
|
# value of install_mars_kernel_release in the following list
|
|
|
|
install_mars_files_to_sync_list=( /boot/vmlinuz-:kernel: \
|
|
|
|
/boot/System.map-:kernel: \
|
|
|
|
/boot/config-:kernel: \
|
|
|
|
/boot/initrd.img-:kernel: \
|
|
|
|
/lib/modules/:kernel: )
|
|
|
|
|
|
|
|
# each index in the following lists is the name of a file which must be copied
|
|
|
|
# to the specified directory on the target host
|
|
|
|
declare -g -A install_mars_userspace_target_dir_list
|
2013-11-07 09:33:43 +00:00
|
|
|
install_mars_userspace_target_dir_list=( \
|
|
|
|
["$install_mars_src_directory/userspace/marsadm"]="/usr/bin" \
|
|
|
|
["$install_mars_contrib_src_directory/bin/marsview"]="/usr/bin" \
|
|
|
|
["$install_mars_contrib_src_directory/lib/MARS/Resource.pm"]="/usr/share/perl5/MARS" \
|
|
|
|
["$install_mars_contrib_src_directory/lib/MARS.pm"]="/usr/share/perl5" \
|
|
|
|
)
|
2013-07-04 08:05:39 +00:00
|
|
|
|