Saturday, April 6, 2013

Tweak my runtime image Build [2/4]

Hi Folks,

In the previous post of that serie, we identified the batch files that could be use to modify the behaving of the make image steps. In this post we are going to add a time stamp information inside the WinCE registry.

The file that we have to modify is the PostFmergeReg.bat file as it is launched after the creation of the reginit.ini file and before its compression. The reginit.in file is the content of the registry as it will be inside the runtime image.
To simplify this development we are going to store that batch file in the FILES folder of the BSP : %_TARGETPLATROOT%\FILES (c:\WINCE700\Platform\<platform name>\FILES).

  • PostFmergeReg.bat content :
@echo off
REM
REM Add time stamp information to reginit.ini
REM

call %_TARGETPLATROOT%\FILES\RegTimeStamp.bat %_FLATRELEASEDIR%\reginit.ini

It calls the RegTimeStamp.bat, located in the BSP folder, with the path to the reginit.ini file in parameters.

  •  RegTimeStamp.bat content
@echo off

REM ---
if not exist %1 goto :EOF

echo ; ** Entries added by RegTimeStamp.bat > ~RegTimeStamp~.0
REM --- Add time stamp information in [HKEY_LOCAL_MACHINE\Ident] 
echo [HKEY_LOCAL_MACHINE\Ident] >> ~RegTimeStamp~.0

REM -- Time info
echo  "BuildTime"="%TIME%" >> ~RegTimeStamp~.0

REM -- Date info
echo  "BuildDate"="%DATE%" >> ~RegTimeStamp~.0

REM -- Computer info
echo  "BuildOn"="%COMPUTERNAME%" >> ~RegTimeStamp~.0

REM -- User info
echo  "BuildBy"="%USERNAME%" >> ~RegTimeStamp~.0

REM -- 
type ~RegTimeStamp~.0 >> %1
del ~RegTimeStamp~.0


After the execution of PostFmergeReg.bat the reginit.ini file is integrating the time stamp information, at the bottom of the file, and the make image process will continue its execution and generate the NK.bin with the information.

NK.bin, with Time Stamp


- Nicolas

No comments:

Post a Comment