Skip to content

Modifying Easy Build

Empyreal96 edited this page Feb 27, 2021 · 3 revisions

Modifying Easy-Build

Overall there won't be much to modify, unless you want to experiment and add new menus for options etc, but I will run through some things to remember when modifying the script:

Note: I will add to this slowly over time, for now it's quite short.

Drive D: will be used throughout as the example drive, code snippets will have added comments inlined

Any comments added will be PREFIXED with REM // before the commented text

easy-build-xinit.cmd

NOTE: - Keep in mind that you may run in to missing files if you use a different or smaller tree.

This file sets up the razzle build environment, ready for Easy-Build.

Using Easy-Build with a different Xbox tree

By default it looks for the Complex patches folder CPXXUPD in the D:\xbox\ folder. if you want to use Easy-Build with a different Xbox trunk, you can remove the check for Complex Patches:

The code below is the 'checks' performed at the start, code edits will be displayed below with notes on what's needed:

:eb-xbox-checks
REM SIMPLE IF STATEMENTS TO CHECK IF THE SOURCE AND CPXXUPD FOLDERS ARE SET-UP
REM
REM // This section just looks for folders and quits if not found. If you want to remove CPXXUPD
REM // then we have to take the code out and redirect it
REM //
REM // This is DEFAULT below..
echo Now running some checks..
echo.
if NOT exist "%~d0\xbox\private" echo Xbox Source not setup correctly&& pause&& exit
if NOT exist "%~d0\xbox\public" echo Xbox Source not setup correctly&& pause&& exit
REM //
REM // Below is the check for the update, This will be removed for different trees
REM //
if NOT exist "%~d0\xbox\CPXXUPD" echo Complex Updates not found in \xbox\CPXXUPD&& pause&& exit
if exist "%~d0\xbox\private" goto eb-xbox-checks2

:eb-xbox-checks2
REM //
REM // This bit will be removed if different tree used
REM //
if exist "%~d0\xbox\CPXXUPD" goto eb-xbox-init-check

:eb-xbox-init-check
REM
REM
REM ADD CHECK FOR ALREADY PATCHED SOURCE OR IF TO BE PATCHED
REM // When loading up, if the Developer Folder for your username cannot be found, it loads
REM // the patching of the code.. This is where different trees will need to redirect around this part.
REM //
if NOT exist "%~d0\xbox\PRIVATE\DEVELOPR\%username%\" (goto eb-setup-cpxxupd) else (goto eb-xbox-mainmenu-init)
REM
REM

:eb-setup-cpxxupd
REM //
REM // This is what inits the patching, it checks again as a 'safety' check to make sure it doesn't
REM // re-patch.. since this isn't needed with different tree users, this will be skipped
REM //
if exist "%ebntroot%\PRIVATE\DEVELOPR\%username%\" echo CPXXUPD already set up && goto xbox-dorazzle
echo.
echo Easy-Build detected the Complex Patches haven't been applied.
echo Applying 'CPXXUPD' now..
echo.
cd /d %~d0\xbox\CPXXUPD
goto ebcpxxupd

:eb-setup-profile
REM //
REM // This creates the Razzle profile for your User, this is where we will skip to.
REM //
echo.
echo Creating Razzle profile
cd /d %~d0\XBOX\PRIVATE\DEVELOPR\TEMPLATE\
goto xbox-initrazzle


As an example here is what it would look like for a different tree that is already patched/not using CPXXUPD:

:eb-xbox-checks
REM SIMPLE IF STATEMENTS TO CHECK IF THE SOURCE ARE SET-UP
REM
echo Now running some checks..
echo.
if NOT exist "%~d0\xbox\private" echo Xbox Source not setup correctly&& pause&& exit
if NOT exist "%~d0\xbox\public" echo Xbox Source not setup correctly&& pause&& exit
if exist "%~d0\xbox\private" goto eb-xbox-init-check

