Hello unattenders :-D The attached patch for install.pl adds these new functions for UNATTEND.TXT:
prefdisk_cmd - System command to run before fdisk I use this for blanking the MBR, but may have other uses prefdisk_cmd = "dd if=/dev/zero of=/dev/dsk bs=1024 count=1" postfdisk_cmd - System command to run after fdisk I use this to slap on an premade MBR and partition I have to switch off other functions to make this work, ie: postfdisk_cmd = "/z/site/sh/premade-partition-slapon.sh" fdisk_cmds="" replace_mbr = 0 format_cmd = "" The real fix here would be to allow "fdisk_cmds" to run any system command(s) and translate only the 'fdisk' ones, but my perl knowledge is not good enough to pull it off :-) predosemu_cmd - System command to run before dosemu alt_dosemu_cmd - Alternate System command to run in place of dosemu postdosemu_cmd - System command to run after dosemu Right now I plan to use postdosemu_cmd for fixing up mbr for Thinkpads and other troublesome machines with 240 heads. To get real use of the new functions I use site/config.pl (attached) to add/override settings going to the final UNATTEND.TXT. A example setting for a Dell Optiplex 745, dello754.txt is attached. I now get away with fewer questions on an typical windows installation, I just choose the machine type and then the software installation type. This also give me access to the 'top','middle' and 'bottom' settings for UNATTEND.TXT so I can add drivers for Thinkpads from 'bottom' as an example. The last part of /etc/master is attached. (as preinstallpl.sh) This adds the alternative dosemu cmds. Im doing this because I have a pile of laptops coming my way (Most likely in need for workarounds), and also because parted and dosemu always have given me trouble in the past. Now, please, questions, comments or whatever is very welcome :-) I will be happy to create ready-to-go patches go, but need some feedback. I dont want my unattended setup wandering too far away from the main. Nils.
config.pl
Description: Perl program
[_meta] fdisk_cmds = "fdisk /clear 1;fdisk /pri:12288;fdisk /pri:100,100 /spec:7;fdisk /delete /pri:1;fdisk /pri:4000;fdisk /activate:1" fdisk_confirm=0 edit_files=0 OS_media = Z:\os\winxpsp2 [Unattended] OemPnPDriversPath = "drv-dell\opti-745;drv-chip\wdm_178;drv-misc\kb888111"
preinstallpl.sh
Description: application/shellscript
--- install-cvs-2007-10-17.pl 2007-11-02 12:22:18.000000000 +0100 +++ install.pl 2007-11-02 13:32:16.000000000 +0100 @@ -982,11 +982,19 @@ $u->{'_meta'}->{'fdisk_cmds'} = \&ask_fdisk_cmds; +$u->comments ('_meta', 'prefdisk_cmd') = + ['System command to run before fdisk?']; +#$u->{'_meta'}->{'prefdisk_cmd'} = ''; + $u->comments ('_meta', 'fdisk_confirm') = ['Prompt for confirmation before running fdisk_cmds?']; $u->{'_meta'}->{'fdisk_confirm'} = 1; +$u->comments ('_meta', 'postfdisk_cmd') = + ['System command to run after fdisk?']; +#$u->{'_meta'}->{'postfdisk_cmd'} = ''; + $u->{'_meta'}->{'format_cmd'} = sub { return (yes_no_choice ('Format C: drive') @@ -994,6 +1002,22 @@ : undef); }; + +$u->comments ('_meta', 'predosemu_cmd') = + ['System command to run before dosemu? (linuxboot only)']; +#$u->{'_meta'}->{'predosemu_cmd'} = ''; + + +$u->comments ('_meta', 'alt_dosemu_cmd') = + ['Alternate System command to in place of dosemu? (linuxboot only)']; +#$u->{'_meta'}->{'alt_dosemu_cmd'} = ''; + + +$u->comments ('_meta', 'postdosemu_cmd') = + ['System command to run after dosemu? (linuxboot only)']; +#$u->{'_meta'}->{'postdosemu_cmd'} = ''; + + $u->{'_meta'}->{'ipaddr'} = sub { my $ret; @@ -1496,6 +1520,14 @@ } } +my $prefdisk_cmd = $u->{'_meta'}->{'prefdisk_cmd'}; +# Run system commands before fdisk, if any. +if (defined $prefdisk_cmd) { + print "* Running prefdisk_cmd ($prefdisk_cmd):\n"; + 0 == system $prefdisk_cmd + or die "* prefdisk_cmd ($prefdisk_cmd) exited non-zero"; +} + # Set environment variable controlling fdisk's use of INT13 extensions. $is_linux || ($u->{'_meta'}->{'fdisk_lba'}) or $ENV{'FFD_VERSION'}=6; @@ -1535,6 +1567,14 @@ : $cmd); } +my $postfdisk_cmd = $u->{'_meta'}->{'postfdisk_cmd'}; +# Run system commands after fdisk, if any. +if (defined $postfdisk_cmd) { + print "* Running postfdisk_cmd ($postfdisk_cmd):\n"; + 0 == system $postfdisk_cmd + or die "* postfdisk_cmd ($postfdisk_cmd) exited non-zero"; +} + if ($is_linux) { # On Linux, we (re-)create the device nodes after modifying the # partition table.
functions.sh
Description: application/shellscript
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________ unattended-devel mailing list unattended-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/unattended-devel