Index: /trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/Makefile.kmk	(revision 93121)
+++ /trunk/src/VBox/Main/Makefile.kmk	(revision 93122)
@@ -38,4 +38,7 @@
  ifndef VBOX_ONLY_SDK
   include $(PATH_SUB_CURRENT)/src-helper-apps/OpenGLTest/Makefile.kmk
+ endif
+ if defined(VBOX_WITH_OPEN_WATCOM) && defined(VBOX_WITH_UNATTENDED)
+  include $(PATH_SUB_CURRENT)/src-helper-apps/os2/Makefile.kmk
  endif
 endif
Index: /trunk/src/VBox/Main/UnattendedTemplates/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/Makefile.kmk	(revision 93121)
+++ /trunk/src/VBox/Main/UnattendedTemplates/Makefile.kmk	(revision 93122)
@@ -46,4 +46,9 @@
  	win_postinstall.cmd
 
+ ifndef VBOX_WITH_OPEN_WATCOM
+  VBoxUnattendedTemplates_SOURCES = \
+  	os2_util.exe
+ endif
+
  ifndef VBOX_OSE
   VBoxUnattendedTemplates_SOURCES += \
Index: /trunk/src/VBox/Main/UnattendedTemplates/os2_cid_install.cmd
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/os2_cid_install.cmd	(revision 93121)
+++ /trunk/src/VBox/Main/UnattendedTemplates/os2_cid_install.cmd	(revision 93122)
@@ -1,3 +1,3 @@
-@ECHO ON
+@ECHO OFF
 REM $Id$
 REM REM @fileREM
@@ -17,39 +17,57 @@
 REM
 
-echo .
-echo Step 1 - Partition the disk.
-echo .
-s:
-cd s:\os2image\disk_6
+REM Check the phase argument and jump to the right section of the file.
+if "%1" == "PHASE1" goto phase1
+if "%1" == "PHASE2" goto phase2
+@echo ** error: invalid or missing parameter. Expected PHASE1 or PHASE2 as the first parameter to the script.
+pause
+cmd.exe
+exit /b 1
+
+REM
+REM Phase 1 - Base system installation.
+REM
+:phase1
+SET CDROM=S:
+
+@echo on
+@echo .
+@echo Step 1.1 - Partition the disk.
+@echo .
+cd %CDROM%\os2image\disk_6
+%CDROM%
 
 lvm.exe /NEWMBR:1 && goto lvm_newmbr_ok
-echo ** error: Writing a new MBR on disk 1 failed.
+@echo ** error: Writing a new MBR on disk 1 failed.
 goto lvm_failed
 :lvm_newmbr_ok
 
+@REM Depends the default drive name being "[ D1 ]".  However it's cosmetical,
+@REM so we don't complain if this fails.
 lvm.exe "/SETNAME:DRIVE,[ D1 ],BootDrive"
 
 lvm.exe /CREATE:PARTITION,OS2Boot,1,1024,PRIMARY,BOOTABLE && goto lvm_create_partition_ok
-echo ** error: Creating boot partition on disk 1 failed.
+@echo ** error: Creating boot partition on disk 1 failed.
 goto lvm_failed
 :lvm_create_partition_ok
 
 lvm.exe /CREATE:VOLUME,COMPATIBILITY,BOOTOS2,C:,OS2Boot,1,OS2Boot && goto lvm_create_volume_ok
-echo ** error: Creating boot volume on disk 1 failed.
+@echo ** error: Creating boot volume on disk 1 failed.
 goto lvm_failed
 :lvm_create_volume_ok
 
 lvm.exe /SETSTARTABLE:VOLUME,OS2Boot && goto lvm_set_startable_ok
-echo ** error: Setting boot volume on disk 1 startable failed.
+@echo ** error: Setting boot volume on disk 1 startable failed.
 goto lvm_failed
 :lvm_set_startable_ok
 
+@REM Depending on the freespace automatically getting the name "[ FS1 ]".
 lvm.exe "/CREATE:PARTITION,Data,1,LOGICAL,NotBootable,[ FS1 ]" && goto lvm_create_data_partition_ok
