VirtualBox

source: vbox/trunk/src/VBox/Main/include/UnattendedInstaller.h@ 90893

Last change on this file since 90893 was 90828, checked in by vboxsync, 3 years ago

Main: bugref:1909: Added API localization

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 29.1 KB
Line 
1/* $Id: UnattendedInstaller.h 90828 2021-08-24 09:44:46Z vboxsync $ */
2/** @file
3 * UnattendedInstaller class header
4 */
5
6/*
7 * Copyright (C) 2006-2020 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef MAIN_INCLUDED_UnattendedInstaller_h
19#define MAIN_INCLUDED_UnattendedInstaller_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include "UnattendedScript.h"
25
26/* Forward declarations */
27class Unattended;
28class UnattendedInstaller;
29class BaseTextScript;
30
31
32/**
33 * The abstract UnattendedInstaller class declaration
34 *
35 * The class is intended to service a new VM that this VM will be able to
36 * execute an unattended installation
37 */
38class UnattendedInstaller : public RTCNonCopyable, public VirtualBoxTranslatable
39{
40/*data*/
41protected:
42 /** Main unattended installation script. */
43 UnattendedScriptTemplate mMainScript;
44 /** Full path to the main template file (set by initInstaller). */
45 Utf8Str mStrMainScriptTemplate;
46
47 /** Post installation (shell) script. */
48 UnattendedScriptTemplate mPostScript;
49 /** Full path to the post template file (set by initInstaller). */
50 Utf8Str mStrPostScriptTemplate;
51
52 /** Pointer to the parent object.
53 * We use this for setting errors and querying attributes. */
54 Unattended *mpParent;
55 /** The path of the extra ISO image we create (set by initInstaller).
56 * This is only valid when isAdditionsIsoNeeded() returns true. */
57 Utf8Str mStrAuxiliaryIsoFilePath;
58 /** The path of the extra floppy image we create (set by initInstaller)
59 * This is only valid when isAdditionsFloppyNeeded() returns true. */
60 Utf8Str mStrAuxiliaryFloppyFilePath;
61 /** The boot device. */
62 DeviceType_T const meBootDevice;
63 /** Default extra install kernel parameters (set by constructor).
64 * This can be overridden by the extraInstallKernelParameters attribute of
65 * IUnattended. */
66 Utf8Str mStrDefaultExtraInstallKernelParameters;
67
68private:
69 UnattendedInstaller(); /* no default constructors */
70
71public:
72 DECLARE_TRANSLATE_METHODS(UnattendedInstaller)
73
74 /**
75 * Regular constructor.
76 *
77 * @param pParent The parent object. Used for setting
78 * errors and querying attributes.
79 * @param pszMainScriptTemplateName The name of the template file (no path)
80 * for the main unattended installer
81 * script.
82 * @param pszPostScriptTemplateName The name of the template file (no path)
83 * for the post installation script.
84 * @param pszMainScriptFilename The main unattended installer script
85 * filename (on aux media).
86 * @param pszPostScriptFilename The post installation script filename
87 * (on aux media).
88 * @param enmBootDevice The boot device type.
89 */
90 UnattendedInstaller(Unattended *pParent,
91 const char *pszMainScriptTemplateName, const char *pszPostScriptTemplateName,
92 const char *pszMainScriptFilename, const char *pszPostScriptFilename,
93 DeviceType_T enmBootDevice = DeviceType_DVD);
94 virtual ~UnattendedInstaller();
95
96 /**
97 * Instantiates the appropriate child class.
98 *
99 * @returns Pointer to the new instance, NULL if no appropriate installer.
100 * @param enmOsType The guest OS type value.
101 * @param strGuestOsType The guest OS type string
102 * @param strDetectedOSVersion The detected guest OS version.
103 * @param strDetectedOSFlavor The detected guest OS flavor.
104 * @param strDetectedOSHints Hints about the detected guest OS.
105 * @param pParent The parent object. Used for setting errors
106 * and querying attributes.
107 * @throws std::bad_alloc
108 */
109 static UnattendedInstaller *createInstance(VBOXOSTYPE enmOsType, const Utf8Str &strGuestOsType,
110 const Utf8Str &strDetectedOSVersion, const Utf8Str &strDetectedOSFlavor,
111 const Utf8Str &strDetectedOSHints, Unattended *pParent);
112
113 /**
114 * Initialize the installer.
115 *
116 * @note This is called immediately after instantiation and the caller will
117 * always destroy the unattended installer instance on failure, so it
118 * is not necessary to keep track of whether this succeeded or not.
119 */
120 virtual HRESULT initInstaller();
121
122#if 0 /* These are now in the AUX VISO. */
123 /**
124 * Whether the VBox Guest Additions ISO is needed or not.
125 *
126 * The default implementation always returns false when a VISO is used, see
127 * UnattendedInstaller::addFilesToAuxVisoVectors.
128 */
129 virtual bool isAdditionsIsoNeeded() const;
130
131 /**
132 * Whether the VBox validation kit ISO is needed or not.
133 *
134 * The default implementation always returns false when a VISO is used, see
135 * UnattendedInstaller::addFilesToAuxVisoVectors.
136 */
137 virtual bool isValidationKitIsoNeeded() const;
138#endif
139
140 /**
141 * Indicates whether an original installation ISO is needed or not.
142 */
143 virtual bool isOriginalIsoNeeded() const { return true; }
144
145 /**
146 * Indicates whether a floppy image is needed or not.
147 */
148 virtual bool isAuxiliaryFloppyNeeded() const { return false; }
149
150 /**
151 * Indicates whether an additional or replacement ISO image is needed or not.
152 */
153 virtual bool isAuxiliaryIsoNeeded() const;
154
155 /**
156 * Indicates whether we should boot from the auxiliary ISO image.
157 *
158 * Will boot from installation ISO if false.
159 */
160 virtual bool bootFromAuxiliaryIso() const { return isAuxiliaryIsoNeeded(); }
161
162 /**
163 * Indicates whether a the auxiliary ISO is a .viso-file rather than an
164 * .iso-file.
165 *
166 * Different worker methods are used depending on the return value. A
167 * .viso-file is generally only used when the installation media needs to
168 * be remastered with small changes and additions.
169 */
170 virtual bool isAuxiliaryIsoIsVISO() const { return true; }
171
172 /*
173 * Getters
174 */
175 DeviceType_T getBootableDeviceType() const { return meBootDevice; }
176 const Utf8Str &getTemplateFilePath() const { return mStrMainScriptTemplate; }
177 const Utf8Str &getPostTemplateFilePath() const { return mStrPostScriptTemplate; }
178 const Utf8Str &getAuxiliaryIsoFilePath() const { return mStrAuxiliaryIsoFilePath; }
179 const Utf8Str &getAuxiliaryFloppyFilePath() const { return mStrAuxiliaryFloppyFilePath; }
180 const Utf8Str &getDefaultExtraInstallKernelParameters() const { return mStrDefaultExtraInstallKernelParameters; }
181
182 /*
183 * Setters
184 */
185 void setTemplatePath(const Utf8Str& data); /**< @todo r=bird: This is confusing as heck. Dir for a while, then it's a file. Not a comment about it. Brilliant. */
186
187 /**
188 * Prepares the unattended scripts, does all but write them to the installation
189 * media.
190 */
191 HRESULT prepareUnattendedScripts();
192
193 /**
194 * Prepares the media - floppy image, ISO image.
195 *
196 * This method calls prepareAuxFloppyImage() and prepareAuxIsoImage(), child
197 * classes may override these methods or methods they call.
198 *
199 * @returns COM status code.
200 * @param fOverwrite Whether to overwrite media files or fail if they
201 * already exist.
202 */
203 HRESULT prepareMedia(bool fOverwrite = true);
204
205protected:
206 /**
207 * Prepares (creates) the auxiliary floppy image.
208 *
209 * This is called by the base class prepareMedia() when
210 * isAuxiliaryFloppyNeeded() is true. The base class implementation puts the
211 * edited unattended script onto it.
212 */
213 HRESULT prepareAuxFloppyImage(bool fOverwrite);
214
215 /**
216 * Creates and formats (FAT12) a floppy image, then opens a VFS for it.
217 *
218 * @returns COM status code.
219 * @param pszFilename The path to the image file.
220 * @param fOverwrite Whether to overwrite the file.
221 * @param phVfs Where to return a writable VFS handle to the newly
222 * created image.
223 */
224 HRESULT newAuxFloppyImage(const char *pszFilename, bool fOverwrite, PRTVFS phVfs);
225
226 /**
227 * Copies files to the auxiliary floppy image.
228 *
229 * The base class implementation copies the main and post scripts to the root of
230 * the floppy using the default script names. Child classes may override this
231 * to add additional or different files.
232 *
233 * @returns COM status code.
234 * @param hVfs The floppy image VFS handle.
235 */
236 virtual HRESULT copyFilesToAuxFloppyImage(RTVFS hVfs);
237
238 /**
239 * Adds the given script to the root of the floppy image under the default
240 * script filename.
241 *
242 * @returns COM status code.
243 * @param pEditor The script to add.
244 * @param hVfs The VFS to add it to.
245 */
246 HRESULT addScriptToFloppyImage(BaseTextScript *pEditor, RTVFS hVfs);
247
248 /**
249 * Prepares (creates) the auxiliary ISO image.
250 *
251 * This is called by the base class prepareMedia() when isAuxiliaryIsoNeeded()
252 * is true. The base class implementation puts the edited unattended script
253 * onto it.
254 */
255 virtual HRESULT prepareAuxIsoImage(bool fOverwrite);
256
257 /**
258 * Opens the installation ISO image.
259 *
260 * @returns COM status code.
261 * @param phVfsIso Where to return the VFS handle for the ISO.
262 * @param fFlags RTFSISO9660_F_XXX flags to pass to the
263 * RTFsIso9660VolOpen API.
264 */
265 virtual HRESULT openInstallIsoImage(PRTVFS phVfsIso, uint32_t fFlags = 0);
266
267 /**
268 * Creates and configures the ISO maker instance.
269 *
270 * This can be overridden to set configure options.
271 *
272 * @returns COM status code.
273 * @param phIsoMaker Where to return the ISO maker.
274 */
275 virtual HRESULT newAuxIsoImageMaker(PRTFSISOMAKER phIsoMaker);
276
277 /**
278 * Adds files to the auxiliary ISO image maker.
279 *
280 * The base class implementation copies just the mMainScript and mPostScript
281 * files to root directory using the default filenames.
282 *
283 * @returns COM status code.
284 * @param hIsoMaker The ISO maker handle.
285 * @param hVfsOrgIso The VFS handle to the original ISO in case files
286 * needs to be added from it.
287 */
288 virtual HRESULT addFilesToAuxIsoImageMaker(RTFSISOMAKER hIsoMaker, RTVFS hVfsOrgIso);
289
290 /**
291 * Adds the given script to the ISO maker.
292 *
293 * @returns COM status code.
294 * @param pEditor The script to add.
295 * @param hIsoMaker The ISO maker to add it to.
296 * @param pszDstFilename The file name (w/ path) to add it under. If NULL,
297 * the default script filename is used to add it to the
298 * root.
299 */
300 HRESULT addScriptToIsoMaker(BaseTextScript *pEditor, RTFSISOMAKER hIsoMaker, const char *pszDstFilename = NULL);
301
302 /**
303 * Writes the ISO image to disk.
304 *
305 * @returns COM status code.
306 * @param hIsoMaker The ISO maker handle.
307 * @param pszFilename The filename.
308 * @param fOverwrite Whether to overwrite the destination file or not.
309 */
310 HRESULT finalizeAuxIsoImage(RTFSISOMAKER hIsoMaker, const char *pszFilename, bool fOverwrite);
311
312 /**
313 * Adds files to the .viso-file vectors.
314 *
315 * The base class implementation adds the script from mAlg, additions ISO
316 * content to '/vboxadditions', and validation kit ISO to '/vboxvalidationkit'.
317 *
318 * @returns COM status code.
319 * @param rVecArgs The ISO maker argument list that will be turned into
320 * a .viso-file.
321 * @param rVecFiles The list of files we've created. This is for
322 * cleaning up at the end.
323 * @param hVfsOrgIso The VFS handle to the original ISO in case files
324 * needs to be added from it.
325 * @param fOverwrite Whether to overwrite files or not.
326 */
327 virtual HRESULT addFilesToAuxVisoVectors(RTCList<RTCString> &rVecArgs, RTCList<RTCString> &rVecFiles,
328 RTVFS hVfsOrgIso, bool fOverwrite);
329
330 /**
331 * Saves the given script to disk and adds it to the .viso-file vectors.
332 *
333 * @returns COM status code.
334 * @param pEditor The script to add.
335 * @param rVecArgs The ISO maker argument list that will be turned into
336 * a .viso-file.
337 * @param rVecFiles The list of files we've created. This is for
338 * cleaning up at the end.
339 * @param fOverwrite Whether to overwrite files or not.
340 */
341 HRESULT addScriptToVisoVectors(BaseTextScript *pEditor, RTCList<RTCString> &rVecArgs,
342 RTCList<RTCString> &rVecFiles, bool fOverwrite);
343
344 /**
345 * Writes out the .viso-file to disk.
346 *
347 * @returns COM status code.
348 * @param rVecArgs The ISO maker argument list to write out.
349 * @param pszFilename The filename.
350 * @param fOverwrite Whether to overwrite the destination file or not.
351 */
352 HRESULT finalizeAuxVisoFile(RTCList<RTCString> const &rVecArgs, const char *pszFilename, bool fOverwrite);
353
354 /**
355 * Loads @a pszFilename from @a hVfsOrgIso into @a pEditor and parses it.
356 *
357 * @returns COM status code.
358 * @param hVfsOrgIso The handle to the original installation ISO.
359 * @param pszFilename The filename to open and load from the ISO.
360 * @param pEditor The editor instance to load the file into and
361 * do the parseing with.
362 */
363 HRESULT loadAndParseFileFromIso(RTVFS hVfsOrgIso, const char *pszFilename, AbstractScript *pEditor);
364};
365
366
367/**
368 * Windows installer, for versions up to xp 64 / w2k3.
369 */
370class UnattendedWindowsSifInstaller : public UnattendedInstaller
371{
372public:
373 DECLARE_TRANSLATE_METHODS(UnattendedWindowsSifInstaller)
374
375 UnattendedWindowsSifInstaller(Unattended *pParent)
376 : UnattendedInstaller(pParent,
377 "win_nt5_unattended.sif", "win_postinstall.cmd",
378 "WINNT.SIF", "VBOXPOST.CMD")
379 { Assert(isOriginalIsoNeeded()); Assert(isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); Assert(!bootFromAuxiliaryIso()); }
380 ~UnattendedWindowsSifInstaller() {}
381
382 bool isAuxiliaryFloppyNeeded() const { return true; }
383 bool bootFromAuxiliaryIso() const { return false; }
384
385};
386
387/**
388 * Windows installer, for versions starting with Vista.
389 */
390class UnattendedWindowsXmlInstaller : public UnattendedInstaller
391{
392public:
393 DECLARE_TRANSLATE_METHODS(UnattendedWindowsXmlInstaller)
394
395 UnattendedWindowsXmlInstaller(Unattended *pParent)
396 : UnattendedInstaller(pParent,
397 "win_nt6_unattended.xml", "win_postinstall.cmd",
398 "autounattend.xml", "VBOXPOST.CMD")
399 { Assert(isOriginalIsoNeeded()); Assert(isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); Assert(!bootFromAuxiliaryIso()); }
400 ~UnattendedWindowsXmlInstaller() {}
401
402 bool isAuxiliaryFloppyNeeded() const { return true; }
403 bool bootFromAuxiliaryIso() const { return false; }
404};
405
406
407/**
408 * Base class for the unattended linux installers.
409 */
410class UnattendedLinuxInstaller : public UnattendedInstaller
411{
412protected:
413 /** Array of linux parameter patterns that should be removed by editIsoLinuxCfg.
414 * The patterns are proceed by RTStrSimplePatternNMatch. */
415 RTCList<RTCString, RTCString *> mArrStrRemoveInstallKernelParameters;
416
417public:
418 DECLARE_TRANSLATE_METHODS(UnattendedLinuxInstaller)
419
420 UnattendedLinuxInstaller(Unattended *pParent,
421 const char *pszMainScriptTemplateName, const char *pszPostScriptTemplateName,
422 const char *pszMainScriptFilename, const char *pszPostScriptFilename = "vboxpostinstall.sh")
423 : UnattendedInstaller(pParent,
424 pszMainScriptTemplateName, pszPostScriptTemplateName,
425 pszMainScriptFilename, pszPostScriptFilename) {}
426 ~UnattendedLinuxInstaller() {}
427
428 bool isAuxiliaryIsoNeeded() const { return true; }
429
430protected:
431 /**
432 * Performs basic edits on a isolinux.cfg file.
433 *
434 * @returns COM status code
435 * @param pEditor Editor with the isolinux.cfg file loaded and parsed.
436 */
437 virtual HRESULT editIsoLinuxCfg(GeneralTextScript *pEditor);
438};
439
440
441/**
442 * Debian installer.
443 *
444 * This will remaster the orignal ISO and therefore be producing a .viso-file.
445 */
446class UnattendedDebianInstaller : public UnattendedLinuxInstaller
447{
448public:
449 DECLARE_TRANSLATE_METHODS(UnattendedDebianInstaller)
450
451 UnattendedDebianInstaller(Unattended *pParent,
452 const char *pszMainScriptTemplateName = "debian_preseed.cfg",
453 const char *pszPostScriptTemplateName = "debian_postinstall.sh",
454 const char *pszMainScriptFilename = "preseed.cfg")
455 : UnattendedLinuxInstaller(pParent, pszMainScriptTemplateName, pszPostScriptTemplateName, pszMainScriptFilename)
456 {
457 Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded());
458 Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO());
459 mStrDefaultExtraInstallKernelParameters.setNull();
460 mStrDefaultExtraInstallKernelParameters += " auto=true";
461 mStrDefaultExtraInstallKernelParameters.append(" preseed/file=/cdrom/").append(pszMainScriptFilename);
462 mStrDefaultExtraInstallKernelParameters += " priority=critical";
463 mStrDefaultExtraInstallKernelParameters += " quiet";
464 mStrDefaultExtraInstallKernelParameters += " splash";
465 mStrDefaultExtraInstallKernelParameters += " noprompt"; /* no questions about things like CD/DVD ejections */
466 mStrDefaultExtraInstallKernelParameters += " noshell"; /* No shells on VT1-3 (debian, not ubuntu). */
467 mStrDefaultExtraInstallKernelParameters += " automatic-ubiquity"; // ubiquity
468 // the following can probably go into the preseed.cfg:
469 mStrDefaultExtraInstallKernelParameters.append(" debian-installer/locale=").append(pParent->i_getLocale());
470 mStrDefaultExtraInstallKernelParameters += " keyboard-configuration/layoutcode=us";
471 mStrDefaultExtraInstallKernelParameters += " languagechooser/language-name=English"; /** @todo fixme */
472 mStrDefaultExtraInstallKernelParameters.append(" localechooser/supported-locales=").append(pParent->i_getLocale()).append(".UTF-8");
473 mStrDefaultExtraInstallKernelParameters.append(" countrychooser/shortlist=").append(pParent->i_getCountry()); // ubiquity?
474 mStrDefaultExtraInstallKernelParameters += " --";
475 }
476 ~UnattendedDebianInstaller() {}
477
478 bool isOriginalIsoNeeded() const { return false; }
479
480protected:
481 HRESULT addFilesToAuxVisoVectors(RTCList<RTCString> &rVecArgs, RTCList<RTCString> &rVecFiles,
482 RTVFS hVfsOrgIso, bool fOverwrite);
483 HRESULT editDebianTxtCfg(GeneralTextScript *pEditor);
484
485};
486
487
488/**
489 * Ubuntu installer (same as debian, except for the template).
490 */
491class UnattendedUbuntuInstaller : public UnattendedDebianInstaller
492{
493public:
494 DECLARE_TRANSLATE_METHODS(UnattendedUbuntuInstaller)
495
496 UnattendedUbuntuInstaller(Unattended *pParent)
497 : UnattendedDebianInstaller(pParent, "ubuntu_preseed.cfg")
498 { Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded()); Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); }
499 ~UnattendedUbuntuInstaller() {}
500};
501
502
503/**
504 * RHEL 6 installer.
505 *
506 * This serves as a base for the kickstart based installers.
507 */
508class UnattendedRhel6Installer : public UnattendedLinuxInstaller
509{
510public:
511 DECLARE_TRANSLATE_METHODS(UnattendedRhel6Installer)
512
513 UnattendedRhel6Installer(Unattended *pParent,
514 const char *pszMainScriptTemplateName = "redhat67_ks.cfg",
515 const char *pszPostScriptTemplateName = "redhat_postinstall.sh",
516 const char *pszMainScriptFilename = "ks.cfg")
517 : UnattendedLinuxInstaller(pParent, pszMainScriptTemplateName, pszPostScriptTemplateName, pszMainScriptFilename)
518 {
519 Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded());
520 Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO());
521 mStrDefaultExtraInstallKernelParameters.assign(" ks=cdrom:/").append(pszMainScriptFilename).append(' ');
522 mArrStrRemoveInstallKernelParameters.append("rd.live.check"); /* Disables the checkisomd5 step. Required for VISO. */
523 }
524 ~UnattendedRhel6Installer() {}
525
526 bool isAuxiliaryIsoIsVISO() { return true; }
527 bool isOriginalIsoNeeded() const { return false; }
528
529protected:
530 HRESULT addFilesToAuxVisoVectors(RTCList<RTCString> &rVecArgs, RTCList<RTCString> &rVecFiles,
531 RTVFS hVfsOrgIso, bool fOverwrite);
532};
533
534/**
535 * RHEL 7 installer (same as RHEL 6).
536 * The class was added for better handling any possible subtle difference between RHEL6 and RHEL7.
537 */
538class UnattendedRhel7Installer : public UnattendedRhel6Installer
539{
540public:
541 DECLARE_TRANSLATE_METHODS(UnattendedRhel7Installer)
542
543 UnattendedRhel7Installer(Unattended *pParent)
544 : UnattendedRhel6Installer(pParent)
545 { Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded()); Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); }
546
547 UnattendedRhel7Installer(Unattended *pParent,
548 const char *pszMainScriptTemplateName,
549 const char *pszPostScriptTemplateName,
550 const char *pszMainScriptFilename)
551 : UnattendedRhel6Installer(pParent, pszMainScriptTemplateName, pszPostScriptTemplateName, pszMainScriptFilename)
552 { Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded()); Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); }
553 ~UnattendedRhel7Installer() {}
554};
555
556
557/**
558 * RHEL 8 installer (same as RHEL 7).
559 * The class was added for better handling any possible subtle difference between RHEL7 and RHEL8.
560 */
561class UnattendedRhel8Installer : public UnattendedRhel7Installer
562{
563public:
564 DECLARE_TRANSLATE_METHODS(UnattendedRhel8Installer)
565
566 UnattendedRhel8Installer(Unattended *pParent)
567 : UnattendedRhel7Installer(pParent)
568 { Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded()); Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); }
569
570 UnattendedRhel8Installer(Unattended *pParent,
571 const char *pszMainScriptTemplateName,
572 const char *pszPostScriptTemplateName,
573 const char *pszMainScriptFilename)
574 : UnattendedRhel7Installer(pParent, pszMainScriptTemplateName, pszPostScriptTemplateName, pszMainScriptFilename)
575 { Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded()); Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); }
576 ~UnattendedRhel8Installer() {}
577};
578
579
580/**
581 * RHEL 5 installer (same as RHEL 6, except for the kickstart template).
582 */
583class UnattendedRhel5Installer : public UnattendedRhel6Installer
584{
585public:
586 DECLARE_TRANSLATE_METHODS(UnattendedRhel5Installer)
587
588 UnattendedRhel5Installer(Unattended *pParent) : UnattendedRhel6Installer(pParent, "rhel5_ks.cfg") {}
589 ~UnattendedRhel5Installer() {}
590};
591
592
593/**
594 * RHEL 4 installer (same as RHEL 6, except for the kickstart template).
595 */
596class UnattendedRhel4Installer : public UnattendedRhel6Installer
597{
598public:
599 DECLARE_TRANSLATE_METHODS(UnattendedRhel4Installer)
600
601 UnattendedRhel4Installer(Unattended *pParent) : UnattendedRhel6Installer(pParent, "rhel4_ks.cfg") {}
602 ~UnattendedRhel4Installer() {}
603};
604
605
606/**
607 * RHEL 3 installer (same as RHEL 6, except for the kickstart template).
608 */
609class UnattendedRhel3Installer : public UnattendedRhel6Installer
610{
611public:
612 DECLARE_TRANSLATE_METHODS(UnattendedRhel3Installer)
613
614 UnattendedRhel3Installer(Unattended *pParent) : UnattendedRhel6Installer(pParent, "rhel3_ks.cfg") {}
615 ~UnattendedRhel3Installer() {}
616};
617
618
619/**
620 * Fedora installer (same as RHEL 6, except for the template).
621 */
622class UnattendedFedoraInstaller : public UnattendedRhel6Installer
623{
624public:
625 DECLARE_TRANSLATE_METHODS(UnattendedFedoraInstaller)
626
627 UnattendedFedoraInstaller(Unattended *pParent)
628 : UnattendedRhel6Installer(pParent, "fedora_ks.cfg")
629 { Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded()); Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); }
630 ~UnattendedFedoraInstaller() {}
631};
632
633
634/**
635 * Oracle Linux 6 installer. Same as RHEL 6, except for the templates.
636 * The reason of adding new class is to sepatate the RHEL from OL.
637 */
638class UnattendedOracleLinux6Installer : public UnattendedRhel6Installer
639{
640public:
641 DECLARE_TRANSLATE_METHODS(UnattendedOracleLinux6Installer)
642
643 UnattendedOracleLinux6Installer(Unattended *pParent,
644 const char *pszMainScriptTemplateName = "ol_ks.cfg",
645 const char *pszPostScriptTemplateName = "ol_postinstall.sh",
646 const char *pszMainScriptFilename = "ks.cfg")
647 : UnattendedRhel6Installer(pParent, pszMainScriptTemplateName, pszPostScriptTemplateName, pszMainScriptFilename)
648 { Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded()); Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); }
649 ~UnattendedOracleLinux6Installer() {}
650};
651
652
653/**
654 * Oracle Linux 7 installer. Same as OL 6.
655 * The class was added for better handling any possible subtle difference between OL6 and OL7.
656 */
657class UnattendedOracleLinux7Installer : public UnattendedOracleLinux6Installer
658{
659public:
660 DECLARE_TRANSLATE_METHODS(UnattendedOracleLinux7Installer)
661
662 UnattendedOracleLinux7Installer(Unattended *pParent)
663 : UnattendedOracleLinux6Installer(pParent)
664 { Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded()); Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); }
665
666 UnattendedOracleLinux7Installer(Unattended *pParent,
667 const char *pszMainScriptTemplateName,
668 const char *pszPostScriptTemplateName,
669 const char *pszMainScriptFilename)
670 : UnattendedOracleLinux6Installer(pParent, pszMainScriptTemplateName, pszPostScriptTemplateName, pszMainScriptFilename)
671 { Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded()); Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); }
672 ~UnattendedOracleLinux7Installer() {}
673};
674
675
676/**
677 * Oracle Linux 8 installer. Same as OL 7.
678 * The class was added for better handling any possible subtle difference between OL7 and OL8.
679 */
680class UnattendedOracleLinux8Installer : public UnattendedOracleLinux7Installer
681{
682public:
683 DECLARE_TRANSLATE_METHODS(UnattendedOracleLinux8Installer)
684
685 UnattendedOracleLinux8Installer(Unattended *pParent)
686 : UnattendedOracleLinux7Installer(pParent)
687 { Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded()); Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); }
688
689 UnattendedOracleLinux8Installer(Unattended *pParent,
690 const char *pszMainScriptTemplateName,
691 const char *pszPostScriptTemplateName,
692 const char *pszMainScriptFilename)
693 : UnattendedOracleLinux7Installer(pParent, pszMainScriptTemplateName, pszPostScriptTemplateName, pszMainScriptFilename)
694 { Assert(!isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded()); Assert(!isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); }
695 ~UnattendedOracleLinux8Installer() {}
696};
697
698#if 0 /* fixme */
699/**
700 * SUSE linux installer.
701 *
702 * @todo needs fixing.
703 */
704class UnattendedSuseInstaller : public UnattendedLinuxInstaller
705{
706public:
707 DECLARE_TRANSLATE_METHODS(UnattendedSuseInstaller)
708
709 UnattendedSuseInstaller(BaseTextScript *pAlg, Unattended *pParent)
710 : UnattendedLinuxInstaller(pAlg, pParent, "suse_autoinstall.xml")
711 { Assert(isOriginalIsoNeeded()); Assert(isAuxiliaryIsoNeeded()); Assert(!isAuxiliaryFloppyNeeded()); Assert(!isAuxiliaryIsoIsVISO()); }
712 ~UnattendedSuseInstaller() {}
713
714 HRESULT setupScriptOnAuxiliaryCD(const Utf8Str &path);
715};
716#endif
717
718#endif /* !MAIN_INCLUDED_UnattendedInstaller_h */
719
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