VirtualBox

source: vbox/trunk/src/VBox/Main/UnattendedTemplates/os2_cid_install.cmd@ 94764

Last change on this file since 94764 was 93148, checked in by vboxsync, 3 years ago

Main/UnattendedOsInstall: Installing guest additions and TXS...

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 14.9 KB
Line 
1@ECHO OFF
2REM $Id: os2_cid_install.cmd 93148 2022-01-08 15:57:40Z vboxsync $
3REM REM @fileREM
4REM VirtualBox CID Installation - main driver script for boot CD/floppy.
5REM
6
7REM
8REM Copyright (C) 2004-2022 Oracle Corporation
9REM
10REM This file is part of VirtualBox Open Source Edition (OSE), as
11REM available from http://www.virtualbox.org. This file is free software;
12REM you can redistribute it and/or modify it under the terms of the GNU
13REM General Public License (GPL) as published by the Free Software
14REM Foundation, in version 2 as it comes in the "COPYING" file of the
15REM VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16REM hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17REM
18
19REM Check the phase argument and jump to the right section of the file.
20if "%1" == "PHASE1" goto phase1
21if "%1" == "PHASE2" goto phase2
22if "%1" == "PHASE3" goto phase3
23@echo ** error: invalid or missing parameter. Expected PHASE1, PHASE2 or PHASE3 as the first parameter to the script.
24pause
25cmd.exe
26exit /b 1
27
28REM
29REM Phase 1 - Base system installation.
30REM
31:phase1
32SET CDROM=S:
33
34@echo on
35@echo .
36@echo Step 1.1 - Partition the disk.
37@echo .
38cd %CDROM%\os2image\disk_6
39%CDROM%
40
41lvm.exe /NEWMBR:1 && goto lvm_newmbr_ok
42@echo ** error: Writing a new MBR on disk 1 failed.
43goto lvm_failed
44:lvm_newmbr_ok
45
46@REM Depends the default drive name being "[ D1 ]". However it's cosmetical,
47@REM so we don't complain if this fails.
48lvm.exe "/SETNAME:DRIVE,[ D1 ],BootDrive"
49
50lvm.exe /CREATE:PARTITION,OS2Boot,1,1024,PRIMARY,BOOTABLE && goto lvm_create_partition_ok
51@echo ** error: Creating boot partition on disk 1 failed.
52goto lvm_failed
53:lvm_create_partition_ok
54
55lvm.exe /CREATE:VOLUME,COMPATIBILITY,BOOTOS2,C:,OS2Boot,1,OS2Boot && goto lvm_create_volume_ok
56@echo ** error: Creating boot volume on disk 1 failed.
57goto lvm_failed
58:lvm_create_volume_ok
59
60lvm.exe /SETSTARTABLE:VOLUME,OS2Boot && goto lvm_set_startable_ok
61@echo ** error: Setting boot volume on disk 1 startable failed.
62goto lvm_failed
63:lvm_set_startable_ok
64
65@REM Depending on the freespace automatically getting the name "[ FS1 ]".
66lvm.exe "/CREATE:PARTITION,Data,1,LOGICAL,NotBootable,[ FS1 ]" && goto lvm_create_data_partition_ok
67@echo ** error: Creating data partition on disk 1 failed.
68goto lvm_failed
69:lvm_create_data_partition_ok
70
71lvm.exe /CREATE:VOLUME,LVM,D:,Data,1,Data && goto lvm_create_data_volume_ok
72@echo ** error: Creating data volume on disk 1 failed.
73goto lvm_failed
74:lvm_create_data_volume_ok
75
76REM pause
77lvm.exe /QUERY
78REM CMD.EXE
79goto done_step1_1
80
81:lvm_failed
82@echo .
83@echo An LVM operation failed (see above).
84@echo The process requires a blank disk with no partitions. Starting LVM
85@echo so you can manually correct this.
86@echo .
87pause
88lvm.exe
89%CDROM%\cid\exe\os2\setboot.exe /B
90exit
91
92:done_step1_1
93
94:step1_2
95@echo .
96@echo Step 1.2 - Format the volumes.
97@echo .
98cd %CDROM%\os2image\disk_3
99%CDROM%
100
101FORMAT.COM C: /FS:HPFS /V:OS2Boot < %CDROM%\VBoxCID\YES.TXT && goto format_boot_ok
102@echo ** error: Formatting C: failed.
103pause
104:format_boot_ok
105
106FORMAT.COM D: /FS:JFS /V:Data < %CDROM%\VBoxCID\YES.TXT && goto format_data_ok
107@echo ** error: Formatting D: failed.
108pause
109:format_data_ok
110
111cd \
112
113:step1_3
114@echo .
115@echo Step 1.3 - Putting response files and CID tools on C:
116@echo .
117mkdir C:\VBoxCID
118mkdir C:\OS2
119copy %CDROM%\cid\exe\os2\*.* C:\VBoxCID
120copy %CDROM%\cid\dll\os2\*.* C:\VBoxCID
121copy %CDROM%\os2image\disk_2\inst32.dll C:\VBoxCID
122copy %CDROM%\VBoxCID\*.* C:\VBoxCID && goto copy_1_ok
123@echo ** error: Copying CID stuff from CDROM to C: failed (#1).
124pause
125:copy_1_ok
126copy %CDROM%\VBoxCID.CMD C:\VBoxCID && goto copy_2_ok
127@echo ** error: Copying CID stuff from CDROM to C: failed (#2).
128pause
129:copy_2_ok
130
131:step1_4
132@echo .
133@echo Step 1.4 - Start OS/2 CID installation.
134@echo .
135SET REMOTE_INSTALL_STATE=CAS_WARP4
136cd C:\OS2
137C:
138@REM Treat 0xfe00 as a success status. It seems to mean that a reboot is required.
139C:\VBoxCID\OS2_UTIL.EXE --as-zero 0xfe00 -- C:\VBoxCID\SEMAINT.EXE /S:%CDROM%\os2image /B:C: /L1:C:\VBoxCID\1.4.1-Maint.log /T:C:\OS2 && goto semaint_ok
140C:\VBoxCID\OS2_UTIL.EXE --file-to-backdoor C:\VBoxCID\1.4.1-Maint.log
141pause
142:semaint_ok
143REM CMD.EXE
144
145cd C:\VBoxCID
146C:
147@REM Treat 0xff02 as a success status. It seems to mean that a reboot is required.
148C:\VBoxCID\OS2_UTIL.EXE --as-zero 0xff02 -- C:\VBoxCID\SEINST.EXE /S:%CDROM%\os2image /B:C: /L1:C:\VBoxCID\1.4.2-CIDInst.log /R:C:\VBoxCID\OS2.RSP /T:A:\ && goto seinst_ok
149C:\VBoxCID\OS2_UTIL.EXE --file-to-backdoor C:\VBoxCID\1.4.2-CIDInst.log
150pause
151:seinst_ok
152REM CMD.EXE
153
154:step1_5
155@echo .
156@echo Step 1.5 - Make C: bootable.
157@echo .
158C:
159cd C:\OS2
160SYSINSTX.COM C: && goto sysinstx_ok
161pause
162:sysinstx_ok
163
164@echo Copying over patched OS2LDR from A:
165attrib -R -H -S C:\OS2LDR
166copy C:\OS2LDR C:\OS2LDR.Phase1
167del C:\OS2LDR
168copy A:\OS2LDR C:\OS2LDR && goto copy_os2ldr_ok
169pause
170:copy_os2ldr_ok
171attrib +R +H +S C:\OS2LDR
172
173@REM This copy is for the end of phase 2 as someone replaces it.
174copy A:\OS2LDR C:\VBoxCID && goto copy_os2ldr_2_ok
175pause
176:copy_os2ldr_2_ok
177attrib +r C:\VBoxCID\OS2LDR
178
179@echo Enabling Alt-F2 driver logging during boot.
180@echo > "C:\ALTF2ON.$$$"
181
182@echo Install startup.cmd for phase2.
183@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
184pause
185:phase2_startup_ok
186
187copy C:\CONFIG.SYS C:\VBoxCID\Phase1-end-config.sys
188
189REM now reboot.
190goto reboot
191
192
193REM
194REM Phase 2 - Install GRADD drivers (VGA is horribly slow).
195REM
196:phase2
197SET CDROM=E:
198IF EXIST "%CDROM%\VBoxCID.CMD" goto phase2_found_cdrom
199SET CDROM=D:
200IF EXIST "%CDROM%\VBoxCID.CMD" goto phase2_found_cdrom
201SET CDROM=F:
202IF EXIST "%CDROM%\VBoxCID.CMD" goto phase2_found_cdrom
203SET CDROM=G:
204IF EXIST "%CDROM%\VBoxCID.CMD" goto phase2_found_cdrom
205SET CDROM=H:
206IF EXIST "%CDROM%\VBoxCID.CMD" goto phase2_found_cdrom
207SET CDROM=S:
208IF EXIST "%CDROM%\VBoxCID.CMD" goto phase2_found_cdrom
209@echo ** error: Unable to find the CDROM drive
210pause
211CMD
212SET CDROM=E:
213:phase2_found_cdrom
214cd C:\VBoxCID
215C:
216
217@echo on
218
219:step2_1
220@echo .
221@echo Step 2.1 - Install the video driver.
222@echo .
223@REM Treat 0xfe00 as a success status. It seems to mean that a reboot is required.
224C:\VBoxCID\OS2_UTIL.EXE --as-zero 0xfe00 -- C:\OS2\INSTALL\DspInstl.EXE /PD:C:\OS2\INSTALL\GENGRADD.DSC /S:%CDROM%\OS2IMAGE /T:C: /RES:1024X768X16777216 /U && goto dspinstl_ok
225C:\VBoxCID\OS2_UTIL.EXE --file-to-backdoor C:\OS2\INSTALL\DSPINSTL.LOG
226C:\VBoxCID\OS2_UTIL.EXE --file-to-backdoor C:\OS2\INSTALL\GRADD.LOG
227pause
228:dspinstl_ok
229
230@REM TODO: Error: 1 Error getting current desktop mode
231@REM UPDATE: This is probably not working because SVGA.EXE doesn't want to play along with our graphics adapter,
232@REM so it looks like there is no simple way of changing the resolution or select a better monitor.
233call VCfgCID.CMD /L1:C:\VBoxCID\2.1-Video.log /L2:C:\VBoxCID\2.1-Video-2.log /RES:1024X768X16777216 /MON:548
234goto vcfgcid_ok
235C:\VBoxCID\OS2_UTIL.EXE --file-to-backdoor C:\VBoxCID\2.1-Video.log
236pause
237:vcfgcid_ok
238cd C:\VBoxCID
239C:
240
241:step2_2
242@echo Install startup.cmd for phase3.
243ren C:\STARTUP.CMD C:\VBoxCID\Phase2-end-startup.cmd
244copy C:\CONFIG.SYS C:\VBoxCID\Phase2-end-config.sys
245@echo C:\VBoxCID\OS2_UTIL.EXE --tee-to-backdoor --tee-to-file C:\VBoxCID\Phase3.log --append -- C:\OS2\CMD.EXE /C C:\VBoxCID\VBoxCID.CMD PHASE3> C:\STARTUP.CMD && goto phase3_startup_ok
246pause
247:phase3_startup_ok
248
249REM now reboot.
250goto reboot
251
252
253REM
254REM Phase 2 - The rest of the installation running of the base install with fast GRADD drivers.
255REM
256:phase3
257SET CDROM=E:
258IF EXIST "%CDROM%\VBoxCID.CMD" goto phase3_found_cdrom
259SET CDROM=D:
260IF EXIST "%CDROM%\VBoxCID.CMD" goto phase3_found_cdrom
261SET CDROM=F:
262IF EXIST "%CDROM%\VBoxCID.CMD" goto phase3_found_cdrom
263SET CDROM=G:
264IF EXIST "%CDROM%\VBoxCID.CMD" goto phase3_found_cdrom
265SET CDROM=H:
266IF EXIST "%CDROM%\VBoxCID.CMD" goto phase3_found_cdrom
267SET CDROM=S:
268IF EXIST "%CDROM%\VBoxCID.CMD" goto phase3_found_cdrom
269@echo ** error: Unable to find the CDROM drive
270pause
271CMD
272SET CDROM=E:
273:phase3_found_cdrom
274cd C:\VBoxCID
275C:
276
277@echo on
278
279:step3_1
280@echo .
281@echo Step 3.1 - Install multimedia.
282@echo .
283cd C:\mmtemp
284C:
285@REM Does not have any /L, /L1, or /L2 options. Fixed log file: C:\MINSTALL.LOG.
286@REM Treat 0xfe00 as a success status. It seems to mean that a reboot is required.
287C:\VBoxCID\OS2_UTIL.EXE --as-zero 0xfe00 -- MInstall.EXE /M /R:C:\VBoxCID\MMOS2.RSP && goto mmos2_ok
288C:\VBoxCID\OS2_UTIL.EXE --file-to-backdoor C:\MINSTALL.LOG
289pause
290:mmos2_ok
291cd C:\VBoxCID
292
293:step3_2
294@echo .
295@echo Step 3.2 - Install features.
296@echo .
297@REM Treat 0xfe00 as a success status. It seems to mean that a reboot is required.
298C:\VBoxCID\OS2_UTIL.EXE --as-zero 0xfe00 -- CLIFI.EXE /A:C /B:C: /S:%CDROM%\os2image\fi /R:C:\OS2\INSTALL\FIBASE.RSP /L1:C:\VBoxCID\3.2-FeatureInstaller.log /R2:C:\VBoxCID\OS2.RSP
299@REM does not exit with status 0 on success.
300goto features_ok
301C:\VBoxCID\OS2_UTIL.EXE --file-to-backdoor C:\VBoxCID\3.2-FeatureInstaller.log
302pause
303:features_ok
304
305:step3_3
306@echo .
307@echo Step 3.3 - Install MPTS.
308@echo .
309@REM If we want to use non-standard drivers like the intel ones, copy the .NIF- and
310@REM .OS2-files to C:\IBMCOM\MACS before launching the installer (needs creating first).
311@REM Note! Does not accept /L2:.
312@REM Note! Omitting /TU:C in hope that it solves the lan install failure (no netbeui configured in mpts).
313CD %CDROM%\CID\SERVER\MPTS
314%CDROM%
315@REM Treat 0xfe00 as a success status. It seems to mean that a reboot is required.
316C:\VBoxCID\OS2_UTIL.EXE --as-zero 0xfe00 -- %CDROM%\CID\SERVER\MPTS\MPTS.EXE /R:C:\VBoxCID\MPTS.RSP /S:%CDROM%\CID\SERVER\MPTS /T:C: /L1:C:\VBoxCID\3.3-Mpts.log && goto mpts_ok
317C:\VBoxCID\OS2_UTIL.EXE --file-to-backdoor C:\VBoxCID\3.3-Mpts.log
318pause
319:mpts_ok
320CD %CDROM%\
321C:
322
323:step3_4
324@echo .
325@echo Step 3.4 - Install TCP/IP.
326@echo .
327CD %CDROM%\CID\SERVER\TCPAPPS
328%CDROM%
329@REM Treat 0xfe00 as a success status. It seems to mean that a reboot is required.
330C:\VBoxCID\OS2_UTIL.EXE --as-zero 0xfe00 -- CLIFI.EXE /A:C /B:C: /S:%CDROM%\CID\SERVER\TCPAPPS\INSTALL /R:%CDROM%\CID\SERVER\TCPAPPS\INSTALL\TCPINST.RSP /L1:C:\VBoxCID\3.4-tcp.log /L2:C:\VBoxCID\3.4-tcp-2.log && goto tcp_ok
331C:\VBoxCID\OS2_UTIL.EXE --file-to-backdoor C:\VBoxCID\3.4-tcp.log
332pause
333:tcp_ok
334CD %CDROM%\
335C:
336
337CD %CDROM%\CID\SERVER\TCPAPPS\INSTALL
338%CDROM%
339C:\VBoxCID\OS2_UTIL.EXE -- %CDROM%\CID\SERVER\TCPAPPS\INSTALL\makecmd.exe C:\TCPIP en_US C:\MPTS && goto makecmd_ok
340pause
341:makecmd_ok
342cd %CDROM%\
343
344:step3_5
345@echo .
346@echo Step 3.5 - Install IBM LAN Requestor/Peer.
347@echo .
348SET REMOTE_INSTALL_STATE=CAS_OS/2 Peer
349CD %CDROM%\CID\SERVER\IBMLS
350%CDROM%
351C:\VBoxCID\OS2_UTIL.EXE -- %CDROM%\CID\SERVER\IBMLS\LANINSTR.EXE /REQ /R:C:\VBoxCID\IBMLan.rsp /L1:C:\VBoxCID\3.5-IBMLan.log /L2:C:\VBoxCID\3.5-IBMLan-2.log && goto ibmlan_ok
352C:\VBoxCID\OS2_UTIL.EXE --file-to-backdoor C:\VBoxCID\3.5-IBMLan.log
353:ibmlan_ok
354CD %CDROM%\
355C:
356
357:step3_6
358@echo .
359@echo Step 3.6 - Install Netscape.
360@echo .
361CD C:\VBoxCID
362C:
363%CDROM%
364@REM Skipping as it hangs after a "Message file not found." error. (The DPATH amendment doesn't help.) Logs give no clue.
365@REM The install works fine after the phase3 reboot. Next log message then is "NS46EXIT QLTOBMCONVERT en_US, rc=0x0000",
366@REM so maybe it is related to the LANG environment variable or Locale? Hmm. LANG seems to be set...
367goto netscape_ok
368SET DPATH=%DPATH%;C:\NETSCAPE\SIUTIL;C:\NETSCAPE\PROGRAM;
369IF "x%LANG%x" == "xx" THEN SET LANG=en_US
370C:\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\3.6-Netscape.log /L2:C:\VBoxCID\3.6-Netscape-2.log && goto netscape_ok
371C:\VBoxCID\OS2_UTIL.EXE --file-to-backdoor C:\VBoxCID\3.6-Netscape.log
372pause
373:netscape_ok
374CD %CDROM%\
375C:
376
377:step3_7
378@echo .
379@echo Step 3.7 - Install feature installer.
380@echo .
381@REM No /L2: support.
382@REM The /NN option is to make it not fail if netscape is missing.
383C:\VBoxCID\OS2_UTIL.EXE -- C:\OS2\INSTALL\WSFI\FiSetup.EXE /B:C: /S:C:\OS2\INSTALL\WSFI\FISETUP /NN /L1:C:\VBoxCID\3.7-FiSetup.log && goto fisetup_ok
384C:\VBoxCID\OS2_UTIL.EXE --file-to-backdoor C:\VBoxCID\3.7-FiSetup.log
385pause
386:fisetup_ok
387
388:step3_8
389@echo .
390@echo Step 3.8 - Install the test execution service (TXS).
391@echo .
392@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@
393mkdir C:\VBoxValKit
394mkdir D:\TestArea
395copy %CDROM%\VBoxValidationKit\*.* C:\VBoxValKit && goto valkit_copy_1_ok
396pause
397:valkit_copy_1_ok
398copy %CDROM%\VBoxValidationKit\os2\x86\*.* C:\VBoxValKit && goto valkit_copy_2_ok
399pause
400:valkit_copy_2_ok
401@@VBOX_COND_ELSE@@
402@echo Not requested. Skipping.
403@@VBOX_COND_END@@
404
405:step3_9
406@echo .
407@echo Step 3.9 - Install final startup.cmd and copy over OS2LDR again.
408@echo .
409attrib -r -h -s C:\STARTUP.CMD
410copy C:\VBoxCID\STARTUP.CMD C:\ && goto final_startup_ok
411pause
412:final_startup_ok
413
414attrib -r -h -s C:\OS2LDR
415if not exist C:\VBoxCID\OS2LDR pause
416if not exist C:\VBoxCID\OS2LDR goto final_os2ldr_ok
417copy C:\OS2LDR C:\OS2LDR.Phase2
418del C:\OS2LDR
419copy C:\VBoxCID\OS2LDR C:\OS2LDR && goto final_os2ldr_ok
420pause
421:final_os2ldr_ok
422attrib +r +h +s C:\OS2LDR
423
424:step3_10
425@REM Putting this after placing the final Startup.cmd so we can test the
426@REM installer's ability to parse and modify it.
427@echo .
428@echo Step 3.10 - Install guest additions.
429@echo .
430@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
431%CDROM%\VBoxAdditions\OS2\VBoxOs2AdditionsInstall.exe --do-install && goto addition_install_ok
432pause
433:addition_install_ok
434@@VBOX_COND_ELSE@@
435@echo Not requested. Skipping.
436@@VBOX_COND_END@@
437
438:step3_11
439@echo .
440@echo Step 3.11 - Cleanup
441@echo .
442del /N C:\*.bio
443del /N C:\*.i13
444del /N C:\*.snp
445del /N C:\CONFIG.ADD
446mkdir C:\MMTEMP 2>nul
447del /N C:\MMTEMP\*.*
448@REM This is only needed if we don't install mmos2:
449@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\*.*
450@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
451@REM rmdir C:\MMTEMP\OS2\DRIVERS
452@REM rmdir C:\MMTEMP\OS2
453rmdir C:\MMTEMP
454copy C:\CONFIG.SYS C:\VBoxCID || goto skip_sys_cleanup
455del /N C:\*.SYS
456copy C:\VBoxCID\CONFIG.SYS C:\
457:skip_sys_cleanup
458
459:step3_12
460@@VBOX_COND_HAS_POST_INSTALL_COMMAND@@
461@echo .
462@echo Step 3.12 - Custom actions: "@@VBOX_INSERT_POST_INSTALL_COMMAND@@"
463@echo .
464cd C:\VBoxCID
465C:
466@@VBOX_INSERT_POST_INSTALL_COMMAND@@
467@@VBOX_COND_END@@
468
469copy C:\CONFIG.SYS C:\VBoxCID\Phase3-end-config.sys
470
471
472REM
473REM Reboot (common to both phases).
474REM
475:reboot
476@echo .
477@echo Reboot (%1)
478@echo .
479cd C:\OS2
480C:
481
482@REM @echo debug
483@REM CMD.EXE
484
485SETBOOT /IBD:C
486pause
487CMD.EXE
488
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette