#!/bin/bash # codename : viviane # Virtualized # Integrated # Verification of # Installer with # Automated # Networked # Eyeballs # # adapted from http://kashyapc.wordpress.com/2011/08/18/unattended-guest-install-with-a-local-kickstart/ #VERSION="cauldron" #DIRECTORY="/pub/linux/Mageia/distrib/$VERSION" VERSION="2010.2" DIRECTORY="/pub/linux/MandrivaLinux/official/$VERSION" SERVER="distrib-coffee.ipsl.jussieu.fr" TREE="http://$SERVER$DIRECTORY" function auto_install_test() { ARCH=$1 PACKAGE=$2 NAME=viviane_${ARCH}_${PACKAGE}_$(date +%Y_%m_%d) TMP_DIR=$(mktemp -d /tmp/viviane_XXXXX) chmod go+rx $TMP_DIR date >> /tmp/viviane.log echo "test of $NAME started" >> /tmp/viviane.log # based on http://www.zarb.org/~guillomovitch/installation_automatique.html # user that is created must be in dialout, to be able to send the message # to the host on ttyS0 ( since consolekit do not handle this so far ) cat > $TMP_DIR/auto_inst.cfg.pl < { 'ntp' => undef, 'timezone' => 'Europe/Paris', 'UTC' => 1 }, 'default_packages' => [ 'urpmi', 'basesystem', 'man-pages', 'info', 'curl', 'dhcp-client', 'iputils', 'autologin', '$PACKAGE', ], 'users' => [ { 'icon' => 'default', 'realname' => 'Myrddin Wyllt', 'uid' => undef, 'groups' => ['dialout'], 'name' => 'merlin', 'shell' => '/bin/bash', 'gid' => undef } ], 'locale' => { 'country' => 'us', 'lang' => 'en_US', 'langs' => { 'en_US' => 1 }, 'utf8' => 1 }, 'net' => { 'resolv' => { 'DOMAINNAME' => 'test', 'dnsServer' => '192.168.122.1', 'DOMAINNAME2' => undef, 'dnsServer2' => undef, 'DOMAINNAME3' => undef, 'dnsServer3' => undef }, 'network' => { 'NETWORKING' => 'yes', 'GATEWAY' => '192.168.122.1', 'FORWARD_IPV4' => 'false', 'HOSTNAME' => '$NAME.test', }, 'ethernet' => {}, 'ifcfg' => { 'eth0' => { 'BROADCAST' => '', 'isUp' => 1, 'BOOTPROTO' => 'dhcp', 'isPtp' => '', 'NETWORK' => '', 'HWADDR' => undef, 'DEVICE' => 'eth0', 'METRIC' => 10 } }, 'net_interface' => 'eth0', 'type' => 'ethernet', 'PROFILE' => 'default' }, 'authentication' => { 'shadow' => 1, 'blowfish' => 1 }, 'partitions' => [ { 'fs_type' => 'ext4', 'mntpoint' => '/', 'size' => 7700000 }, { 'fs_type' => 'swap', 'mntpoint' => 'swap', 'size' => 256000 }, ], 'partitioning' => { 'auto_allocate' => 1, 'clearall' => 1, 'eraseBadPartitions' => 1 }, 'superuser' => { 'password' => 'root', 'realname' => 'root', 'uid' => '0', 'shell' => '/bin/bash', 'home' => '/root', 'gid' => '0' }, 'security' => 1, 'interactiveSteps' => [ # 'doPartitionDisks', # 'formatPartitions' ], 'autoExitInstall' => 1, 'keyboard' => { 'GRP_TOGGLE' => '', 'KEYBOARD' => 'us' }, 'postInstall' => q( cat > /usr/local/bin/viviane_notify.sh <