Client Management Suite

 View Only

Replacing the HAL using either WinPE 1.6 or 2.x 

Mar 19, 2009 12:05 PM

Problem:
WinPE 2.x does not detect the HAL in the same way as WinPE 1.6 did and therefore the HAL replacement in my scripts stopped working.
 
Resolution:
The following script will detect and copy the proper HAL whether you are using WinPE 1.6 or 2.x for automation. The techniques for detecting the HAL in the script is a modified version of what is described in “ALTIRIS® Deployment Solution™ 6.5 Hardware Independent Imaging v4” best practices document. The script will detect the HAL for both Intel and AMD and systems with multiple processor sockets. The script has been tested against both Lenovo and Dell systems from T41 to the newest desktop (M58p or OptiPlex 760). The script assumes that the image was created using the ACPIAPIC_MP HAL.
 
HAL detection and replacement script:
REM HAL Check
 
REM WinPE1.6
 
REM Check for 'Advanced Configuration and Power Interface (ACPI) PC' (acpipic_up)
REG QUERY HKLM\SYSTEM\ControlSet001\Enum\Root\ACPI_HAL\0000 /v HardwareId |Find /I /C "acpipic_up"
IF %ERRORLEVEL% EQU 0 GOTO acpipic_up
 
REM Check for 'ACPI Uniprocessor PC' (acpiapic_up)
REG QUERY HKLM\SYSTEM\ControlSet001\Enum\Root\ACPI_HAL\0000 /v HardwareId |Find /I /C "acpiapic_up"
IF %ERRORLEVEL% EQU 0 GOTO acpiapic_up
 
REM Check for 'ACPI Multiprocessor PC' (acpiapic_mp)
REG QUERY HKLM\SYSTEM\ControlSet001\Enum\Root\ACPI_HAL\0000 /v HardwareId |Find /I /C "acpiapic_mp"
IF %ERRORLEVEL% EQU 0 GOTO DEFAULT
 
REM WinPE2
 
REM Check for 'Advanced Configuration and Power Interface (ACPI) PC' (acpipic)
REG QUERY HKLM\SYSTEM\ControlSet001\Enum\Root\ACPI_HAL\0000 /v HardwareId |Find /I /C "acpipic"
IF %ERRORLEVEL% EQU 0 GOTO acpipic_up
 
REM Check for 'ACPI Uniprocessor or Multiprocessor PC' (acpiapic)
REG QUERY HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\1 /V VendorIdentifier | Find /I /C "GenuineIntel"
IF %ERRORLEVEL% EQU 0 GOTO DEFAULT
REG QUERY HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\1 /V VendorIdentifier | Find /I /C "AuthenticAMD"
IF %ERRORLEVEL% EQU 0 GOTO DEFAULT
REG QUERY HKLM\SYSTEM\ControlSet001\Enum\Root\ACPI_HAL\0000 /v HardwareId |Find /I /C "acpiapic"
IF %ERRORLEVEL% EQU 0 GOTO acpiapic_up
 
GOTO END
 
:acpipic_up
ECHO Copy files for 'Advanced Configuration and Power Interface (ACPI) PC'
.\Rdeploy\Windows\Firm copy .\ drivers\HAL\acpipic_up\HAL.dll prod:\Windows\System32\HAL.dll
.\Rdeploy\Windows\Firm copy .\ drivers\HAL\acpipic_up\ntkrnlpa.exe prod:\Windows\System32\ntkrnlpa.exe
.\Rdeploy\Windows\Firm copy .\drivers\HAL\acpipic_up\ntoskrnl.exe prod:\Windows\System32\ntoskrnl.exe
GOTO END
 
:acpiapic_up
ECHO Copy files for 'ACPI Uniprocessor PC'
.\Rdeploy\Windows\Firm copy .\drivers\HAL\acpiapic_up\HAL.dll prod:\Windows\System32\HAL.dll
.\Rdeploy\Windows\Firm copy .\drivers\HAL\acpiapic_up\ntkrnlpa.exe prod:\Windows\System32\ntkrnlpa.exe
.\Rdeploy\Windows\Firm copy .\drivers\HAL\acpiapic_up\ntoskrnl.exe prod:\Windows\System32\ntoskrnl.exe
GOTO END
 
:DEFAULT
ECHO HAL type did not match ACPIPIC_UP or ACPIAPIC_UP, using default (ACPIAPIC_MP)
 
GOTO END
 
:END

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Apr 08, 2009 09:45 AM

I was just wondering if you are doing Win XP sp3 and using SYSPREP? The only reason I ask is that when we switched from a SP2 build to the SP3 the SYSPREP for SP3 takes care of the HAL perfectly now, and we no longer had to replace the HAL any more, or do anything in the .ini to make sure the computer was getting the right one.
On a side note: when we where repolacing the HAL files, we had a script that copied the files when it copied the drivers down for the machine. we just had the our automation copy a whole folder that had a drivers folder and the Windows\System32 folder with the HAL files for that specific computer.

What you did was really great, thank you for posting

Related Entries and Links

No Related Resource entered.