Hi all I have noticed an interesting problem.
I specifiy the following lines in unattend.csv:
"00065BF100FA","ComputerName","OOFDTAXA35"
"OOFDTAXA35","FullName","Our Servers"
"Our Severs","UnattendedFile","z:\site\unattend.txt"

which is the default unattended file,
The computername value is set to random, rather than OOFDTAXA35. Note that the value I specify is the default unattend file. The result is
the same if I specify a file of z:\site\model\E3020.txt.

You subject says there is a bug, yet your message doesn't point out or prove that there is a bug.

I am looked at the code for this:
config.pl
line's 222-237
---------------
# Lookup and read specific Unattended.txt files
my $media_obj = Unattend::WinMedia->new ($u->{'_meta'}->{'OS_media'});
my $os_name = $media_obj->name ();
foreach my $lookup ("$os_name",
                   $u->{'UserData'}->{'OrgName'},
                   $u->{'UserData'}->{'FullName'},
                   $u->{'UserData'}->{'ComputerName'},
                   $u->{'_meta'}->{'macaddr'}) {
   my $unattended_txt = CONFIG->lookup_value($lookup, 'UnattendedFile');
   next unless defined $unattended_txt;
   $unattended_txt =~ /^[a-z]:/i
       or $unattended_txt = "z:\\site\\" . $unattended_txt;
   $unattended_txt = dos_to_host ($unattended_txt);
   -e ($unattended_txt)
       and $u->read ($unattended_txt);
}
---------------
I am little fuzzy on what happens once we hit "next unless defined".

Please let me know how I can help test any solutions for this bug.

Again what bug. The "next unless defined" goes to the next value if there wasn't a defined value. This routine was designed to successviely apply unattenede files going from most generic down to most specific. There is no need to specify the lib/unattended.txt or site/unattended.txt as these have allready been applied. What this allows you to do is setup values in a set of unattended files. The last value applied is the the one that sticks.

Example
--------

lib/unattended.txt contains the following (plus more):

[GuiUnattended]
   TimeZone=35

[Components]
   iis_common=On
   iis_inetmgr=On
   iis_www=On

site/unattended.txt contains (plus more):

[Components]
   iis_common=Off
   iis_inetmgr=Off
   iis_www=Off

[_meta]
   os_media = "winxp"
   middle_scripts = "office2k.bat"

db entry ["Windows XP Professional","UnattendedFile","xp_conf.txt"] points to "z:\site\xp_conf.txt" and that contains:

[_meta]
   fdisk_lba = 1
   fdisk_cmds = "fdisk /clear 1;fdisk /pri:4000;fdisk /activate:1"
   edit_files = 0
   format_cmd = "format /y /z:seriously /q /u /a /v:Main c:"
   replace_mbr = 1
   middle_scripts = "officexp.bat"

db entry ["{the computer name}","UnattendedFile","comp_123.txt"] points to "z:\site\comp_123.txt" and that contains:

[GuiUnattended]
   TimeZone=10

[Components]
   iis_common=On
   iis_inetmgr=On
   iis_www=On

db entry ["{mac address}","UnattendedFile","00065BF100FA.txt"] points to "z:\site\00065BF100FA.txt" and that contains:

[_meta]
   fdisk_lba = 0
   fdisk_cmds = "some format commands to setup 2 partitions"
   edit_files = 1

Then you will get a merged unattended.txt file that is applied in the order above. Of course you could also throw in OrgName and FullName but I think you will get the idea. So the final unattended txt file that is merged would look like:

[GuiUnattended]
   TimeZone=10

[Components]
   iis_common=On
   iis_inetmgr=On
   iis_www=On

[_meta]
   os_media = "winxp"
   format_cmd = "format /y /z:seriously /q /u /a /v:Main c:"
   replace_mbr = 1
   middle_scripts = "officexp.bat"
   fdisk_lba = 0
   fdisk_cmds = "some format commands to setup 2 partitions"
   edit_files = 1

The Components were overwritten a few times but you end up with the most "specific" (detailed) one which says it is on. Also notice that in the site unattended file I set os_media to "winxp". I'm assuming that you have a z:\os\winxp that contains Windows XP and thus will set the os_name properly.

I'm sorry I didn't get around to describing in more detail how this works when I originally wrote it. I use it all the time and it works great. There is a small paragraph at the top that sorta describes this behavior:

# The following table shows what Lookup values are used for a
# given Property value.  The order shown is the order searched.
# The search ends when a valid entry is returned with the
# exception of UnattendedFile.  UnattendedFile will search and
# apply all files in order listed.  Default is sort of redundant
# for UnattendedFile as z:\site\unattend.txt is considered Default.

I hope this helps someone and also that someone will document this better on the site so that others may benefit.

Sorry for any confusion,

-Shad


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
unattended-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unattended-devel

Reply via email to