My favorites | Sign in
Project Logo
          
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#cs ----------------------------------------------------------------------------

$Author$
$LastChangedDate$

Script Function:
Change sysprepped XP HAL

#ce ----------------------------------------------------------------------------

#include-once
;~ #include ".\7z.au3"

Func _hal_Swap($intNumCpus, $strImageHal, $strTarget = "C:")
;~ $sDetectedHal = StringUpper(RegRead("HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL\0000", "HardwareID"))
;~ $intNumCpus = EnvGet("NUMBER_OF_PROCESSORS")
;~ $strImageHal = "ACPIAPIC_MP"
;~ $sSysprepInf = "C:\sysprep\sysprep.inf"
;~ $sSpVersion = "2"
;~ $Z = "Z:"
;~ $sTgtDrive = "C:"
;~ $iDebug = 1
Local $strNewHal

If $intNumCpus = 1 Then
$strNewHal = $gStrDetectedHal & "_UP"
Else
$strNewHal = $gStrDetectedHal & "_MP"
EndIf
_log("I","Image HAL: " & $strImageHal)
_log("I","New HAL: " & $strNewHal)
;~ If $strNewHal = $strImageHal Then Exit

_log("D", "Detected HAL:" & @CRLF & $strNewHal)

Select
;~ Case $strNewHal = $strImageHal
;~ Exit
Case StringRight($strNewHal, 3) = "_UP"
;~ MsgBox(0,"HAL","_UP: " & $strNewHal & @CRLF)
_hal_UpHal($strNewHal, $strTarget)
Case StringRight($strNewHal, 3) = "_MP"
;~ MsgBox(0,"HAL","_MP: " & $strNewHal & @CRLF)
_hal_MpHal($strNewHal, $strTarget)
EndSelect

EndFunc ;==>_hal_Swap

#CS
Prepare for UPHal
#CE

Func _hal_UpHal($strHal, $strTarget)
Select
Case $strHal = "ACPIPIC_UP"
_7z_HalUnpack($strTarget, "halacpi.dll", "hal.dll")
_7z_HalUnpack($strTarget, "ntkrnlpa.exe")
_7z_HalUnpack($strTarget, "ntoskrnl.exe")
Case $strHal = "ACPIAPIC_UP"
_7z_HalUnpack($strTarget, "halaacpi.dll", "hal.dll")
_7z_HalUnpack($strTarget, "ntkrnlpa.exe")
_7z_HalUnpack($strTarget, "ntoskrnl.exe")
EndSelect
If Not $gBinTest Then
IniDelete($gStrSysprepInf, "Unattended", "UpdateHAL")
IniWrite($gStrSysprepInf, "Unattended", "UpdateUPHAL", $strHal & ",%WINDIR%\Inf\Hal.inf")
EndIf
EndFunc ;==>_hal_UpHal

#CS
Prepare for MPHal
#CE

Func _hal_MpHal($strHal, $strTarget)
Select
Case $strHal = "ACPIAPIC_MP"
_7z_HalUnpack($strTarget, "halmacpi.dll", "hal.dll")
_7z_HalUnpack($strTarget, "ntkrpamp.exe", "ntkrnlpa.exe")
_7z_HalUnpack($strTarget, "ntkrnlmp.exe", "ntoskrnl.exe")
EndSelect
If Not $gBinTest Then
IniDelete($gStrSysprepInf, "Unattended", "UpdateUPHAL")
IniWrite($gStrSysprepInf, "Unattended", "UpdateHAL", $strHal & ",%WINDIR%\Inf\Hal.inf")
EndIf
EndFunc ;==>_hal_MpHal
Show details Hide details

Change log

r13 by bjoern.kaiser on May 02, 2008   Diff
Removed a lot of debugging code
modified debugging to use _log("D","...")
instead of consolewrite
made sure the logfile gets written to the
system drive before the process ends
added workarounds for CPU driver problems
in /lib/workaround.au3
Go to: 
Project members, sign in to write a code review

Older revisions

r12 by bjoern.kaiser on Apr 30, 2008   Diff
Inject drivers of HDC and SCSIAdapter
class
Load the target registry to insert
DevicePath
r10 by bjoern.kaiser on Apr 16, 2008   Diff
Added keywords and a short description
of the function of the file to the
head of each file.
r8 by bjoern.kaiser on Apr 16, 2008   Diff
First check-in
All revisions of this file

File info

Size: 2529 bytes, 85 lines

File properties

svn:keywords
Author Date
Hosted by Google Code