Getting Started: Difference between revisions

buildX
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This guide tested under Windows XP, 7 SP1, 8.1 & 10 x86/x64, results may vary under other operating systems (if you will copy/paste source code at many times). For legacy version of the guide visit [https://rentry.co/build-win2k3 build-win2k3].
This guide tested under Windows XP, Server 2003, 7 SP1, 8.1 & 10 and 11 (all architectures). For version of the guide made by anons, visit [https://rentry.co/build-win2k3 build-win2k3]. Note that the guide provided by anons isn't supported in any way by OpenXP developers.


== Preparing for Build ==
== Preparing for Build ==
Disable any AV (and Windows Defender) before extracting and building, as both of those actions create a lot of new files, and AV scans for execution of them all - this also counts for any other tools that monitor files, such as voidtools' Everything, but they aren't impacting much as your antivirus does. Also disable User Account Control. This can be accomplished via Control Panel, or via Registry Key: navigate to <code>HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System</code> and set <code>EnableLUA</code> to <code>0</code>. Some versions may require restart after registry apply.


* Disable any AV (and Windows Defender) before extracting and building, as both of those actions create a lot of new files, and AV scans for execution of them all - this also counts for any other tools that monitor files, such as voidtools' Everything, but they aren't impacting much as your antivirus does.
After preparing your machine, extract source tree to a folder named <code>srv03rtm</code>, or <code>srvrtm</code> on the root of a drive, drive letter doesn't seem to matter (just don't use C:\ drive as that has some extra security). It is recommended to use <code>D:\srvrtm\</code> as the path to match RTM binaries.
* Also disable User Account Control. This can be accomplished via Control Panel, or via Registry Key: navigate to <code>HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System</code> and set <code>EnableLUA</code> to <code>0</code>. Some versions may require restart after registry apply.
* Extract source tree to a folder named <code>srv03rtm</code> on the root of a drive, drive letter doesn't seem to matter (just don't use C:\ drive as that has some extra security). It is recommended to use <code>D:\srv03rtm\</code> as the path to match RTM binaries.