-echo ** error: Creating data partition on disk 1 failed.
+@echo ** error: Creating data partition on disk 1 failed.
 goto lvm_failed
 :lvm_create_data_partition_ok
 
 lvm.exe /CREATE:VOLUME,LVM,D:,Data,1,Data && goto lvm_create_data_volume_ok
-echo ** error: Creating data volume on disk 1 failed.
+@echo ** error: Creating data volume on disk 1 failed.
 goto lvm_failed
 :lvm_create_data_volume_ok
@@ -57,86 +75,93 @@
 REM pause
 lvm.exe /QUERY
-REM S:\OS2IMAGE\DISK_2\CMD.EXE
-goto done_step1
+REM CMD.EXE
+goto done_step1_1
 
 :lvm_failed
-echo .
-echo An LVM operation failed (see above).
-echo The process requires a blank disk with no partitions.  Starting LVM
-echo so you can manually correct this.
-echo .
-PAUSE
+@echo .
+@echo An LVM operation failed (see above).
+@echo The process requires a blank disk with no partitions.  Starting LVM
+@echo so you can manually correct this.
+@echo .
+pause
 lvm.exe
-s:\cid\exe\os2\setboot.exe /B
+%CDROM%\cid\exe\os2\setboot.exe /B
 exit
 
-:done_step1
-
-:step2
-echo .
-echo Step 2 - Format volumes.
-echo .
-cd s:\os2image\disk_3
-s:
-
-FORMAT C: /FS:HPFS /V:OS2Boot < S:\VBoxCID\YES.TXT && goto format_boot_ok
-echo ** error: Formatting C: failed.
-PAUSE
+:done_step1_1
+
+:step1_2
+@echo .
+@echo Step 1.2 - Format the volumes.
+@echo .
+cd %CDROM%\os2image\disk_3
+%CDROM%
+
+FORMAT.COM C: /FS:HPFS /V:OS2Boot < %CDROM%\VBoxCID\YES.TXT && goto format_boot_ok
+@echo ** error: Formatting C: failed.
+pause
 :format_boot_ok
 
-FORMAT D: /FS:JFS /V:Data < S:\VBoxCID\YES.TXT && goto format_data_ok
-echo ** error: Formatting D: failed.
-PAUSE
+FORMAT.COM D: /FS:JFS /V:Data < %CDROM%\VBoxCID\YES.TXT && goto format_data_ok
+@echo ** error: Formatting D: failed.
+pause
 :format_data_ok
 
-:step3
-echo .
-echo Step 3 - Putting response files and CID tools on C:
-echo .
+cd \
+
+:step1_3
+@echo .
+@echo Step 1.3 - Putting response files and CID tools on C:
+@echo .
 mkdir C:\VBoxCID
 mkdir C:\OS2
