On Tue, 18 Mar 2008 07:32:01 pm Nils Olav Fossum wrote:
> Tirsdag 18 mars 2008 08:11, skrev Admin:
> > On Tue, 18 Mar 2008 07:26:55 am Nils Olav Fossum wrote:
> > > Oki, here are the updated altdosemu patches against CVS as of
> > > 2008-03-17
> >
> > <snip>
> >
> > On the subject of the nt5x-install alternative - since we aren't running
> > dosemu in this case and thus don't require the 16bit installer - and
> > assuming the copy script has the logic required to copy the install files
> > for an x86_64 windows install,
>
> Yes, nt5x-install has some 64-bit logic :
> -----
> #copy files
> OS_media=`parse_ini_file /c/netinst/unattend.txt _meta OS_media`
> OS_DIR=`echo $OS_media | awk -F: '{print $2}' | sed 's/\\\/\\//g'`
> OS_DIR="/z$OS_DIR"
> if [ -d "$OS_DIR/amd64" ]
> then
>       ARCH=amd64
>       OS_INSTALL_DIR="$OS_DIR/amd64"
> else
>       ARCH=i386
>       OS_INSTALL_DIR="$OS_DIR/i386"
> fi
>
> copy_files "$OS_INSTALL_DIR/" "/c/\$win_nt\$.~ls/" 1 "Copy system"
> if [ "$ARCH" == "amd64" ]
> then
>       copy_files "$OS_DIR/i386/" "/c/\$win_nt\$.~ls/" 1 "Copy i386 system"
> fi
> -----
>
> however I have not tested it.
> I just left the bits inplace when I lifted the script from the
> unattended-gui project.
>
> > would is be possible to get
> > install/lib/Unattend/WinMedia.pm updated to detect the x86_64 media as a
> > valid installation option?
>
> I guess we just have to wait for someone using 64bit NT5.x Windows to post
> a patch.  ;-)
>
> The  nt5x-install script is quite readable, WinMedia.pm looks like it
> requires a bit more effort to get into..

WinMedia.pm patch to check for amd64 dirs and the logic fix required for the 
nt5x-install script attached

"Works for me"(tm)

I'm re-writing the nt5x-install script in perl and changing it to parse [i386|
amd64]/dosnet.inf to pick which files to copy to /c/$win_nt$.~bt (that part 
is done). Only copying the files that the windows installer wants (rather 
than then entire i386 or amd64 directory) means copying 9.2M rather than 
147M. Those directories still get copied in their entirety to /c/$win_nt$.~ls
I don't think it makes any difference beyond the initial copy time since 
windows probably deletes the entire ~bt folder after its done its bit.

Perl doesn't seem to have recursive directory copying functionality built-in. 
Is there a preference on whether to require another perl module 
(File::Copy::Recursive) or to have the script call out to 'cp'?

Other than that the final part to do is replicating the parse_ini_file and 
write_ini_entry portions of nt5x-install. Presumably this will use 
Unattend::IniFile

Admin
--- install/linuxaux/usr/bin/nt5x-install.orig	2008-03-27 16:12:03.000000000 +1030
+++ install/linuxaux/usr/bin/nt5x-install	2008-03-27 17:16:40.000000000 +1030
@@ -138,8 +138,8 @@
 then
 	copy_files "$OS_DIR/i386/" "/c/\$win_nt\$.~ls/" 1 "Copy i386 system"
 fi
-copy_files "/c/\$win_nt\$.~ls/i386/" "/c/\$win_nt\$.~bt/" 2 "Copy installation files."
-copy_files "/c/\$win_nt\$.~ls/i386/system32/" "/c/\$win_nt\$.~bt/system32/" 2 "Copy system32."
+copy_files "/c/\$win_nt\$.~ls/$ARCH/" "/c/\$win_nt\$.~bt/" 2 "Copy $ARCH installation files."
+copy_files "/c/\$win_nt\$.~ls/$ARCH/system32/" "/c/\$win_nt\$.~bt/system32/" 2 "Copy $ARCH system32."
 copy_files "$OS_DIR/i386/ntldr" "/c/" 3 "Copy ntldr."
 copy_files "$OS_DIR/i386/ntdetect.com" "/c/" 3 "Copy ntdetect.com."
 copy_files "$OS_DIR/i386/setupldr.bin" "/c/\$ldr\$" 3 "Copy setupldr.bin."