=== For 2000/XP/2003 Users ===
=== For 2000/XP/2003 Users ===
Before initializing Razzle, it's mandatory to install .NET Framework 1.1, because without it Razzle will fail to initialize environment normally (despite that two versions of .NET 1.1 are included in <code>tools\x86</code>). The installer is included at <code>tools\prereq</code>.
Before initializing Razzle, you should update your build machine. If you're using Windows XP/Server 2003, and you haven't updated it yet with [https://legacyupdate.net Legacy Update], it's mandatory to install .NET Framework 1.1, because without it Razzle will fail to initialize environment normally (despite that two versions of .NET 1.1 are included in <code>tools\x86</code>). The installation files are included in <code>tools\prereq</code> folder.


=== Running environment ===
=== Running environment ===


* Run command-prompt as administrator (can usually be done by typing <code>cmd</code> into start menu, right click <code>Command Prompt</code> -> <code>Run as administrator</code>)
* Run command-prompt as administrator (can usually be done by typing <code>cmd</code> into start menu, or by right click <code>Command Prompt</code> -> <code>Run as administrator</code>)
* In the command-prompt, change to the source folder: <code>cd /d D:\srv03rtm</code>
* In the command-prompt, change to the source folder: <code>cd /d D:\srvrtm</code>
* Now start razzle: <code>tools\razzle.cmd free offline</code> for 32-bit clients, and <code>tools\razzle64.cmd free offline</code> for 64-bits. This initiates retail build of x86. The first time you run razzle inside that copy of the source code it'll need to initialize a few things, give it a few minutes, after a while a Notepad window will appear - make sure to close this for the initialization to continue.
* Now start razzle: <code>tools\razzle.cmd free offline</code> for 32-bit clients, and <code>tools\razzle64.cmd free offline</code> for 64-bits. This initiates retail build of x86. The first time you run razzle inside that copy of the source code it'll need to initialize a few things, give it a few minutes, after a while a Notepad window will appear - make sure to close this for the initialization to continue.
* '''Important for first time!''' Run the prebuild script, if you're initiating source code for first time: <code>tools\prebuild</code>. This scripts sets all read-only attributes for necessary stuff and makes 16-bit stuff workable for x64 environments.
* '''Important for first time!''' Run the prebuild script, if you're initiating source code for first time: <code>tools\prebuild</code>. This scripts sets all read-only attributes for necessary stuff and makes 16-bit stuff workable for x64 environments.
If you want to have official builds, append <code>official</code> argument. This argument is modified and removed <code>OfficialBuild</code> argument, which previously checked build machine for eligibility of building official builds. <code>official</code> argument sets necessary values for official build independently of your machine eligibility, because of it's moot behavior and requirement to be connected into legacy build servers.


=== Build ===
=== Build ===
Line 24: Line 24:
=== Post-build ===
=== Post-build ===


* Download the Missing Binaries pack, which contains missing binaries both for AMD64 and x86 builds.
* Download the Missing Binaries pack from OpenXP Download Center, which contains missing binaries both for AMD64 and x86 builds.
* From that 7z, extract the contents of the binaries folder for the build type you're building into your build trees binaries folder (eg. <code>D:\binaries.x86fre</code>, should have been created during the build), the 7z should contain files for all SKUs (uses pidgen.dll from Win2003 Enterprise, so your builds should accept Enterprise product keys), '''When asked during extraction to overwrite folders select <code>Yes</code>, but when asked to overwrite files, make sure to select <code>No</code>!'''
* Extract the contents of the binaries folder for the build type you're building into your build trees binaries folder (e.g. <code>D:\binaries.x86fre</code>, should have been created during the build), the 7z should contain files for all SKUs (uses <code>pidgen.dll</code> from Win2003 Enterprise, so your builds should accept Enterprise product keys), '''When asked during extraction to overwrite folders select <code>Yes</code>, but when asked to overwrite files, make sure to select <code>No</code>!'''
* Inside the razzle window run <code>tools\postbuild</code> (use <code>-sku:{sku}</code> if you want to process only specific one (no brackets!), expect <code>filechk</code> errors if you ignore this and didn't use missing.7z / missing.cmd with every sku). For first time you can use <code>tools\postbuild -full</code>, altrough it isn't necessary.
* Inside the razzle window run <code>tools\postbuild</code>. You can use <code>-sku:{sku}</code> if you want to process only specific one (no brackets!), expect <code>filechk</code> errors, if you haven't extracted missing binaries from <code>misbin.7z</code>. If you have a wish to do a full post-build, append <code>-full</code> argument


==== Issues ====
==== Issues ====


* Once postbuild has finished, assuming you used the <code>misbin.7z</code> file above and followed the guide properly, it should have hopefully succeeded without errors, and there shouldn't be any <code>binaries.x86fre\build_logs\postbuild.err</code> file!
* Once post-build has finished, assuming you used the <code>misbin.7z</code> file above and followed the guide properly, it should have hopefully succeeded without errors, and there shouldn't be any <code>binaries.x86fre\build_logs\postbuild.err</code> file!
* Otherwise take a look inside the <code>postbuild.err</code> - most messages in here are negligible, but if you see <code>filechk</code> errors associated with the edition you want to use, you may need to re-run <code>tools\missing.cmd</code>, or extract <code>misbin.7z</code> again.
* Otherwise take a look inside the <code>postbuild.err</code> - most messages in here are negligible, but if you see <code>filechk</code> errors associated with the edition you want to use, you may need to re-run <code>tools\missing.cmd</code>, or extract <code>misbin.7z</code> again.
* If <code>postbuild.err</code> contains messages like <code>(crypto.cmd) ERROR</code> or <code>(ntsign.cmd) ERROR</code> try re-importing the <code>tools\driver.pfx</code> key-file (double-click it, press Next through the prompts, password is empty), and make sure your system date is set to the current date.
* If <code>postbuild.err</code> contains messages like <code>(crypto.cmd) ERROR</code> or <code>(ntsign.cmd) ERROR</code> try re-importing the <code>tools\driver.pfx</code> key-file (double-click it, press Next through the prompts, password is empty), and make sure your system date is set to the current date.
Line 44: Line 44:


=== Creating ISO files ===
=== Creating ISO files ===
 
Execute <code>tools\oscdimg {sku} [destination-file (optional)]</code> where <code>{sku}</code> is one of:
* Execute <code>tools\oscdimg {sku} [destination-file (optional)]</code> where <code>{sku}</code> is one of:
* <code>srv</code> - Windows Server 2003 Standard Edition
** <code>srv</code> - Windows Server 2003 Standard Edition
* <code>sbs</code> - Windows Server 2003 Small Business Edition
** <code>sbs</code> - Windows Server 2003 Small Business Edition
* <code>ads</code> - Windows Server 2003 Enterprise Edition
** <code>ads</code> - Windows Server 2003 Enterprise Edition
* <code>dtc</code> - Windows Server 2003 Datacenter Edition
** <code>dtc</code> - Windows Server 2003 Datacenter Edition
* <code>bla</code> - Windows Server 2003 Web Edition
** <code>bla</code> - Windows Server 2003 Web Edition
* <code>per</code> - Windows XP Home Edition
** <code>per</code> - Windows XP Home Edition
* <code>pro</code> - Windows XP Professional
** <code>pro</code> - Windows XP Professional
* <code>winpe</code> - Windows Preinstallation Environment
** <code>winpe</code> - Windows Preinstallation Environment
ISO will be saved to <code>{build-drive}\{build-tag}_{sku}.iso</code>, unless <code>[destination-file]</code> is provided as a parameter.
* ISO will be saved to <code>{build-drive}\{build-tag}_{sku}.iso</code>, unless <code>[destination-file]</code> is provided as a parameter.


=== Troubleshooting ===
=== Troubleshooting ===
If you get any problems during the build hopefully your problem might be answered here, if it's not feel free to post in the thread.
If you get any problems during the build hopefully your problem might be answered in our Discord server, by lurking


====== Certificate Import Wizard: An internal error occurred... ======
====== Certificate Import Wizard: An internal error occurred... ======
Line 86: Line 85:
Kernel debugging can be enabled by editing the <code>C:\boot.ini</code> file in your installed build, and adding <code>/debug /debugport=COM1 /baudrate=115200</code> to the end of a config line.
Kernel debugging can be enabled by editing the <code>C:\boot.ini</code> file in your installed build, and adding <code>/debug /debugport=COM1 /baudrate=115200</code> to the end of a config line.


For example here's a boot.ini with two choices, one with debugging & one without, with this NTLDR will show an OS boot choice menu at startup:<blockquote>[boot loader]
For example here's a <code>boot.ini</code> with two choices, one with debugging & one without, with this NTLDR will show an OS boot choice menu at startup:<blockquote>[boot loader]


timeout=30
timeout=30
Line 174: Line 173:
Other options are not described here, see <code>razzle.cmd /?</code> for details.
Other options are not described here, see <code>razzle.cmd /?</code> for details.


=== 'OfficialBuild' parameter / BuildMachines.txt ===
=== Private builds ===
The <code>OfficialBuild</code> razzle parameter changes a few things in the build, which will make it match up closer to the retail builds, should be useful if you need to compare against retail for any reason.
To compile your very own private build along with a branch, open git administrator and <code>cd</code> to your source tree. There execute: <code>git init</code>, which initializes an empty <code>.git</code> folder. Without this it won't compile the built branch. Then execute: <code>git checkout -b {name_of_your_branch}</code>, don't forget to remove the brackets!. Download this modified [https://drive.google.com/file/d/12UAYflPRiMpuZO1IafaEbcMDHRiEnNsO/view?usp=sharing razzle script] which has been edited to allow the detection of a created branch.
 
=== Official builds ===
For a list of things affected by the OfficialBuild parameter see <nowiki>https://pastebin.com/VgVph3Xv</nowiki> & <nowiki>https://pastebin.com/gYzWGLM5</nowiki>, thanks to the anon that compiled them! (note that these aren't complete lists, and not all things mentioned here are guaranteed to take effect).
The <code>official</code> parameter sets global definitions for official builds, which will make it match up closer to the retail builds, should be useful if you need to compare against retail for any reason. In difference of <code>offline</code> and similar flags, all binaries in this mode are built in retail mode and won't contain any private information, as well as postbuild logging will be enabled.
 
'''However, using this parameter requires a file to be updated with info about your build machine first!'''
 
An easy way to update the file required is to run the following command inside a razzle window, at the root of the source tree:
 
<code>echo %COMPUTERNAME%,primary,%_BuildBranch%,%_BuildArch%,%_BuildType%,ntblus >> tools\BuildMachines.txt</code>
 
After that you can run <code>tools\verifybuildmachine</code> to make sure it was setup correctly, if there's any problem an error message will show, otherwise the command will return without any message.
 
With that in place you should now be able to use the <code>OfficialBuild</code> parameter next time you init razzle, eg. <code>tools\razzle.cmd free offline officialbuild</code>
 
Some small notes to be aware of:


* if you change build arch or build type (eg. to amd64, or to a checked build) you'll need to run the echo command again to add your machine for that build arch/type combination
In latest patch kit from OpenXP, the useless checks of build machines in <code>''BuildMachines.txt''</code> have been '''removed completely''', and instead, any machine which is considered as "verified" is able to construct official builds. Also, the <code>OfficialBuild</code> parameter have been shortened to simply <code>official</code>, in order to make things more consistent.
* if you see <code>Clearing OFFICIAL_BUILD_MACHINE variable</code> after initializing razzle, rerun the echo command and then close down/re-initalize razzle again, else the build won't properly count itself as official.


=== Building specific components ===
=== Building specific components ===