-copy S:\cid\exe\os2\*.*            C:\VBoxCID
-copy S:\cid\dll\os2\*.*            C:\VBoxCID
-copy S:\os2image\disk_2\inst32.dll C:\VBoxCID
-copy S:\VBoxCID\*.*                C:\VBoxCID && goto copy_ok
-echo ** error: Copying CID stuff from CDROM to C: failed.
-PAUSE
-:copy_ok
-
-:step4
-echo .
-echo Step 4 - Start OS/2 CID installation.
-echo .
+copy %CDROM%\cid\exe\os2\*.*            C:\VBoxCID
+copy %CDROM%\cid\dll\os2\*.*            C:\VBoxCID
+copy %CDROM%\os2image\disk_2\inst32.dll C:\VBoxCID
+copy %CDROM%\VBoxCID\*.*                C:\VBoxCID && goto copy_1_ok
+@echo ** error: Copying CID stuff from CDROM to C: failed (#1).
+pause
+:copy_1_ok
+copy %CDROM%\VBoxCID.CMD                C:\VBoxCID && goto copy_2_ok
+@echo ** error: Copying CID stuff from CDROM to C: failed (#2).
+pause
+:copy_2_ok
+
+:step1_4
+@echo .
+@echo Step 1.4 - Start OS/2 CID installation.
+@echo .
 SET REMOTE_INSTALL_STATE=CAS_WARP4
-C:
 cd C:\OS2
-C:\VBoxCID\SEMAINT.EXE /S:S:\os2image /B:C: /L1:C:\VBoxCID\Maint.log /T:C:\OS2
+C:
+C:\VBoxCID\OS2_UTIL.EXE -- C:\VBoxCID\SEMAINT.EXE /S:%CDROM%\os2image /B:C: /L1:C:\VBoxCID\1.4.1-Maint.log /T:C:\OS2
 REM does not exit with status 0 on success.
 goto semaint_ok
-PAUSE
+pause
 :semaint_ok
-REM S:\OS2IMAGE\DISK_2\CMD.EXE
+REM CMD.EXE
 
 cd C:\VBoxCID
-C:\VBoxCID\SEINST.EXE /S:S:\os2image /B:C: /L1:C:\VBoxCID\CIDInst.log /R:C:\VBoxCID\OS2.RSP /T:A:\
+C:
+C:\VBoxCID\OS2_UTIL.EXE -- C:\VBoxCID\SEINST.EXE /S:%CDROM%\os2image /B:C: /L1:C:\VBoxCID\1.4.2-CIDInst.log /R:C:\VBoxCID\OS2.RSP /T:A:\
 REM does not exit with status 0 on success.
 goto seinst_ok
-PAUSE
+pause
 :seinst_ok
-REM S:\OS2IMAGE\DISK_2\CMD.EXE
-
-:step5
-echo .
-echo Step 5 - Make C: bootable.
-echo .
+REM CMD.EXE
+
+:step1_5
+@echo .
+@echo Step 1.5 - Make C: bootable.
+@echo .
 C:
 cd C:\OS2
-SYSINSTX C: && goto sysinstx_ok
+SYSINSTX.COM C: && goto sysinstx_ok
 pause
 :sysinstx_ok
 
-echo Copying over patched OS2LDR from A:
+@echo Copying over patched OS2LDR from A:
 attrib -R -H -S C:\OS2LDR
-copy C:\OS2LDR C:\OS2LDR.ORG
+copy C:\OS2LDR C:\OS2LDR.Phase1
 del  C:\OS2LDR
 copy A:\OS2LDR C:\OS2LDR && goto copy_os2ldr_ok
@@ -145,16 +170,217 @@
 attrib +R +H +S C:\OS2LDR
 
-echo Copying over final startup.cmd
-if exist C:\STARTUP.CMD ren C:\STARTUP.CMD C:\STARTUP.ORG
-copy S:\VBoxCID\STARTUP.CMD C:\STARTUP.CMD
-
-echo Enabling Alt-F2 driver logging during boot.
-echo > "C:\ALTF2ON.$$$"
-
-:step6
-echo .
-echo Step 6 - Cleanup
-echo .
-cd C:\
+@REM This copy is for the end of phase 2 as someone replaces it.
+copy A:\OS2LDR C:\VBoxCID && goto copy_os2ldr_2_ok
+pause
+:copy_os2ldr_2_ok
+attrib +r C:\VBoxCID\OS2LDR
+
+@echo Enabling Alt-F2 driver logging during boot.
+@echo > "C:\ALTF2ON.$$$"
+
+@echo Install startup.cmd for phase2.
+@echo C:\VBoxCID\OS2_UTIL.EXE --tee-to-backdoor --tee-to-file C:\VBoxCID\Phase2.log --append -- C:\OS2\CMD.EXE /C C:\VBoxCID\VBoxCID.CMD PHASE2> C:\STARTUP.CMD && goto phase2_startup_ok
+pause
+:phase2_startup_ok
+
+REM now reboot.
+goto reboot
+
+
+REM
+REM Phase 2 - The rest of the installation running of the base install.
+REM
+:phase2
+SET CDROM=E:
+IF EXIST "%CDROM%\VBoxCID.CMD" goto phase2_found_cdrom
+SET CDROM=D:
+IF EXIST "%CDROM%\VBoxCID.CMD" goto phase2_found_cdrom
+SET CDROM=F:
+IF EXIST "%CDROM%\VBoxCID.CMD" goto phase2_found_cdrom
+SET CDROM=G:
+IF EXIST "%CDROM%\VBoxCID.CMD" goto phase2_found_cdrom
+SET CDROM=H:
+IF EXIST "%CDROM%\VBoxCID.CMD" goto phase2_found_cdrom
+SET CDROM=S:
+IF EXIST "%CDROM%\VBoxCID.CMD" goto phase2_found_cdrom
+@echo ** error: Unable to find the CDROM drive
+pause
+CMD
+SET CDROM=E:
+:phase2_found_cdrom
+cd C:\VBoxCID
+C:
+
+@echo on
+
+:step2_1
+@echo .
+@echo Step 2.1 - Install the video driver.
+@echo .
+C:\VBoxCID\OS2_UTIL.EXE -- C:\OS2\INSTALL\DspInstl.EXE /PD:C:\OS2\INSTALL\GENGRADD.DSC /S:%CDROM%\OS2IMAGE /T:C: /RES:1024X768X16777216 /U
+@REM does not exit with status 0 on success.
+goto dspinstl_ok
+pause
+:dspinstl_ok
+
+call VCfgCID.CMD /L1:C:\VBoxCID\2.1-Video.log /L2:C:\VBoxCID\2.1-Video-2.log /RES:1024X768X16777216
+@REM TODO: Error: 1 Error getting current desktop mode
+goto vcfgcid_ok
+pause
+:vcfgcid_ok
+cd C:\VBoxCID
+C:
+
+:step2_2
+@echo .
+@echo Step 2.2 - Install multimedia.
+@echo .
+cd C:\mmtemp
+C:
+DIR
+C:\VBoxCID\OS2_UTIL.EXE -- MInstall.EXE /M /R:C:\VBoxCID\MMOS2.RSP && goto mmos2_ok
+@REM TODO: crashes
+pause
+:mmos2_ok
+DIR
+cd C:\VBoxCID
+
+:step2_3
+@echo .
+@echo Step 2.3 - Install features.
+@echo .
+C:\VBoxCID\OS2_UTIL.EXE -- CLIFI.EXE /A:C /B:C: /S:%CDROM%\os2image\fi /R:C:\OS2\INSTALL\FIBASE.RSP /L1:C:\VBoxCID\2.2-FeatureInstaller.log /R2:C:\VBoxCID\OS2.RSP
+@REM does not exit with status 0 on success.
+goto features_ok
+pause
+:features_ok
+
+:step2_4
+@echo .
+@echo Step 2.4 - Install Netscape.
+@echo .
+CD C:\VBoxCID
+C:
+%CDROM%
+SET DPATH=%DPATH%;C:\NETSCAPE\SIUTIL;
+C:\VBoxCID\OS2_UTIL.EXE -- %CDROM%\CID\SERVER\NETSCAPE\INSTALL.EXE /X /A:I /TU:C: /C:%CDROM%\CID\SERVER\NETSCAPE\NS46.ICF /S:%CDROM%\CID\SERVER\NETSCAPE /R:C:\VBoxCID\Netscape.RSP /L1:C:\VBoxCID\2.8-Netscape.log /L2:C:\VBoxCID\2.8-Netscape-2.log && goto netscape_ok
+:netscape_ok
+CD %CDROM%\
+C:
+
+:step2_5
+@echo .
+@echo Step 2.5 - Install feature installer.
+@echo .
+@REM No /L2: support.
+@REM The /NN option is to make it not fail if netscape is missing.
+C:\VBoxCID\OS2_UTIL.EXE -- C:\OS2\INSTALL\WSFI\FiSetup.EXE /B:C: /S:C:\OS2\INSTALL\WSFI\FISETUP /NN /L1:C:\VBoxCID\2.5-FiSetup.log && goto fisetup_ok
+pause
+:fisetup_ok
+
+:step2_6
+@echo .
+@echo Step 2.6 - Install MPTS.
+@echo .
+@REM If we want to use non-standard drivers like the intel ones, copy the .NIF- and
+@REM .OS2-files to C:\IBMCOM\MACS before launching the installer (needs creating first).
+@REM Note! Does not accept /L2:.
+@REM Note! Omitting /TU:C in hope that it solves the lan install failure (no netbeui configured in mpts).
+CD %CDROM%\CID\SERVER\MPTS
+%CDROM%
+C:\VBoxCID\OS2_UTIL.EXE -- %CDROM%\CID\SERVER\MPTS\MPTS.EXE /R:C:\VBoxCID\MPTS.RSP /S:%CDROM%\CID\SERVER\MPTS /T:C: /L1:C:\VBoxCID\2.6-Mpts.log && goto mpts_ok
+pause
+:mpts_ok
+CD %CDROM%\
+C:
+
+:step2_7
+@echo .
+@echo Step 2.7 - Install TCP/IP.
+@echo .
+CD %CDROM%\CID\SERVER\TCPAPPS
+%CDROM%
+C:\VBoxCID\OS2_UTIL.EXE -- CLIFI.EXE /A:C /B:C: /S:%CDROM%\CID\SERVER\TCPAPPS\INSTALL /R:%CDROM%\CID\SERVER\TCPAPPS\INSTALL\TCPINST.RSP /L1:C:\VBoxCID\2.7-tcp.log /L2:C:\VBoxCID\2.7-tcp-2.log
+@REM does not exit with status 0 on success.
+goto tcp_ok
+pause
+:tcp_ok
+CD %CDROM%\
+C:
+
+CD %CDROM%\CID\SERVER\TCPAPPS\INSTALL
+%CDROM%
+C:\VBoxCID\OS2_UTIL.EXE -- %CDROM%\CID\SERVER\TCPAPPS\INSTALL\makecmd.exe C:\TCPIP en_US C:\MPTS && goto makecmd_ok
+pause
+:makecmd_ok
+cd %CDROM%\
+
+:step2_8
+@echo .
+@echo Step 2.8 - Install IBM LAN Requestor/Peer.
+@echo .
+SET REMOTE_INSTALL_STATE=CAS_OS/2 Peer
+CD %CDROM%\CID\SERVER\IBMLS
+%CDROM%
+C:\VBoxCID\OS2_UTIL.EXE -- %CDROM%\CID\SERVER\IBMLS\LANINSTR.EXE /REQ /R:C:\VBoxCID\IBMLan.rsp /L1:C:\VBoxCID\2.8-IBMLan.log /L2:C:\VBoxCID\2.8-IBMLan-2.log && goto ibmlan_ok
+:ibmlan_ok
+CD %CDROM%\
+C:
+
+:step2_9
+@echo .
+@echo Step 2.9 - Install guest additions.
+@echo .
+@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
+mkdir C:\VBoxAdd
+copy %CDROM%\VBoxAdditions\OS2\*.*  C:\VBoxAdd && goto ga_copy_ok
+pause
+:ga_copy_ok
+@echo TODO: Write script editing Config.sys for GAs
+@@VBOX_COND_ELSE@@
+@echo Not requested. Skipping.
+@@VBOX_COND_END@@
+
+:step2_10
+@echo .
+@echo Step 2.10 - Install the test execution service (TXS).
+@echo .
+@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@
+mkdir C:\ValKit
+mkdir D:\TestArea
+copy %CDROM%\VBoxValidationKit\*.* C:\VBoxValKit && goto valkit_copy_1_ok
+pause
+:valkit_copy_1_ok
+copy %CDROM%\VBoxValidationKit\os2\x86\*.* C:\VBoxValKit && goto valkit_copy_2_ok
+pause
+:valkit_copy_2_ok
+@@VBOX_COND_ELSE@@
+@echo Not requested. Skipping.
+@@VBOX_COND_END@@
+
+
+:step2_11
+@echo .
+@echo Step 2.11 - Install final startup.cmd and copy over OS2LDR again.
+@echo .
+attrib -r -h -s C:\STARTUP.CMD
+copy C:\VBoxCID\STARTUP.CMD C:\ && goto final_startup_ok
+pause
+:final_startup_ok
+
+attrib -r -h -s C:\OS2LDR
+if not exist C:\VBoxCID\OS2LDR pause
+if not exist C:\VBoxCID\OS2LDR goto final_os2ldr_ok
+copy C:\OS2LDR C:\OS2LDR.Phase2
+del  C:\OS2LDR
+copy C:\VBoxCID\OS2LDR C:\OS2LDR && goto final_os2ldr_ok
+pause
+:final_os2ldr_ok
+attrib +r +h +s C:\OS2LDR
+
+:step2_12
+@echo .
+@echo Step 2.12 - Cleanup
+@echo .
 del /N C:\*.bio
 del /N C:\*.i13
@@ -163,48 +389,20 @@
 mkdir C:\MMTEMP 2>nul
 del /N C:\MMTEMP\*.*
-for %%i in (acpadd2 azt16dd azt32dd csbsaud es1688dd es1788dd es1868dd es1888dd es688dd jazzdd mvprobdd mvprodd sb16d2 sbawed2 sbd2 sbp2d2 sbpd2) do del /N C:\MMTEMP\OS2\DRIVERS\%%i\*.*
-for %%i in (acpadd2 azt16dd azt32dd csbsaud es1688dd es1788dd es1868dd es1888dd es688dd jazzdd mvprobdd mvprodd sb16d2 sbawed2 sbd2 sbp2d2 sbpd2) do rmdir C:\MMTEMP\OS2\DRIVERS\%%i
-rmdir C:\MMTEMP\OS2\DRIVERS
-rmdir C:\MMTEMP\OS2
+@REM This is only needed if we don't install mmos2:
+@REM for %%i in (acpadd2 azt16dd azt32dd csbsaud es1688dd es1788dd es1868dd es1888dd es688dd jazzdd mvprobdd mvprodd sb16d2 sbawed2 sbd2 sbp2d2 sbpd2) do del /N C:\MMTEMP\OS2\DRIVERS\%%i\*.*
+@REM for %%i in (acpadd2 azt16dd azt32dd csbsaud es1688dd es1788dd es1868dd es1888dd es688dd jazzdd mvprobdd mvprodd sb16d2 sbawed2 sbd2 sbp2d2 sbpd2) do rmdir C:\MMTEMP\OS2\DRIVERS\%%i
+@REM rmdir C:\MMTEMP\OS2\DRIVERS
+@REM rmdir C:\MMTEMP\OS2
 rmdir C:\MMTEMP
-copy C:\CONFIG.SYS C:\VBoxCID && del /N C:\*.SYS
+copy C:\CONFIG.SYS C:\VBoxCID || goto skip_sys_cleanup
+del /N C:\*.SYS
 copy C:\VBoxCID\CONFIG.SYS C:\
-
-:step7
-echo .
-echo Step 7 - Install guest additions.
-echo .
-@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
-mkdir C:\VBoxAdd
-copy S:\VBoxAdditions\OS2\*.*  C:\VBoxAdd && goto ga_copy_ok
-pause
-:ga_copy_ok
-echo TODO: Write script editing Config.sys for GAs
-@@VBOX_COND_ELSE@@
-echo Not requested. Skipping.
-@@VBOX_COND_END@@
-
-:step8
-echo .
-echo Step 8 - Install the test execution service (TXS).
-echo .
-@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@
-mkdir C:\ValKit
-mkdir D:\TestArea
-copy S:\VBoxValidationKit\*.* C:\VBoxValKit && goto valkit_copy_1_ok
-pause
-:valkit_copy_1_ok
-copy S:\VBoxValidationKit\os2\x86\*.* C:\VBoxValKit && goto valkit_copy_2_ok
-pause
-:valkit_copy_2_ok
-@@VBOX_COND_ELSE@@
-echo Not requested. Skipping.
-@@VBOX_COND_END@@
-
-:step9
+:skip_sys_cleanup
+
+:step2_13
 @@VBOX_COND_HAS_POST_INSTALL_COMMAND@@
-echo .
-echo Step 9 - Custom actions: "@@VBOX_INSERT_POST_INSTALL_COMMAND@@"
-echo .
+@echo .
+@echo Step 2.13 - Custom actions: "@@VBOX_INSERT_POST_INSTALL_COMMAND@@"
+@echo .
 cd C:\VBoxCID
 C:
@@ -213,12 +411,19 @@
 
 
-:done
-echo .
-echo Finally Done.  Now we reboot.
-echo .
+REM
+REM Reboot (common to both phases).
+REM
+:reboot
+@echo .
+@echo Reboot (%1)
+@echo .
 cd C:\OS2
 C:
+
+@echo debug
+CMD.EXE
+
 SETBOOT /IBD:C
-PAUSE
-S:\OS2IMAGE\DISK_2\CMD.EXE
-
+pause
+CMD.EXE
+
Index: /trunk/src/VBox/Main/UnattendedTemplates/os2_response_files.rsp
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/os2_response_files.rsp	(revision 93121)
+++ /trunk/src/VBox/Main/UnattendedTemplates/os2_response_files.rsp	(revision 93122)
@@ -1,4 +1,5 @@
 @@VBOX_SPLITTER_START[CONFIG.SYS]@@
 REM
+REM $Id$
 REM VirtualBox CID Installation CONFIG.SYS for boot CD/floppy.
 REM
@@ -18,9 +19,9 @@
 BREAK=OFF
 
-REM Just to be on the safe side, all paths include disk #1 thru #6, omitting #0
+REM Just to be on the safe side, all paths include disk #0 thru #6.
 REM as it doesn't contain much interesting.
-LIBPATH=.;A:\;S:\OS2IMAGE\DISK_1;S:\OS2IMAGE\DISK_2;S:\OS2IMAGE\DISK_3;S:\OS2IMAGE\DISK_4;S:\OS2IMAGE\DISK_5;S:\OS2IMAGE\DISK_6;S:\OS2IMAGE\DISK_7;
-SET PATH=.;S:\OS2IMAGE\DISK_1;S:\OS2IMAGE\DISK_2;S:\OS2IMAGE\DISK_3;S:\OS2IMAGE\DISK_4;S:\OS2IMAGE\DISK_5;S:\OS2IMAGE\DISK_6;S:\OS2IMAGE\DISK_7;
-SET DPATH=.;A:\;S:\OS2IMAGE\DISK_1;S:\OS2IMAGE\DISK_2;S:\OS2IMAGE\DISK_3;S:\OS2IMAGE\DISK_4;S:\OS2IMAGE\DISK_5;S:\OS2IMAGE\DISK_6;S:\OS2IMAGE\DISK_7;
+  LIBPATH=.;A:\;S:\OS2IMAGE\DISK_0;S:\OS2IMAGE\DISK_1;S:\OS2IMAGE\DISK_2;S:\OS2IMAGE\DISK_3;S:\OS2IMAGE\DISK_4;S:\OS2IMAGE\DISK_5;S:\OS2IMAGE\DISK_6;S:\OS2IMAGE\DISK_7;
+SET  PATH=.;A:\;S:\OS2IMAGE\DISK_0;S:\OS2IMAGE\DISK_1;S:\OS2IMAGE\DISK_2;S:\OS2IMAGE\DISK_3;S:\OS2IMAGE\DISK_4;S:\OS2IMAGE\DISK_5;S:\OS2IMAGE\DISK_6;S:\OS2IMAGE\DISK_7;
+SET DPATH=.;A:\;S:\OS2IMAGE\DISK_0;S:\OS2IMAGE\DISK_1;S:\OS2IMAGE\DISK_2;S:\OS2IMAGE\DISK_3;S:\OS2IMAGE\DISK_4;S:\OS2IMAGE\DISK_5;S:\OS2IMAGE\DISK_6;S:\OS2IMAGE\DISK_7;
 
 COUNTRY=001,COUNT437.SYS
@@ -35,6 +36,4 @@
 BASEDEV=OS2DASD.DMD
 BASEDEV=OS2LVM.DMD
-REM We seem to crash frequently during/after TESTCFG.SYS loading.  It is used
-REM by the installer, so cannot be dropped.
 DEVICE=TESTCFG.SYS
 DEVICE=OS2CDROM.DMD
@@ -49,5 +48,6 @@
 REM PROTSHELL=S:\OS2IMAGE\DISK_2\CMD.EXE
 REM Run the os2_cid_install.cmd file (renamed to VBOXCID.CMD on the ISO).
-PROTSHELL=S:\OS2IMAGE\DISK_2\CMD.EXE /C S:\VBOXCID.CMD
+REM PROTSHELL=S:\OS2IMAGE\DISK_2\CMD.EXE /C S:\VBOXCID\OS2_UTIL.EXE --tee-to-backdoor --tee-to-file C:\VBoxCID\Phase1.log --append -- S:\OS2IMAGE\DISK_2\CMD.EXE /C S:\VBOXCID.CMD PHASE1
+PROTSHELL=S:\VBOXCID\OS2_UTIL.EXE --tee-to-backdoor --tee-to-file C:\VBoxCID\Phase1.log --append -- S:\OS2IMAGE\DISK_2\CMD.EXE /C S:\VBOXCID.CMD PHASE1
 
 @@VBOX_SPLITTER_END[CONFIG.SYS]@@
@@ -64,5 +64,8 @@
 #
 @@VBOX_SPLITTER_START[STARTUP.CMD]@@
-REM The startup file for C: for use after the successful install.
+@REM
+@REM $Id$
+@REM The startup file for C: for use after the successful install.
+@REM
 @@VBOX_COND_IS_INSTALLING_ADDITIONS@@
 C:\VBoxAdd\VBoxService.exe
Index: /trunk/src/VBox/Main/src-server/UnattendedOs2Installer.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/UnattendedOs2Installer.cpp	(revision 93121)
+++ /trunk/src/VBox/Main/src-server/UnattendedOs2Installer.cpp	(revision 93122)
@@ -975,4 +975,12 @@
     /*
      * Add our stuff to the vectors.
+     *
+     * Note! Typcially OS/2 ISOs are without joliet or UDF namespaces, given
+     *       their age and tools used to produce them, but more recent ones
+     *       like ArcaOS have joliet present.  So, to avoid ending up with an
+     *       almost empty CDROM in Phase2 because UDF.IFS is loaded and
+     *       presenting the joliet namespace, the --name-setup-from-import
+     *       option was added to the ISO maker.  It will look at the files that
+     *       were imported and adjust the --name-setup accordingly (logged).
      */
     try
@@ -984,5 +992,7 @@
         rVecArgs.append() = "--import-iso";
         rVecArgs.append(mpParent->i_getIsoPath());
-
+        rVecArgs.append() = "--name-setup-from-import"; /* */
+
+        /** @todo these enables rock-ridge...   */
         rVecArgs.append() = "--file-mode=0444";
         rVecArgs.append() = "--dir-mode=0555";
@@ -991,7 +1001,6 @@
         rVecArgs.append() = "--eltorito-new-entry";
         rVecArgs.append() = "--eltorito-add-image";
-        rVecArgs.append(mStrAuxiliaryFloppyFilePath);
+        rVecArgs.append().assign("VBoxBootFloppy.img=").append(mStrAuxiliaryFloppyFilePath);
         rVecArgs.append() = "--eltorito-floppy-288";
-
 
         /* Add the response files and postinstall files to the ISO: */
@@ -1003,4 +1012,12 @@
             rVecArgs.append().assign("VBoxCID/").append(rStrFile).append('=').append(rStrAuxPrefix).append(rStrFile);
         }
+
+        /* Add the os2_util.exe to the ISO: */
+        Utf8Str strUnattendedTemplates;
+        int vrc = RTPathAppPrivateNoArchCxx(strUnattendedTemplates);
+        AssertRCReturn(vrc, mpParent->setErrorVrc(vrc));
+        vrc = RTPathAppendCxx(strUnattendedTemplates, "UnattendedTemplates");
+        AssertRCReturn(vrc, mpParent->setErrorVrc(vrc));
+        rVecArgs.append().assign("VBoxCID/os2_util.exe=").append(strUnattendedTemplates).append("/os2_util.exe");
     }
     catch (std::bad_alloc &)