@@ -154,7 +154,7 @@
 copy_files "/c/netinst/unattend.txt" "/c/\$win_nt\$.~bt/winnt.sif" 3 "Copy winnt.sif."
 
 #move files/drivers to the right place.....
-message "Move driver direcory"
+message "Move driver directory"
 mv /c/\$win_nt\$.~ls/$ARCH/\$[Oo][eE][mM]\$/* /c/\$/  
 
 message "Syncing disk -aiaparanoia :-)"
--- install/lib/Unattend/WinMedia.pm.orig	2008-03-19 20:04:44.000000000 +1030
+++ install/lib/Unattend/WinMedia.pm	2008-03-28 15:22:44.000000000 +1030
@@ -30,9 +30,20 @@
 
     my Unattend::WinMedia $self = fields::new ($class);
 
-    my $txtsetup = $file_spec->catfile ($path, 'i386', 'txtsetup.sif');
-    my $setupp = $file_spec->catfile ($path, 'i386', 'setupp.ini');
-    my $prodspec = $file_spec->catfile ($path, 'i386', 'prodspec.ini');
+    my $txtsetup;
+    my $setupp;
+    my $prodspec;
+
+    if (-d &$dos_to_host ($file_spec->catfile( $path, 'amd64'))) {
+        $txtsetup = $file_spec->catfile ($path, 'amd64', 'txtsetup.sif');
+        $setupp = $file_spec->catfile ($path, 'amd64', 'setupp.ini');
+        $prodspec = $file_spec->catfile ($path, 'amd64', 'prodspec.ini');
+    }
+    else {
+        $txtsetup = $file_spec->catfile ($path, 'i386', 'txtsetup.sif');
+        $setupp = $file_spec->catfile ($path, 'i386', 'setupp.ini');
+        $prodspec = $file_spec->catfile ($path, 'i386', 'prodspec.ini');
+    }
     -f &$dos_to_host ($txtsetup) && -f &$dos_to_host($setupp)
         && -f &$dos_to_host ($prodspec)
         or return undef;
@@ -135,6 +146,8 @@
 
 my %pid_table =
     (
+     # Windows Server 2003, Standard x64 Edition
+     '76869270' => 'Volume',
      # Windows Server 2003
      '69763000' => 'Trial',
      '69753000' => 'Retail',
@@ -277,8 +290,13 @@
     my $verbose = shift;
     my $oem_system_dir = shift;
 
-    defined $oem_system_dir
-        or $oem_system_dir = $file_spec->catdir ($self->path (), 'i386', '$oem$', '$1');
+    if (not defined $oem_system_dir) {
+	if (-d &$dos_to_host ($file_spec->catfile($self->path (), 'amd64'))) {
+	    $oem_system_dir = $file_spec->catdir ($self->path (), 'amd64', '$oem$', '$1');
+	} else {
+	    $oem_system_dir = $file_spec->catdir ($self->path (), 'i386', '$oem$', '$1');
+	}
+    }
 
     $verbose
         and print "Looking for drivers under $oem_system_dir...\n";
@@ -296,7 +314,11 @@
 sub _textmode_dir ($) {
     my Unattend::WinMedia ($self) = @_;
     
-    return $file_spec->catdir ($self->path, 'i386', '$oem$','textmode');
+    if (-d &$dos_to_host ($file_spec->catfile( $self->path (), 'amd64'))) {
+      return $file_spec->catdir ($self->path, 'amd64', '$oem$','textmode');
+    } else {
+      return $file_spec->catdir ($self->path, 'i386', '$oem$','textmode');
+    }
 }
 
 # Return the names of drivers from the [scsi] section of txtsetup.oem.
@@ -387,7 +409,7 @@
     return @ret;
 }
 
-# Return the subdirectories of i386 which exist and hold language
+# Return the subdirectories of i386 or amd64 which exist and hold language
 # files.
 sub lang_dirs ($;$) {
     my Unattend::WinMedia ($self) = shift;
@@ -395,7 +417,12 @@
     my @ret;
     
     my $dir = 'lang';
-    my $full_path = $file_spec->catdir ($self->path (), 'i386', $dir);
+    my $full_path;
+    if (-d &$dos_to_host ($file_spec->catfile( $self->path (), 'amd64'))) {
+        $full_path = $file_spec->catdir ($self->path (), 'amd64', $dir);
+    } else {
+        $full_path = $file_spec->catdir ($self->path (), 'i386', $dir);
+    }
     $verbose
         and print "Looking for $full_path...\n";
 
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
unattended-devel mailing list
unattended-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unattended-devel

Reply via email to