# You should always check the syntax with 'perl -cw auto_inst.cfg.pl' before testing
$o = {
       'partitions' => [
                         {
                           'mntpoint' => '/',
                           'size' => 479745,
                           'type' => 131,
                           'hd' => 'sda'
                         },
                         {
                           'mntpoint' => 'swap',
                           'size' => 479745,
                           'type' => 130,
                           'hd' => 'sda'
                         },
                         {
                           'mntpoint' => '/tmp',
                           'size' => 1140993,
                           'type' => 131,
                           'hd' => 'sda'
                         },
                         {
                           'mntpoint' => '/usr',
                           'size' => 1140993,
                           'type' => 131,
                           'ratio' => 1,
                           'hd' => 'sda'
                         },
                         {
                           'mntpoint' => '/var',
                           'size' => 907137,
                           'type' => 131,
                           'ratio' => 9,
                           'hd' => 'sda'
                         },
                         {
                           'mntpoint' => '/home',
                           'size' => 1084545,
                           'type' => 131,
                           'hd' => 'sda'
                         },
                         {
                           'mntpoint' => '/var/qmail',
                           'size' => 907137,
                           'type' => 131,
                           'ratio' => 9,
                           'hd' => 'sdb'
                         }
                       ],
       'superuser' => {
                        'name' => 'root',
                        'home' => '/root',
                        'gid' => '0',
                        'uid' => '0',
                        'realname' => 'root',
                        'shell' => '/bin/bash',
                        'pw' => ''
                      },
       'lang' => 'en_GB',
       'default_packages' => [
                               'xinetd',
                               'ucd-snmp',
                               'vim-enhanced',
                               'perl',
                               'netkit-base',
                               'file',
                               'ipchains',
                               'openssh-server',
                               'gmp',
                               'gdbm',
                               'numlock',
                               'MAKEDEV',
                               'openssh',
                               'openssl',
                               'kernel-secure',
                               'tcp_wrappers',
                               'ctags',
                               'python',
                               'vim-common',
                               'MySQL',
                               'MySQL-shared',
                               'MySQL-client'
                             ],
       'partitioning' => {
                           'clearall' => 1,
                           'eraseBadPartitions' => 0,
                           'auto_allocate' => 1
                         },
       'intf' => {
                   'eth0' => {
                               'BROADCAST' => '212.69.226.255',
                               'DEVICE' => 'eth0',
                               'NETMASK' => '255.255.255.0',
                               'isUp' => 1,
                               'IPADDR' => '212.69.226.40',
                               'BOOTPROTO' => 'static',
                               'ONBOOT' => 'yes',
                               'NETWORK' => '212.69.226.0'
                             }
				 },
       'users' => [
                    {
                      'name' => 'support',
                      'home' => '/home/support',
                      'uid' => 501,
                      'gid' => 501,
                      'realname' => 'Support',
                      'shell' => '/bin/bash',
                      'pw' => '',
                      'icon' => undef
                    }
                  ],
       'useSupermount' => 0,
       'netcnx' => {
                     'NET_DEVICE' => undef,
                     'NET_INTERFACE' => undef
                   },
       'printer' => {
                      'REMOTEHOST' => '',
                      'DBENTRY' => 'PostScript',
                      'DeviceURI' => 'parallel:/dev/lp0',
                      'complete' => 0,
                      'str_type' => undef,
                      'NUP' => 1,
                      'AUTOSENDEOF' => 1,
                      'State' => 'Idle',
                      'Location' => '',
                      'ASCII_TO_PS' => undef,
                      'REMOTEQUEUE' => '',
                      'configured' => {},
                      'SMBPASSWD' => '',
                      'TOPBOTMAR' => 18,
                      'SMBUSER' => '',
                      'mode' => undef,
                      'NCPUSER' => '',
                      'RTLFTMAR' => 18,
                      'SPOOLDIR' => '/var/spool/lpd/lp',
                      'CRLF' => undef,
                      'Accepting' => 'Yes',
                      'QUEUE' => 'lp',
                      'Info' => '',
                      'SMBHOST' => '',
                      'PAPERSIZE' => '',
                      'NCPPASSWD' => '',
                      'SMBHOSTIP' => '',
                      'NCPHOST' => '',
                      'SMBSHARE' => '',
                      'want' => 0,
                      'DEVICE' => '/dev/lp0',
                      'SMBWORKGROUP' => '',
                      'NCPQUEUE' => ''
                    },
       'authentication' => {
                             'shadow' => 1,
                             'md5' => 1,
                             'NIS' => undef
                           },
       'isUpgrade' => 0,
       'security' => '4',
       'timezone' => {
                       'UTC' => 1,
                       'timezone' => 'Europe/London'
                     },
       'mouse' => {
                    'MOUSETYPE' => 'ps/2',
                    'device' => 'psaux',
                    'WHEEL' => undef,
                    'XEMU3' => undef,
                    'FULLNAME' => undef,
                    'XMOUSETYPE' => 'PS/2',
                    'type' => 'PS/2',
                    'name' => 'Standard',
                    'nbuttons' => 2
                  },
       'autoSCSI' => 1,
       'mkbootdisk' => '',
       'wacom' => undef,
       'keyboard' => 'uk',
       'installClass' => 'server',
       'autoExitInstall' => 1,
       'netc' => {
                   'NETWORKING' => 'yes',
                   'minus_one' => 1,
                   'dnsServer' => '',
                   'NET_DEVICE' => undef,
                   'GATEWAYDEV' => 'eth0',
                   'FORWARD_IPV4' => 'false',
                   'DOMAINNAME' => 'legend.net.uk',
                   'HOSTNAME' => 'scanner1.mail.legend.net.uk',
                   'NET_INTERFACE' => 'eth0',
                   'GATEWAY' => '212.69.226.254',
                 },
       'postInstall' => <<'EOF',

################################
# Log the action in the log file
################################

exec > /root/postInstall.log

echo_log()
{
	/bin/echo $* 
	/bin/echo $* >> /root/postInstall.log
}
export -f echo_log

####################
# Prepare the system
####################

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin

##############
# Mount floppy
##############

#ls -al /mnt/floppy
#echo
#echo
#sleep 5

#echo "Mounting the floppy"
#/bin/sh /bin/mount -r -t msdos /dev/fd0H1440 /mnt/floppy

#ls -al /mnt/floppy
#sleep 5 

#echo
#echo "mnt/floppy"
#echo

#ls -al /mnt/floppy
#sleep 5


#########################
# Run installation script
#########################

echo_log "Running the legend configuration tools"

/bin/sh /mnt/floppy/postinstall/run

####################
# Unmount the floppy
####################

#echo "Umounting the floppy"
#/bin/umount /mnt/floppy

#Closedown
EOF
     };

# Temporary Mandrake fix for the vfat problem

use install_steps_auto_install;
package install_steps_auto_install;

log::l("Clever patching for Pixel ..");

my $f = \&exitInstall;
undef *exitInstall;
*exitInstall = sub {
	my ($o) = @_;
	$f->(@_);
	eval { modules::load("vfat") };
	fs::mount(devices::make('fd0'),"/mnt/mnt/floppy","vfat",1);
};

