Registered member login:
Register Now
Altirigos » Deployment Solution » Scripting/Tools/Docs » On-the-fly HAL Injection

» Current Poll
Do you leave the Aclient enabled?
YES - 82.31%
107 Votes
NO - 17.69%
23 Votes
Total Votes: 130
You may not vote on this poll.
» Stats
Members: 9,496
Threads: 11,750
Posts: 55,298
Top Poster: Nick (4,981)
Welcome our newest member, JessicaD
» Online Users: 52
0 members and 52 guests
No Members online
Most users online at once 294, 06-30-2007 at 12:24 PM.
» March 2010
S M T W T F S
28 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 123
Reply
Old 09-18-2007, 11:33 AM   #1 (permalink)
 
Status: Junior Altiris Admin
Join Date: 09-03-2007
Location: Raleigh, NC
Posts: 3


On-the-fly HAL Injection

At last week's Raleigh User Group meeting the question of how to inject HAL files was asked. We recently took the time to put together a script that automatically detects and loads the appropriate HAL files on-the-fly in WinPE as the second task after our multiprocessor image is distrbuted to the disk. It was somewhat difficult to find reference material when researching how to get something that would work so hopefully this will help others out there.

In our organization we only have three HAL types to worry about and since the image is a multiprocessor image the script only needs to inject files if an ACPI or ACPI Uniprocessor system is detected.

Essentially, the script works by querying the registry and comparing the workstation's HAL type to the HAL specified in the case statement, if the two match then the errorlevel variable gets a value of 0 and the scripts jumps to the bottom section and injects the files specified under the HAL type a match was found for. If a match was not found, the script continues to the next case statement and checks for a match there, and so on. In our case, if the system is not detected as being ACPI, or ACPI Uniprocessor, we're assuming the system is ACPI Multiprocessor in which case we leave the system as is.

Here's the script:
REM HAL Check

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

:acpipic_up
ECHO Copy files for 'Advanced Configuration and Power Interface (ACPI) PC'
RDeploy\Windows\Firm copy f:\drivers\HAL\acpipic_up\halacpi.dll prod:\Windows\System32\HAL.dll
RDeploy\Windows\Firm copy f:\drivers\HAL\acpipic_up\ntkrnlpa.exe prod:\Windows\System32\ntkrnlpa.exe
RDeploy\Windows\Firm copy f:\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 f:\drivers\HAL\acpiapic_up\halaacpi.dll prod:\Windows\System32\HAL.dll
RDeploy\Windows\Firm copy f:\drivers\HAL\acpiapic_up\ntkrnlpa.exe prod:\Windows\System32\ntkrnlpa.exe
RDeploy\Windows\Firm copy f:\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
JGM81 is offline   Reply With Quote
Old 09-18-2007, 11:38 AM   #2 (permalink)
 
Nick's Avatar
 
Status: Altiris Architect (Site Founder)
Join Date: 01-01-2005
Location: RDU, North Carolina, USA
Posts: 4,981


Stickied

Very nice!

__________________
Scire potentia est (knowledge is power)
Nick is offline   Reply With Quote
Old 09-18-2007, 12:40 PM   #3 (permalink)
 
Status: Super Altiris Admin
Join Date: 09-06-2006
Location: Columbus, OH
Age: 28
Posts: 296


Does anyone know of any Linux utilities that could be utilized under Linux automation for this?
dfrancis is offline   Reply With Quote
Old 12-10-2008, 01:03 PM   #4 (permalink)
 
Amador's Avatar
 
Status: Junior Altiris Admin
Join Date: 03-15-2005
Location: New Jersey
Age: 38
Posts: 25


Smile

The script is cool, but it does not work with WinPE 2.1(vista) since it uses a generic HAL driver. But it works well with WinPE 1.6(WinXP)
__________________
If you want to learn bring a notepad and a pen
AAC/ACI/ACP/ACE/MCSE2000/MCP
Amador is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -4. The time now is 01:39 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
vB.Sponsors
Altirigos