User:Oldman/A layman's guide/Altering files in an ISO

From ReactOS Wiki
Jump to: navigation, search

This guide will show you how to extract a file from an ISO image, remove the old file from the ISO, then alter it and insert the altered file back into the ISO, but the same procedure could also be used to alter or add other files than the one shown in the example.

In the following example, you will be shown how to alter the file txtsetup.sif, to make debug output display on the screen. This is needed when there is no other way to capture the debug information, in the first stage of installation of ReactOS.

Unix

ISO Master

This section covers the use of ISO Master, which is available in most Linux distros and may be already installed (there is also a commercial version for Windows).

1. Open the reactos ISO with ISO Master, with the File - Open menu.

ISO-Master-1.png
The contents of the user's home directory will be shown in the top pane and the contents of the ISO will be shown in the bottom pane.

2. Navigate into the /reactos/ directory in the bottom pane, find and select txtsetup.sif.

ISO-Master-2.png

3. Extract txtsetup.sif with the Extract button after highlighting it in the bottom pane. ISO Master will place the extracted file in your /home directory.

4. Then edit txtsetup.sif in a text editor and save.

When editing txtsetup.sif, look for [SetupData] as you scroll down in the editor. Then add a semi-colon to the front of the line DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE", shown in blue text below.

[SetupData]
DefaultPath = \ReactOS
OsLoadOptions = "/NOGUIBOOT /NODEBUG"
;DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"
;DbgOsLoadOptions = "/SOS /DEBUGPORT=SCREEN"
;DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=BOCHS"

Remove the semi-colon from the front of the line DbgOsLoadOptions = "/SOS /DEBUGPORT=SCREEN", shown in blue text below.

[SetupData]
DefaultPath = \ReactOS
OsLoadOptions = "/NOGUIBOOT /NODEBUG"
; DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"
DbgOsLoadOptions = "/SOS /DEBUGPORT=SCREEN"
;DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=BOCHS"

Explanation
When txtsetup.sif is parsed, if a line starts with a semi-colon, that line is ignored. So what you are doing by swapping the semi-colons, is to stop it sending debug info to the serial port and instead, send it to the screen.

Now having edited txtsetup.sif in your text editor, save it.

ISO-Master-3.png

5. Back in ISO Master, use the Remove button, to remove the original txtsetup.sif, but make sure that it is still highlighted in the bottom pane.

ISO-Master-4.png

6. Now use the Add button to add the altered txtsetup.sif back to the ISO.

ISO-Master-5.png

7. Save the ISO File with the File - Save As menu. You will need to use another name for the ISO, because ISO Master will not overwrite the original.

8. You can now burn the altered ISO to a disc and use it to boot with.

Windows

AnyBurn

You can get AnyBurn from http://www.anyburn.com/anyburn.zip. It is currently free for private and commercial use. There are 32 bit and 64 bit versions.

Anyburn-00.png

This is the main window. There are just 3 menus from the list that you will need to use:

  • Browse/Extract image file - to extract the file for editing.
  • Edit image file - to remove and add files.
  • Burn image file to disc.

Extract file for editing

Start by clicking on the Browse/Extract image file button. In the next window (not shown) you will have to select an ISO image file by clicking on the folder icon on the right and navigate to it, or type in the path to it. When you have selected the ISO image, click on the Next button at the bottom of the window.

Anyburn-01.png

Next you are presented with 2 windows (see above image); the uppermost window gives a warning to only select files and folders that you want to extract. Click OK and when it closes it will fully reveal the other window, where you need to navigate into the reactos folder and select the file txtsetup.sif and highlight it, then click the Next button at the bottom of the window.

Anyburn-02.png

In the next window, type the path and directory where the file should be extracted to, or use the folder icon on the right to navigate to the directory, then click the Next button at the bottom of the window, to extract the file.

Anyburn-03.png

When the extracting of the selected file from the ISO has completed, click on the Start page button to return to the main menu.

Before doing any more in AnyBurn, you need to open the extracted txtsetup.sif file in a text editor and edit it.

An alternative way to extract the file

If you have 7zip installed, right click on the ISO file, select 7zip, then Open and in the 7zip window, open the reactos folder and highlight the txtsetup.sif, then right click and select Edit or press F4. It should open in a text editor, where you should edit it and save it some where, to later add it into the ISO.

Editing the file

When editing txtsetup.sif, look for [SetupData] as you scroll down in the editor. Then add a semi-colon to the front of the line DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE", shown in blue text below.

[SetupData]
DefaultPath = \ReactOS
OsLoadOptions = "/NOGUIBOOT /NODEBUG"
;DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"
;DbgOsLoadOptions = "/SOS /DEBUGPORT=SCREEN"
;DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=BOCHS"

Then remove the semi-colon from the front of the line DbgOsLoadOptions = "/SOS /DEBUGPORT=SCREEN", shown in blue text below.

[SetupData]
DefaultPath = \ReactOS
OsLoadOptions = "/NOGUIBOOT /NODEBUG"
;DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"
DbgOsLoadOptions = "/SOS /DEBUGPORT=SCREEN"
;DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=BOCHS"


Explanation
When txtsetup.sif is parsed, if a line starts with a semi-colon, that line is ignored. So what you are doing by swapping the semi-colons, is to stop it sending debug info to the serial port and instead, send it to the screen.

Now having edited txtsetup.sif in your text editor, save it and go back to AnyBurn.

Prepare and create new ISO

This time select Edit image file in the main window.

Anyburn-2.png

Select the path to the ISO image file you want to work with, by clicking the folder icon and navigating to it or typing the full path and file name, then click on the Next button at the bottom of the widow.

Anyburn-3.png

You now need to navigate into the reactos folder and select the file txtsetup.sif, then use the Remove button, which deletes the file that you have highlighted.

Anyburn-4.png

Now click on the Add button and another window opens over the the first window (see image above). Navigate to the altered txtsetup.sif file, that you want to add into the ISO, select it and click the Add button in the upper window, which will add the file in.

Anyburn-5.png

Next click on the Properties button at the top of the window and another window will appear over the first (see image below).

Anyburn-5a.png

In this window, activate the General tab. Now check the tickbox Allow lower case in the section ISO9660 file name:. If this tickbox is left unticked, then when the ISO file is repacked, it will show all the files in uppercase and not preserve the files as they are in the original. Click OK and when the widow closes, click the Next button at the bottom of the window.

Anyburn-6.png

In this next window (see image above), type in a directory path and a new name for the altered ISO file or select it by using the folder icon, then click on the Create Now button. If you have not given the ISO file a new name, you will be given the choice to either over-write the existing file or not. If you choose No, you will have to click on the back button at the bottom of the next window to give the ISO file a different name.

Anyburn-7.png

Before you click on any of the buttons in the progress window (see image above), make sure the process has finished. You can then use the Start page button to return to the main menu.

Burn altered ISO

Now you can burn the ISO image file to a disc by selecting Burn image file to disc or click the Exit button, to use another ISO burning app.


Layman's guides

Return to How to get a debug log