1 | /** @file
|
---|
2 | * IPRT - ISO Image Maker.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2017 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef ___iprt_fsisomaker_h
|
---|
27 | #define ___iprt_fsisomaker_h
|
---|
28 |
|
---|
29 | #include <iprt/cdefs.h>
|
---|
30 | #include <iprt/types.h>
|
---|
31 | #include <iprt/time.h>
|
---|
32 | #include <iprt/fs.h>
|
---|
33 |
|
---|
34 |
|
---|
35 | RT_C_DECLS_BEGIN
|
---|
36 |
|
---|
37 | /** @defgroup grp_rt_fsisomaker RTFsIsoMaker - ISO Image Maker
|
---|
38 | * @ingroup grp_rt_fs
|
---|
39 | * @{
|
---|
40 | */
|
---|
41 |
|
---|
42 |
|
---|
43 | /** @name RTFSISOMAKER_NAMESPACE_XXX - Namespace selector.
|
---|
44 | * @{
|
---|
45 | */
|
---|
46 | #define RTFSISOMAKER_NAMESPACE_ISO_9660 RT_BIT_32(0) /**< The primary ISO-9660 namespace. */
|
---|
47 | #define RTFSISOMAKER_NAMESPACE_JOLIET RT_BIT_32(1) /**< The joliet namespace. */
|
---|
48 | #define RTFSISOMAKER_NAMESPACE_UDF RT_BIT_32(2) /**< The UDF namespace. */
|
---|
49 | #define RTFSISOMAKER_NAMESPACE_HFS RT_BIT_32(3) /**< The HFS namespace */
|
---|
50 | #define RTFSISOMAKER_NAMESPACE_ALL UINT32_C(0x0000000f) /**< All namespaces. */
|
---|
51 | #define RTFSISOMAKER_NAMESPACE_VALID_MASK UINT32_C(0x0000000f) /**< Valid namespace bits. */
|
---|
52 | /** @} */
|
---|
53 |
|
---|
54 | /** Root directory configuration index. */
|
---|
55 | #define RTFSISOMAKER_CFG_IDX_ROOT UINT32_C(0)
|
---|
56 |
|
---|
57 |
|
---|
58 | /**
|
---|
59 | * Creates an ISO maker instance.
|
---|
60 | *
|
---|
61 | * @returns IPRT status code.
|
---|
62 | * @param phIsoMaker Where to return the handle to the new ISO maker.
|
---|
63 | */
|
---|
64 | RTDECL(int) RTFsIsoMakerCreate(PRTFSISOMAKER phIsoMaker);
|
---|
65 |
|
---|
66 | /**
|
---|
67 | * Retains a references to an ISO maker instance.
|
---|
68 | *
|
---|
69 | * @returns New reference count on success, UINT32_MAX if invalid handle.
|
---|
70 | * @param hIsoMaker The ISO maker handle.
|
---|
71 | */
|
---|
72 | RTDECL(uint32_t) RTFsIsoMakerRetain(RTFSISOMAKER hIsoMaker);
|
---|
73 |
|
---|
74 | /**
|
---|
75 | * Releases a references to an ISO maker instance.
|
---|
76 | *
|
---|
77 | * @returns New reference count on success, UINT32_MAX if invalid handle.
|
---|
78 | * @param hIsoMaker The ISO maker handle. NIL is ignored.
|
---|
79 | */
|
---|
80 | RTDECL(uint32_t) RTFsIsoMakerRelease(RTFSISOMAKER hIsoMaker);
|
---|
81 |
|
---|
82 | /**
|
---|
83 | * Sets the ISO-9660 level.
|
---|
84 | *
|
---|
85 | * @returns IPRT status code
|
---|
86 | * @param hIsoMaker The ISO maker handle.
|
---|
87 | * @param uIsoLevel The level, 1-3.
|
---|
88 | */
|
---|
89 | RTDECL(int) RTFsIsoMakerSetIso9660Level(RTFSISOMAKER hIsoMaker, uint8_t uIsoLevel);
|
---|
90 |
|
---|
91 | /**
|
---|
92 | * Sets the joliet level.
|
---|
93 | *
|
---|
94 | * @returns IPRT status code
|
---|
95 | * @param hIsoMaker The ISO maker handle.
|
---|
96 | * @param uJolietLevel The joliet UCS-2 level 1-3, or 0 to disable
|
---|
97 | * joliet.
|
---|
98 | */
|
---|
99 | RTDECL(int) RTFsIsoMakerSetJolietUcs2Level(RTFSISOMAKER hIsoMaker, uint8_t uJolietLevel);
|
---|
100 |
|
---|
101 | /**
|
---|
102 | * Sets the rock ridge support level (on the primary ISO-9660 namespace).
|
---|
103 | *
|
---|
104 | * @returns IPRT status code
|
---|
105 | * @param hIsoMaker The ISO maker handle.
|
---|
106 | * @param uLevel 0 if disabled, 1 to just enable, 2 to enable and
|
---|
107 | * write the ER tag.
|
---|
108 | */
|
---|
109 | RTDECL(int) RTFsIsoMakerSetRockRidgeLevel(RTFSISOMAKER hIsoMaker, uint8_t uLevel);
|
---|
110 |
|
---|
111 | /**
|
---|
112 | * Sets the rock ridge support level on the joliet namespace (experimental).
|
---|
113 | *
|
---|
114 | * @returns IPRT status code
|
---|
115 | * @param hIsoMaker The ISO maker handle.
|
---|
116 | * @param uLevel 0 if disabled, 1 to just enable, 2 to enable and
|
---|
117 | * write the ER tag.
|
---|
118 | */
|
---|
119 | RTDECL(int) RTFsIsoMakerSetJolietRockRidgeLevel(RTFSISOMAKER hIsoMaker, uint8_t uLevel);
|
---|
120 |
|
---|
121 | /**
|
---|
122 | * Sets the default file mode settings.
|
---|
123 | *
|
---|
124 | * @returns IRPT status code.
|
---|
125 | * @param hIsoMaker The ISO maker handle.
|
---|
126 | * @param fMode The default file mode.
|
---|
127 | */
|
---|
128 | RTDECL(int) RTFsIsoMakerSetDefaultFileMode(RTFSISOMAKER hIsoMaker, RTFMODE fMode);
|
---|
129 |
|
---|
130 | /**
|
---|
131 | * Sets the default dir mode settings.
|
---|
132 | *
|
---|
133 | * @returns IRPT status code.
|
---|
134 | * @param hIsoMaker The ISO maker handle.
|
---|
135 | * @param fMode The default dir mode.
|
---|
136 | */
|
---|
137 | RTDECL(int) RTFsIsoMakerSetDefaultDirMode(RTFSISOMAKER hIsoMaker, RTFMODE fMode);
|
---|
138 |
|
---|
139 | /**
|
---|
140 | * Sets the forced file mode, if @a fForce is true also the default mode is set.
|
---|
141 | *
|
---|
142 | * @returns IRPT status code.
|
---|
143 | * @param hIsoMaker The ISO maker handle.
|
---|
144 | * @param fMode The file mode.
|
---|
145 | * @param fForce Indicate whether forced mode is active or not.
|
---|
146 | */
|
---|
147 | RTDECL(int) RTFsIsoMakerSetForcedFileMode(RTFSISOMAKER hIsoMaker, RTFMODE fMode, bool fForce);
|
---|
148 |
|
---|
149 | /**
|
---|
150 | * Sets the forced dir mode, if @a fForce is true also the default mode is set.
|
---|
151 | *
|
---|
152 | * @returns IRPT status code.
|
---|
153 | * @param hIsoMaker The ISO maker handle.
|
---|
154 | * @param fMode The dir mode.
|
---|
155 | * @param fForce Indicate whether forced mode is active or not.
|
---|
156 | */
|
---|
157 | RTDECL(int) RTFsIsoMakerSetForcedDirMode(RTFSISOMAKER hIsoMaker, RTFMODE fMode, bool fForce);
|
---|
158 |
|
---|
159 | /**
|
---|
160 | * Sets the content of the system area, i.e. the first 32KB of the image.
|
---|
161 | *
|
---|
162 | * This can be used to put generic boot related stuff.
|
---|
163 | *
|
---|
164 | * @note Other settings may overwrite parts of the content (yet to be
|
---|
165 | * determined which).
|
---|
166 | *
|
---|
167 | * @returns IPRT status code
|
---|
168 | * @param hIsoMaker The ISO maker handle.
|
---|
169 | * @param pvContent The content to put in the system area.
|
---|
170 | * @param cbContent The size of the content.
|
---|
171 | * @param off The offset into the system area.
|
---|
172 | */
|
---|
173 | RTDECL(int) RTFsIsoMakerSetSysAreaContent(RTFSISOMAKER hIsoMaker, void const *pvContent, size_t cbContent, uint32_t off);
|
---|
174 |
|
---|
175 | /**
|
---|
176 | * String properties settable thru RTFsIsoMakerSetStringProp.
|
---|
177 | */
|
---|
178 | typedef enum RTFSISOMAKERSTRINGPROP
|
---|
179 | {
|
---|
180 | /** The customary invalid zero value. */
|
---|
181 | RTFSISOMAKERSTRINGPROP_INVALID = 0,
|
---|
182 | /** The system identifier. */
|
---|
183 | RTFSISOMAKERSTRINGPROP_SYSTEM_ID,
|
---|
184 | /** The volume identifier(label). */
|
---|
185 | RTFSISOMAKERSTRINGPROP_VOLUME_ID,
|
---|
186 | /** The volume set identifier. */
|
---|
187 | RTFSISOMAKERSTRINGPROP_VOLUME_SET_ID,
|
---|
188 | /** The publisher ID (root file reference if it starts with '_'). */
|
---|
189 | RTFSISOMAKERSTRINGPROP_PUBLISHER_ID,
|
---|
190 | /** The data preparer ID (root file reference if it starts with '_'). */
|
---|
191 | RTFSISOMAKERSTRINGPROP_DATA_PREPARER_ID,
|
---|
192 | /** The application ID (root file reference if it starts with '_'). */
|
---|
193 | RTFSISOMAKERSTRINGPROP_APPLICATION_ID,
|
---|
194 | /** The copyright file ID. */
|
---|
195 | RTFSISOMAKERSTRINGPROP_COPYRIGHT_FILE_ID,
|
---|
196 | /** The abstract file ID. */
|
---|
197 | RTFSISOMAKERSTRINGPROP_ABSTRACT_FILE_ID,
|
---|
198 | /** The bibliographic file ID. */
|
---|
199 | RTFSISOMAKERSTRINGPROP_BIBLIOGRAPHIC_FILE_ID,
|
---|
200 | /** End of valid string property values. */
|
---|
201 | RTFSISOMAKERSTRINGPROP_END,
|
---|
202 | /** Make sure it's a 32-bit type. */
|
---|
203 | RTFSISOMAKERSTRINGPROP_32BIT_HACK = 0x7fffffff
|
---|
204 | } RTFSISOMAKERSTRINGPROP;
|
---|
205 |
|
---|
206 | /**
|
---|
207 | * Sets a string property in one or more namespaces.
|
---|
208 | *
|
---|
209 | * @returns IPRT status code.
|
---|
210 | * @param hIsoMaker The ISO maker handle.
|
---|
211 | * @param enmStringProp The string property to set.
|
---|
212 | * @param fNamespaces The namespaces to set it in.
|
---|
213 | * @param pszValue The value to set it to. NULL is treated like an
|
---|
214 | * empty string. The value will be silently truncated
|
---|
215 | * to fit the available space.
|
---|
216 | */
|
---|
217 | RTDECL(int) RTFsIsoMakerSetStringProp(RTFSISOMAKER hIsoMaker, RTFSISOMAKERSTRINGPROP enmStringProp,
|
---|
218 | uint32_t fNamespaces, const char *pszValue);
|
---|
219 |
|
---|
220 | /**
|
---|
221 | * Resolves a path into a object ID.
|
---|
222 | *
|
---|
223 | * This will be doing the looking up using the specified object names rather
|
---|
224 | * than the version adjusted and mangled according to the namespace setup.
|
---|
225 | *
|
---|
226 | * @returns The object ID corresponding to @a pszPath, or UINT32_MAX if not
|
---|
227 | * found or invalid parameters.
|
---|
228 | * @param hIsoMaker The ISO maker instance.
|
---|
229 | * @param fNamespaces The namespace to resolve @a pszPath in. It's
|
---|
230 | * possible to specify multiple namespaces here, of
|
---|
231 | * course, but that's inefficient.
|
---|
232 | * @param pszPath The path to the object.
|
---|
233 | */
|
---|
234 | RTDECL(uint32_t) RTFsIsoMakerGetObjIdxForPath(RTFSISOMAKER hIsoMaker, uint32_t fNamespaces, const char *pszPath);
|
---|
235 |
|
---|
236 | /**
|
---|
237 | * Queries the configuration index of the boot catalog file object.
|
---|
238 | *
|
---|
239 | * The boot catalog file is created as necessary, thus this have to be a query
|
---|
240 | * rather than a getter since object creation may fail.
|
---|
241 | *
|
---|
242 | * @returns IPRT status code.
|
---|
243 | * @param hIsoMaker The ISO maker handle.
|
---|
244 | * @param pidxObj Where to return the configuration index.
|
---|
245 | */
|
---|
246 | RTDECL(int) RTFsIsoMakerQueryObjIdxForBootCatalog(RTFSISOMAKER hIsoMaker, uint32_t *pidxObj);
|
---|
247 |
|
---|
248 | /**
|
---|
249 | * Removes the specified object from the image.
|
---|
250 | *
|
---|
251 | * @returns IPRT status code.
|
---|
252 | * @param hIsoMaker The ISO maker instance.
|
---|
253 | * @param idxObj The index of the object to remove.
|
---|
254 | */
|
---|
255 | RTDECL(int) RTFsIsoMakerObjRemove(RTFSISOMAKER hIsoMaker, uint32_t idxObj);
|
---|
256 |
|
---|
257 | /**
|
---|
258 | * Sets the path (name) of an object in the selected namespaces.
|
---|
259 | *
|
---|
260 | * The name will be transformed as necessary.
|
---|
261 | *
|
---|
262 | * The initial implementation does not allow this function to be called more
|
---|
263 | * than once on an object.
|
---|
264 | *
|
---|
265 | * @returns IPRT status code.
|
---|
266 | * @param hIsoMaker The ISO maker handle.
|
---|
267 | * @param idxObj The configuration index of to name.
|
---|
268 | * @param fNamespaces The namespaces to apply the path to
|
---|
269 | * (RTFSISOMAKER_NAMESPACE_XXX).
|
---|
270 | * @param pszPath The path.
|
---|
271 | */
|
---|
272 | RTDECL(int) RTFsIsoMakerObjSetPath(RTFSISOMAKER hIsoMaker, uint32_t idxObj, uint32_t fNamespaces, const char *pszPath);
|
---|
273 |
|
---|
274 | /**
|
---|
275 | * Sets the name of an object in the selected namespaces, placing it under the
|
---|
276 | * given directory.
|
---|
277 | *
|
---|
278 | * The name will be transformed as necessary.
|
---|
279 | *
|
---|
280 | * @returns IPRT status code.
|
---|
281 | * @param hIsoMaker The ISO maker handle.
|
---|
282 | * @param idxObj The configuration index of to name.
|
---|
283 | * @param idxParentObj The parent directory object.
|
---|
284 | * @param fNamespaces The namespaces to apply the path to
|
---|
285 | * (RTFSISOMAKER_NAMESPACE_XXX).
|
---|
286 | * @param pszName The name.
|
---|
287 | */
|
---|
288 | RTDECL(int) RTFsIsoMakerObjSetNameAndParent(RTFSISOMAKER hIsoMaker, uint32_t idxObj, uint32_t idxParentObj,
|
---|
289 | uint32_t fNamespaces, const char *pszName);
|
---|
290 |
|
---|
291 | /**
|
---|
292 | * Changes the rock ridge name for the object in the selected namespaces.
|
---|
293 | *
|
---|
294 | * The object must already be enetered into the namespaces by
|
---|
295 | * RTFsIsoMakerObjSetNameAndParent, RTFsIsoMakerObjSetPath or similar.
|
---|
296 | *
|
---|
297 | * @returns IPRT status code.
|
---|
298 | * @param hIsoMaker The ISO maker handle.
|
---|
299 | * @param idxObj The configuration index of to name.
|
---|
300 | * @param fNamespaces The namespaces to apply the path to
|
---|
301 | * (RTFSISOMAKER_NAMESPACE_XXX).
|
---|
302 | * @param pszRockName The rock ridge name. Passing NULL or an empty
|
---|
303 | * string will restore the specified name.
|
---|
304 | */
|
---|
305 | RTDECL(int) RTFsIsoMakerObjSetRockName(RTFSISOMAKER hIsoMaker, uint32_t idxObj, uint32_t fNamespaces, const char *pszRockName);
|
---|
306 |
|
---|
307 | /**
|
---|
308 | * Enables or disable syslinux boot info table patching of a file.
|
---|
309 | *
|
---|
310 | * @returns IPRT status code.
|
---|
311 | * @param hIsoMaker The ISO maker handle.
|
---|
312 | * @param idxObj The configuration index.
|
---|
313 | * @param fEnable Whether to enable or disable patching.
|
---|
314 | */
|
---|
315 | RTDECL(int) RTFsIsoMakerObjEnableBootInfoTablePatching(RTFSISOMAKER hIsoMaker, uint32_t idxObj, bool fEnable);
|
---|
316 |
|
---|
317 | /**
|
---|
318 | * Gets the data size of an object.
|
---|
319 | *
|
---|
320 | * Currently only supported on file objects.
|
---|
321 | *
|
---|
322 | * @returns IPRT status code.
|
---|
323 | * @param hIsoMaker The ISO maker handle.
|
---|
324 | * @param idxObj The configuration index.
|
---|
325 | * @param pcbData Where to return the size.
|
---|
326 | */
|
---|
327 | RTDECL(int) RTFsIsoMakerObjQueryDataSize(RTFSISOMAKER hIsoMaker, uint32_t idxObj, uint64_t *pcbData);
|
---|
328 |
|
---|
329 | /**
|
---|
330 | * Adds an unnamed directory to the image.
|
---|
331 | *
|
---|
332 | * The directory must explictly be entered into the desired namespaces.
|
---|
333 | *
|
---|
334 | * @returns IPRT status code
|
---|
335 | * @param hIsoMaker The ISO maker handle.
|
---|
336 | * @param pObjInfo Pointer to object attributes, must be set to
|
---|
337 | * UNIX. The size and hardlink counts are ignored.
|
---|
338 | * Optional.
|
---|
339 | * @param pidxObj Where to return the configuration index of the
|
---|
340 | * directory.
|
---|
341 | * @sa RTFsIsoMakerAddDir, RTFsIsoMakerObjSetPath
|
---|
342 | */
|
---|
343 | RTDECL(int) RTFsIsoMakerAddUnnamedDir(RTFSISOMAKER hIsoMaker, PCRTFSOBJINFO pObjInfo, uint32_t *pidxObj);
|
---|
344 |
|
---|
345 | /**
|
---|
346 | * Adds a directory to the image in all namespaces and default attributes.
|
---|
347 | *
|
---|
348 | * @returns IPRT status code
|
---|
349 | * @param hIsoMaker The ISO maker handle.
|
---|
350 | * @param pszDir The path (UTF-8) to the directory in the ISO.
|
---|
351 | *
|
---|
352 | * @param pidxObj Where to return the configuration index of the
|
---|
353 | * directory. Optional.
|
---|
354 | * @sa RTFsIsoMakerAddUnnamedDir, RTFsIsoMakerObjSetPath
|
---|
355 | */
|
---|
356 | RTDECL(int) RTFsIsoMakerAddDir(RTFSISOMAKER hIsoMaker, const char *pszDir, uint32_t *pidxObj);
|
---|
357 |
|
---|
358 | /**
|
---|
359 | * Adds an unnamed file to the image that's backed by a host file.
|
---|
360 | *
|
---|
361 | * The file must explictly be entered into the desired namespaces.
|
---|
362 | *
|
---|
363 | * @returns IPRT status code
|
---|
364 | * @param hIsoMaker The ISO maker handle.
|
---|
365 | * @param pszSrcFile The source file path. VFS chain spec allowed.
|
---|
366 | * @param pidxObj Where to return the configuration index of the
|
---|
367 | * directory.
|
---|
368 | * @sa RTFsIsoMakerAddFile, RTFsIsoMakerObjSetPath
|
---|
369 | */
|
---|
370 | RTDECL(int) RTFsIsoMakerAddUnnamedFileWithSrcPath(RTFSISOMAKER hIsoMaker, const char *pszSrcFile, uint32_t *pidxObj);
|
---|
371 |
|
---|
372 | /**
|
---|
373 | * Adds an unnamed file to the image that's backed by a VFS file.
|
---|
374 | *
|
---|
375 | * The file must explictly be entered into the desired namespaces.
|
---|
376 | *
|
---|
377 | * @returns IPRT status code
|
---|
378 | * @param hIsoMaker The ISO maker handle.
|
---|
379 | * @param hVfsFileSrc The source file handle.
|
---|
380 | * @param pidxObj Where to return the configuration index of the
|
---|
381 | * directory.
|
---|
382 | * @sa RTFsIsoMakerAddUnnamedFileWithSrcPath, RTFsIsoMakerObjSetPath
|
---|
383 | */
|
---|
384 | RTDECL(int) RTFsIsoMakerAddUnnamedFileWithVfsFile(RTFSISOMAKER hIsoMaker, RTVFSFILE hVfsFileSrc, uint32_t *pidxObj);
|
---|
385 |
|
---|
386 | /**
|
---|
387 | * Adds an unnamed file to the image that's backed by a portion of a common
|
---|
388 | * source file.
|
---|
389 | *
|
---|
390 | * The file must explictly be entered into the desired namespaces.
|
---|
391 | *
|
---|
392 | * @returns IPRT status code
|
---|
393 | * @param hIsoMaker The ISO maker handle.
|
---|
394 | * @param idxCommonSrc The common source file index.
|
---|
395 | * @param offData The offset of the data in the source file.
|
---|
396 | * @param cbData The file size.
|
---|
397 | * @param pObjInfo Pointer to file info. Optional.
|
---|
398 | * @param pidxObj Where to return the configuration index of the
|
---|
399 | * directory.
|
---|
400 | * @sa RTFsIsoMakerAddUnnamedFileWithSrcPath, RTFsIsoMakerObjSetPath
|
---|
401 | */
|
---|
402 | RTDECL(int) RTFsIsoMakerAddUnnamedFileWithCommonSrc(RTFSISOMAKER hIsoMaker, uint32_t idxCommonSrc,
|
---|
403 | uint64_t offData, uint64_t cbData, PCRTFSOBJINFO pObjInfo, uint32_t *pidxObj);
|
---|
404 |
|
---|
405 | /**
|
---|
406 | * Adds a common source file.
|
---|
407 | *
|
---|
408 | * Using RTFsIsoMakerAddUnnamedFileWithCommonSrc a sections common source file
|
---|
409 | * can be referenced to make up other files. The typical use case is when
|
---|
410 | * importing data from an existing ISO.
|
---|
411 | *
|
---|
412 | * @returns IPRT status code
|
---|
413 | * @param hIsoMaker The ISO maker handle.
|
---|
414 | * @param hVfsFile VFS handle of the common source. (A reference
|
---|
415 | * is added, none consumed.)
|
---|
416 | * @param pidxCommonSrc Where to return the assigned common source
|
---|
417 | * index. This is used to reference the file.
|
---|
418 | * @sa RTFsIsoMakerAddUnnamedFileWithCommonSrc
|
---|
419 | */
|
---|
420 | RTDECL(int) RTFsIsoMakerAddCommonSourceFile(RTFSISOMAKER hIsoMaker, RTVFSFILE hVfsFile, uint32_t *pidxCommonSrc);
|
---|
421 |
|
---|
422 | /**
|
---|
423 | * Adds a file that's backed by a host file to the image in all namespaces and
|
---|
424 | * with attributes taken from the source file.
|
---|
425 | *
|
---|
426 | * @returns IPRT status code
|
---|
427 | * @param hIsoMaker The ISO maker handle.
|
---|
428 | * @param pszFile The path to the file in the image.
|
---|
429 | * @param pszSrcFile The source file path. VFS chain spec allowed.
|
---|
430 | * @param pidxObj Where to return the configuration index of the file.
|
---|
431 | * Optional
|
---|
432 | * @sa RTFsIsoMakerAddFileWithVfsFile,
|
---|
433 | * RTFsIsoMakerAddUnnamedFileWithSrcPath
|
---|
434 | */
|
---|
435 | RTDECL(int) RTFsIsoMakerAddFileWithSrcPath(RTFSISOMAKER hIsoMaker, const char *pszFile, const char *pszSrcFile, uint32_t *pidxObj);
|
---|
436 |
|
---|
437 | /**
|
---|
438 | * Adds a file that's backed by a VFS file to the image in all namespaces and
|
---|
439 | * with attributes taken from the source file.
|
---|
440 | *
|
---|
441 | * @returns IPRT status code
|
---|
442 | * @param hIsoMaker The ISO maker handle.
|
---|
443 | * @param pszFile The path to the file in the image.
|
---|
444 | * @param hVfsFileSrc The source file handle.
|
---|
445 | * @param pidxObj Where to return the configuration index of the file.
|
---|
446 | * Optional.
|
---|
447 | * @sa RTFsIsoMakerAddUnnamedFileWithVfsFile,
|
---|
448 | * RTFsIsoMakerAddFileWithSrcPath
|
---|
449 | */
|
---|
450 | RTDECL(int) RTFsIsoMakerAddFileWithVfsFile(RTFSISOMAKER hIsoMaker, const char *pszFile, RTVFSFILE hVfsFileSrc, uint32_t *pidxObj);
|
---|
451 |
|
---|
452 | /**
|
---|
453 | * Adds an unnamed symbolic link to the image.
|
---|
454 | *
|
---|
455 | * The symlink must explictly be entered into the desired namespaces. Please
|
---|
456 | * note that it is not possible to enter a symbolic link into an ISO 9660
|
---|
457 | * namespace where rock ridge extensions are disabled, since symbolic links
|
---|
458 | * depend on rock ridge. For HFS and UDF there is no such requirement.
|
---|
459 | *
|
---|
460 | * Will fail if no namespace is configured that supports symlinks.
|
---|
461 | *
|
---|
462 | * @returns IPRT status code
|
---|
463 | * @retval VERR_ISOMK_SYMLINK_SUPPORT_DISABLED if not supported.
|
---|
464 | * @param hIsoMaker The ISO maker handle.
|
---|
465 | * @param pObjInfo Pointer to object attributes, must be set to
|
---|
466 | * UNIX. The size and hardlink counts are ignored.
|
---|
467 | * Optional.
|
---|
468 | * @param pszTarget The symbolic link target (UTF-8).
|
---|
469 | * @param pidxObj Where to return the configuration index of the
|
---|
470 | * directory.
|
---|
471 | * @sa RTFsIsoMakerAddSymlink, RTFsIsoMakerObjSetPath
|
---|
472 | */
|
---|
473 | RTDECL(int) RTFsIsoMakerAddUnnamedSymlink(RTFSISOMAKER hIsoMaker, PCRTFSOBJINFO pObjInfo, const char *pszTarget, uint32_t *pidxObj);
|
---|
474 |
|
---|
475 | /**
|
---|
476 | * Adds a directory to the image in all namespaces and default attributes.
|
---|
477 | *
|
---|
478 | * Will fail if no namespace is configured that supports symlinks.
|
---|
479 | *
|
---|
480 | * @returns IPRT status code
|
---|
481 | * @param hIsoMaker The ISO maker handle.
|
---|
482 | * @param pszSymlink The path (UTF-8) to the symlink in the ISO.
|
---|
483 | * @param pszTarget The symlink target (UTF-8).
|
---|
484 | * @param pidxObj Where to return the configuration index of the
|
---|
485 | * directory. Optional.
|
---|
486 | * @sa RTFsIsoMakerAddUnnamedSymlink, RTFsIsoMakerObjSetPath
|
---|
487 | */
|
---|
488 | RTDECL(int) RTFsIsoMakerAddSymlink(RTFSISOMAKER hIsoMaker, const char *pszSymlink, const char *pszTarget, uint32_t *pidxObj);
|
---|
489 |
|
---|
490 | /**
|
---|
491 | * Set the validation entry of the boot catalog (this is the first entry).
|
---|
492 | *
|
---|
493 | * @returns IPRT status code.
|
---|
494 | * @param hIsoMaker The ISO maker handle.
|
---|
495 | * @param idPlatform The platform ID
|
---|
496 | * (ISO9660_ELTORITO_PLATFORM_ID_XXX).
|
---|
497 | * @param pszString CD/DVD-ROM identifier. Optional.
|
---|
498 | */
|
---|
499 | RTDECL(int) RTFsIsoMakerBootCatSetValidationEntry(RTFSISOMAKER hIsoMaker, uint8_t idPlatform, const char *pszString);
|
---|
500 |
|
---|
501 | /**
|
---|
502 | * Set the validation entry of the boot catalog (this is the first entry).
|
---|
503 | *
|
---|
504 | * @returns IPRT status code.
|
---|
505 | * @param hIsoMaker The ISO maker handle.
|
---|
506 | * @param idxBootCat The boot catalog entry. Zero and two are
|
---|
507 | * invalid. Must be less than 63.
|
---|
508 | * @param idxImageObj The configuration index of the boot image.
|
---|
509 | * @param bBootMediaType The media type and flag (not for entry 1)
|
---|
510 | * (ISO9660_ELTORITO_BOOT_MEDIA_TYPE_XXX,
|
---|
511 | * ISO9660_ELTORITO_BOOT_MEDIA_F_XXX).
|
---|
512 | * @param bSystemType The partitiona table system ID.
|
---|
513 | * @param fBootable Whether it's a bootable entry or if we just want
|
---|
514 | * the BIOS to setup the emulation without booting
|
---|
515 | * it.
|
---|
516 | * @param uLoadSeg The load address divided by 0x10 (i.e. the real
|
---|
517 | * mode segment number).
|
---|
518 | * @param cSectorsToLoad Number of emulated sectors to load.
|
---|
519 | * @param bSelCritType The selection criteria type, if none pass
|
---|
520 | * ISO9660_ELTORITO_SEL_CRIT_TYPE_NONE.
|
---|
521 | * @param pvSelCritData Pointer to the selection criteria data.
|
---|
522 | * @param cbSelCritData Size of the selection criteria data.
|
---|
523 | */
|
---|
524 | RTDECL(int) RTFsIsoMakerBootCatSetSectionEntry(RTFSISOMAKER hIsoMaker, uint32_t idxBootCat, uint32_t idxImageObj,
|
---|
525 | uint8_t bBootMediaType, uint8_t bSystemType, bool fBootable,
|
---|
526 | uint16_t uLoadSeg, uint16_t cSectorsToLoad,
|
---|
527 | uint8_t bSelCritType, void const *pvSelCritData, size_t cbSelCritData);
|
---|
528 |
|
---|
529 | /**
|
---|
530 | * Set the validation entry of the boot catalog (this is the first entry).
|
---|
531 | *
|
---|
532 | * @returns IPRT status code.
|
---|
533 | * @param hIsoMaker The ISO maker handle.
|
---|
534 | * @param idxBootCat The boot catalog entry.
|
---|
535 | * @param cEntries Number of entries in the section.
|
---|
536 | * @param idPlatform The platform ID
|
---|
537 | * (ISO9660_ELTORITO_PLATFORM_ID_XXX).
|
---|
538 | * @param pszString Section identifier or something. Optional.
|
---|
539 | */
|
---|
540 | RTDECL(int) RTFsIsoMakerBootCatSetSectionHeaderEntry(RTFSISOMAKER hIsoMaker, uint32_t idxBootCat, uint32_t cEntries,
|
---|
541 | uint8_t idPlatform, const char *pszString);
|
---|
542 |
|
---|
543 | /**
|
---|
544 | * Sets the boot catalog backing file.
|
---|
545 | *
|
---|
546 | * The content of the given file will be discarded and replaced with the boot
|
---|
547 | * catalog, the naming and file attributes (other than size) will be retained.
|
---|
548 | *
|
---|
549 | * This API exists mainly to assist when importing ISOs.
|
---|
550 | *
|
---|
551 | * @returns IPRT status code.
|
---|
552 | * @param hIsoMaker The ISO maker handle.
|
---|
553 | * @param idxObj The configuration index of the file.
|
---|
554 | */
|
---|
555 | RTDECL(int) RTFsIsoMakerBootCatSetFile(RTFSISOMAKER hIsoMaker, uint32_t idxObj);
|
---|
556 |
|
---|
557 |
|
---|
558 | /**
|
---|
559 | * ISO maker import results (RTFsIsoMakerImport).
|
---|
560 | */
|
---|
561 | typedef struct RTFSISOMAKERIMPORTRESULTS
|
---|
562 | {
|
---|
563 | /** Number of names added. */
|
---|
564 | uint32_t cAddedNames;
|
---|
565 | /** Number of directories added. */
|
---|
566 | uint32_t cAddedDirs;
|
---|
567 | /** Amount of added data blocks, files only. */
|
---|
568 | uint64_t cbAddedDataBlocks;
|
---|
569 | /** Number of unique files added (unique in terms of data location). */
|
---|
570 | uint32_t cAddedFiles;
|
---|
571 | /** Number of symbolic links added. */
|
---|
572 | uint32_t cAddedSymlinks;
|
---|
573 | /** Number of imported boot catalog entries. */
|
---|
574 | uint32_t cBootCatEntries;
|
---|
575 | /** Number of system area bytes imported (from offset zero). */
|
---|
576 | uint32_t cbSysArea;
|
---|
577 |
|
---|
578 | /** Number of import errors. */
|
---|
579 | uint32_t cErrors;
|
---|
580 | /** Where to return the offset of the failing path element.
|
---|
581 | * Set to UINT32_MAX if not a VFS chaining error. */
|
---|
582 | uint32_t offError;
|
---|
583 | } RTFSISOMAKERIMPORTRESULTS;
|
---|
584 | /** Pointer to ISO maker import results. */
|
---|
585 | typedef RTFSISOMAKERIMPORTRESULTS *PRTFSISOMAKERIMPORTRESULTS;
|
---|
586 |
|
---|
587 | /**
|
---|
588 | * Imports an existing ISO.
|
---|
589 | *
|
---|
590 | * Just like other source files, the existing image must remain present and
|
---|
591 | * unmodified till the ISO maker is done with it.
|
---|
592 | *
|
---|
593 | * @returns IRPT status code.
|
---|
594 | * @param hIsoMaker The ISO maker handle.
|
---|
595 | * @param pszIso Path to the existing image to import / clone.
|
---|
596 | * This is fed to RTVfsChainOpenFile.
|
---|
597 | * @param fFlags Reserved for the future, MBZ.
|
---|
598 | * @param pResults Where to return import results.
|
---|
599 | * @param pErrInfo Where to return additional error information.
|
---|
600 | * Optional.
|
---|
601 | */
|
---|
602 | RTDECL(int) RTFsIsoMakerImport(RTFSISOMAKER hIsoMaker, const char *pszIso, uint32_t fFlags,
|
---|
603 | PRTFSISOMAKERIMPORTRESULTS pResults, PRTERRINFO pErrInfo);
|
---|
604 |
|
---|
605 | /** @name RTFSISOMK_IMPORT_F_XXX - Flags for RTFsIsoMakerImport.
|
---|
606 | * @{ */
|
---|
607 | #define RTFSISOMK_IMPORT_F_NO_PRIMARY_ISO RT_BIT_32(0) /**< Skip the primary ISO-9660 namespace (rock ridge included). */
|
---|
608 | #define RTFSISOMK_IMPORT_F_NO_JOLIET RT_BIT_32(1) /**< Skip the joliet namespace. */
|
---|
609 | #define RTFSISOMK_IMPORT_F_NO_ROCK_RIDGE RT_BIT_32(2) /**< Skip rock ridge (both primary and joliet). */
|
---|
610 | #define RTFSISOMK_IMPORT_F_NO_UDF RT_BIT_32(3) /**< Skip the UDF namespace. */
|
---|
611 | #define RTFSISOMK_IMPORT_F_NO_HFS RT_BIT_32(4) /**< Skip the HFS namespace. */
|
---|
612 | #define RTFSISOMK_IMPORT_F_NO_BOOT RT_BIT_32(5) /**< Skip importing El Torito boot stuff. */
|
---|
613 | #define RTFSISOMK_IMPORT_F_NO_SYS_AREA RT_BIT_32(6) /**< Skip importing the system area (first 32KB). */
|
---|
614 |
|
---|
615 | #define RTFSISOMK_IMPORT_F_NO_SYSTEM_ID RT_BIT_32(7) /**< Don't import the system ID primary descriptor field. */
|
---|
616 | #define RTFSISOMK_IMPORT_F_NO_VOLUME_ID RT_BIT_32(8) /**< Don't import the volume ID primary descriptor field. */
|
---|
617 | #define RTFSISOMK_IMPORT_F_NO_VOLUME_SET_ID RT_BIT_32(9) /**< Don't import the volume set ID primary descriptor field. */
|
---|
618 | #define RTFSISOMK_IMPORT_F_NO_PUBLISHER_ID RT_BIT_32(10) /**< Don't import the publisher ID primary descriptor field. */
|
---|
619 | #define RTFSISOMK_IMPORT_F_DATA_PREPARER_ID RT_BIT_32(11) /**< Do import the data preparer ID primary descriptor field. */
|
---|
620 | #define RTFSISOMK_IMPORT_F_APPLICATION_ID RT_BIT_32(12) /**< Do import the application ID primary descriptor field. */
|
---|
621 | #define RTFSISOMK_IMPORT_F_NO_COPYRIGHT_FID RT_BIT_32(13) /**< Don't import the copyright file ID primary descriptor field. */
|
---|
622 | #define RTFSISOMK_IMPORT_F_NO_ABSTRACT_FID RT_BIT_32(14) /**< Don't import the abstract file ID primary descriptor field. */
|
---|
623 | #define RTFSISOMK_IMPORT_F_NO_BIBLIO_FID RT_BIT_32(15) /**< Don't import the bibliographic file ID primary descriptor field. */
|
---|
624 |
|
---|
625 | #define RTFSISOMK_IMPORT_F_NO_J_SYSTEM_ID RT_BIT_32(16) /**< Don't import the system ID joliet descriptor field. */
|
---|
626 | #define RTFSISOMK_IMPORT_F_NO_J_VOLUME_ID RT_BIT_32(17) /**< Don't import the volume ID joliet descriptor field. */
|
---|
627 | #define RTFSISOMK_IMPORT_F_NO_J_VOLUME_SET_ID RT_BIT_32(18) /**< Don't import the volume set ID joliet descriptor field. */
|
---|
628 | #define RTFSISOMK_IMPORT_F_NO_J_PUBLISHER_ID RT_BIT_32(19) /**< Don't import the publisher ID joliet descriptor field. */
|
---|
629 | #define RTFSISOMK_IMPORT_F_J_DATA_PREPARER_ID RT_BIT_32(20) /**< Do import the data preparer ID joliet descriptor field. */
|
---|
630 | #define RTFSISOMK_IMPORT_F_J_APPLICATION_ID RT_BIT_32(21) /**< Do import the application ID joliet descriptor field. */
|
---|
631 | #define RTFSISOMK_IMPORT_F_NO_J_COPYRIGHT_FID RT_BIT_32(22) /**< Don't import the copyright file ID joliet descriptor field. */
|
---|
632 | #define RTFSISOMK_IMPORT_F_NO_J_ABSTRACT_FID RT_BIT_32(23) /**< Don't import the abstract file ID joliet descriptor field. */
|
---|
633 | #define RTFSISOMK_IMPORT_F_NO_J_BIBLIO_FID RT_BIT_32(24) /**< Don't import the bibliographic file ID joliet descriptor field. */
|
---|
634 |
|
---|
635 | #define RTFSISOMK_IMPORT_F_VALID_MASK UINT32_C(0x01ffffff)
|
---|
636 | /** @} */
|
---|
637 |
|
---|
638 |
|
---|
639 | /**
|
---|
640 | * Finalizes the image.
|
---|
641 | *
|
---|
642 | * @returns IPRT status code.
|
---|
643 | * @param hIsoMaker The ISO maker handle.
|
---|
644 | */
|
---|
645 | RTDECL(int) RTFsIsoMakerFinalize(RTFSISOMAKER hIsoMaker);
|
---|
646 |
|
---|
647 | /**
|
---|
648 | * Creates a VFS file for a finalized ISO maker instanced.
|
---|
649 | *
|
---|
650 | * The file can be used to access the image. Both sequential and random access
|
---|
651 | * are supported, so that this could in theory be hooked up to a CD/DVD-ROM
|
---|
652 | * drive emulation and used as a virtual ISO image.
|
---|
653 | *
|
---|
654 | * @returns IRPT status code.
|
---|
655 | * @param hIsoMaker The ISO maker handle.
|
---|
656 | * @param phVfsFile Where to return the handle.
|
---|
657 | */
|
---|
658 | RTDECL(int) RTFsIsoMakerCreateVfsOutputFile(RTFSISOMAKER hIsoMaker, PRTVFSFILE phVfsFile);
|
---|
659 |
|
---|
660 |
|
---|
661 |
|
---|
662 | /**
|
---|
663 | * ISO maker command (creates image file on disk).
|
---|
664 | *
|
---|
665 | * @returns IPRT status code
|
---|
666 | * @param cArgs Number of arguments.
|
---|
667 | * @param papszArgs Pointer to argument array.
|
---|
668 | */
|
---|
669 | RTDECL(RTEXITCODE) RTFsIsoMakerCmd(unsigned cArgs, char **papszArgs);
|
---|
670 |
|
---|
671 | /**
|
---|
672 | * Extended ISO maker command.
|
---|
673 | *
|
---|
674 | * This can be used as a ISO maker command that produces a image file, or
|
---|
675 | * alternatively for setting up a virtual ISO in memory.
|
---|
676 | *
|
---|
677 | * @returns IPRT status code
|
---|
678 | * @param cArgs Number of arguments.
|
---|
679 | * @param papszArgs Pointer to argument array.
|
---|
680 | * @param phVfsFile Where to return the virtual ISO. Pass NULL to
|
---|
681 | * for normal operation (creates file on disk).
|
---|
682 | * @param pErrInfo Where to return extended error information in
|
---|
683 | * the virtual ISO mode.
|
---|
684 | */
|
---|
685 | RTDECL(int) RTFsIsoMakerCmdEx(unsigned cArgs, char **papszArgs, PRTVFSFILE phVfsFile, PRTERRINFO pErrInfo);
|
---|
686 |
|
---|
687 |
|
---|
688 | /** @} */
|
---|
689 |
|
---|
690 | RT_C_DECLS_END
|
---|
691 |
|
---|
692 | #endif
|
---|
693 |
|
---|