:eb-xbox-init-check
REM ADD CHECK FOR ALREADY CREATED USER
if NOT exist "%~d0\xbox\PRIVATE\DEVELOPR\%username%\" (goto eb-setup-profile) else (goto eb-xbox-mainmenu-init)

:eb-setup-profile
echo.
echo Creating Razzle profile
cd /d %~d0\XBOX\PRIVATE\DEVELOPR\TEMPLATE\
goto xbox-initrazzle

easybuild.cmd

If you would like to modify Easy-Build for your own experiments then excellent! Here's some things to note:

Adding Build Variables to Easy-Build's load-up

The switches supported currently are chk,free,xm3 and xm3p and they are used to tell the environment what variable to set, if you want to add switches that rely on variables set you can add them here like the example below:

@echo off
cls
rem Here we set some variables that are not set by Easy-build.cmd/razzle during load, so we just load them
set Easy-Build-Version=v0.2
set _BUILDVER=4400
set COMPUTERNAME=XBuilds
if /i "%NTDEBUG%" == "" set NTDEBUG=ntsdnodbg
if /i "%COMPLEX%" == "" set COMPLEX=1 
if /i "%FOCUS%" == "" set FOCUS=1
if /i "%_BINPLACE_SUBDIR%" == "" call setfre.cmd
if /i "%1" == "" call setfre.cmd
if /i "%1" == "free" call setfre.cmd
if /i "%1" == "chk" call setchk.cmd
if /i "%1" == "XM3" call setfre.cmd
if /i "%1" == "XM3P" call setfre.cmd
if /i "%1" == "XM3" set RETAILXM3=1
if /i "%1" == "XM3" set OFFICIAL_BUILD=1
if /i "%1" == "XM3P" set RETAILXM3P=1
if /i "%1" == "XM3P" set OFFICIAL_BUILD=1
if /i "%2" == "XM3" set RETAILXM3=1
if /i "%2" == "XM3" set OFFICIAL_BUILD=1
if /i "%2" == "XM3P" set RETAILXM3P=1
if /i "%2" == "XM3P" set OFFICIAL_BUILD=1
REM //
if /i "%3" == "cool" set COOL_DASH=1
REM //
REM // For this example I will use the "COOL_DASH" variable as a third option 
REM // afaik Cool Dash just enables some extras in the Dashboard that were used for testing
REM // have a look in `private\ui\*` directory for ideas on what it enables
REM //

With the COOL_DASH option set in code like above, we can now start easybuild like: easybuild free xm3 cool to enable the extra feature! You can do this for different variables, have a look here for Variables I know.

Modifying the Build to only build a single folder

i.e NTOS if you are using a Kernel Repack, which will be this example

If you are using a repack, or want to only build the NTOS folder in the Tree its easy to do! All that is required is to point to the folder of choice:

Below is the build section of easybuild.cmd

NOTE: %ebntroot% = %_NTBINDIR%

:cleanbuild
Title Easy-Build XBOX Build Environment - Clean Building
cls
REM //
REM // Below is the line where we choose what folder to build
REM //
cd /d %ebntroot%\private
REM //
build -bcDeFZP
pause
goto eb-xbox-mainmenu
:DirtyBuild
Title Easy-Build XBOX Build Environment - Rebuilding
cls
REM //
REM // Below is the line where we choose what folder to build
REM //
cd /d %ebntroot%\private
REM //
build -bDeFZP
pause
goto eb-xbox-mainmenu

I doubt I need to explain in full but just add the directory path in place of the current %ebntroot%\private for example

:cleanbuild
Title Easy-Build XBOX Build Environment - Clean Building
cls
REM //
cd /d %_NTBINDIR%\private\ntos
REM //
build -bcDeFZP
pause
goto eb-xbox-mainmenu

Now when you choose to build we will only build the folder of choice!

Modifying easybuild.cmd's BVTMonitor sections

Coming soon