[BOOTDATA]: Diverse improvements for mkisofs support and ISO image configuration:
[reactos.git] / reactos / sdk / tools / mkisofs / schilytools / mkisofs / README.hide
1 Hiding files on a CD
2 =====================
3
4 This document attempts to show how to hide files from being seen by an
5 operating system accessing a CD as an ISO9660/Rock Ridge, Joliet or HFS
6 CD. It also highlights some of the limitations ...
7
8 Note: this document is about the various -hide options - not be confused with
9 the -hidden options.
10
11 The -hidden options set the 'EXISTENCE' bit in the directory entry which
12 means the file or directory will be invisible - unless some special option
13 is used to mount or view the CD - Linux has the 'unhide' mount option to
14 make these files visible. i.e. the directory entry exists on the CD.
15
16 With hindsight, to avoid confusion with the -hidden option, it would have
17 been better to chose an option name like '-omit' instead of '-hide'...
18
19 The various -hide options actually exclude the relevant directory entry
20 from the directory tree. Therefore, it is not possible to access a file
21 or directory that has be hidden with the -hide option when the ISO9600/Rock
22 Ridge directory is mounted - because the directory entry does not exist on the
23 CD (but the file data does). You would probably be able to access this file
24 or directory when mounted as a Joliet or HFS CD (depending on other options
25 used). Similarly, a directory entry hidden with the -hide-joliet option
26 will not be accessible when mounted as an Joliet CD. Similarly for -hide-hfs
27 etc.
28
29 If you don't want a file or directory to appear on the CD at all, then use the
30 -exclude options, not the -hide options (mkisofs completely ignores any
31 file/directory excluded with the -exclude options).
32
33
34 Using the hide options
35 ======================
36
37 There are 6 hide options:
38
39 -hide Hide a file/directory from the ISO9660/Rock Ridge directory
40 -hide-list As above, but read file names from a file
41 -hide-joliet Hide a file/directory from the Joliet directory
42 -hide-joliet-list As above, but read file names from a file
43 -hide-hfs Hide a file/directory from the HFS directory
44 -hide-hfs-list As above, but read file names from a file
45
46 You can use the -hide, -hide-joliet and/or -hide-hfs options as many times
47 as you like on the command line, but if you have many files to hide, then
48 it may be better to put your file names in a file (one per line) and use
49 the corresponding 'list' option. You can also use the three -hide-list options
50 as many times as you want.
51
52 The arguments to the -hide options are either the 'basename' or the 'whole
53 path name' of a file. That is, if you use the option:
54
55 % mkisofs -hide ABC [-other-options] CD_directory
56
57 then any file with the name ABC will be hidden. If you want to be more
58 specific, then use the whole name - as seen by mkisofs e.g.:
59
60 % mkisofs -hide CD_directory/XYZ/ABC [-other-options] CD_directory
61
62 will hide just the file 'CD_directory/XYZ/ABC' - not any other file called
63 'ABC' that might exist under 'CD_directory'. However, if your command line
64 is like:
65
66 % mkisofs -hide CD_directory/XYZ/ABC [-other-options] ./CD_directory
67
68 Then the file 'CD_directory/XYZ/ABC' will not be hidden because as far as
69 mkisofs is concerned. Its whole path is actually './CD_directory/XYZ/ABC'.
70
71 You can use wild cards in the -hide arguments.
72
73 If the file name to be hidden is a directory, then the directory and all
74 its contents are hidden.
75
76 The main use of the hide options is on a multi platform (hybrid CD) to hide
77 various files/directories that are operating system specific from been seen
78 on the CD when mounted on another OS. i.e. You may want to hide Macintosh
79 executables from being seen when the CD is mounted as a Joliet CD on a PC etc.
80
81 For example, say we want to create a ISO9660/Rock Ridge, Joliet, HFS hybrid
82 CD from files/directories in the directory called 'cd_dir' - which are:
83
84 MAC/
85 MAC/app
86 MAC/data/
87 MAC/data/file1
88 PC/
89 PC/app
90 PC/data/
91 PC/data/file1
92 UNIX/
93 UNIX/app
94 UNIX/data
95 UNIX/data/file1
96 COMMON/
97 COMMON/some_files
98
99 We could use the command line:
100
101 % mkisofs -r -J -hfs -hide MAC -hide PC -hide-joliet MAC \
102 -hide-joliet UNIX -hide-hfs PC -hide-hfs UNIX -o cd.iso cd_dir
103
104 This will give a CD that when mounted as a Rock Ridge CD, you will only
105 see the directories UNIX and COMMON, as a Joliet CD the directories
106 PC and COMMON, and as an HFS CD the directories MAC and COMMON.
107
108 If you also had the three files in the current directory called README.hfs,
109 README.joliet and README.unix - but you wanted to have each of these
110 files appear as just 'README' when mounted, then you could use the above
111 command line with the following:
112
113 % mkisofs -r -J -hfs -graft-points -hide MAC -hide PC -hide-joliet MAC \
114 -hide-joliet UNIX -hide-hfs PC -hide-hfs UNIX \
115 -hide README.hfs -hide README.joliet -hide-joliet README.hfs \
116 -hide-joliet README.uni -hide-hfs README.joliet -hide-hfs README.unix \
117 README=README.hfs README=README.joliet README=README.unix \
118 -o cd.iso cd_dir
119
120 Note: we've used the -graft-points option as we're using the '=' syntax
121 to insert the files called README.hfs, README.joliet and README.unix as
122 'README'
123
124 The resulting CD when mounted as a Rock Ridge CD, will have the directories
125 UNIX and COMMON - with the file called README - which was originally
126 called README.unix.
127
128 However, in most circumstances, it would be better to have the contents
129 of each of the OS specific directories (plus the contents of the COMMON
130 directory) to appear at the top level of the CD. i.e. when the CD is mounted
131 (as ISO9660/Rock Ridge, Joliet or HFS) it has the contents:
132
133 README
134 app
135 data/file1
136 some_files
137
138 Unfortunately, this is not as straight forward as it may seem - i.e. doing
139 the following may seem OK, but it won't work - for reasons I'll explain
140 later:
141
142 It gets a bit messy using the -graft-points syntax above, so we'll assume
143 each of the MAC, UNIX and PC directories contain the correct README, We'll
144 also change to the 'cd_dir' directory and use the command:
145
146 mkisofs -r -J -hfs -hide MAC -hide PC -hide-joliet MAC \
147 -hide-joliet UNIX -hide-hfs PC -hide-hfs UNIX \
148 -o cd.iso MAC PC UNIX COMMON
149
150 You will get errors like:
151
152 mkisofs: Error: UNIX/README and MAC/README have the same Rock Ridge name
153 ...
154 mkisofs: Unable to sort directory
155
156 This is because you can not hide "pathspecs" that are directories ("pathspecs"
157 are file names given on the command line, or in a path-list file). This a
158 "feature" of mkisofs. In this case nothing is actually hidden at all.
159
160 So you might think that the following may work:
161
162 mkisofs -r -J -hfs -hide "MAC/*" -hide "PC/*" -hide-joliet "MAC/*" \
163 -hide-joliet "UNIX/*" -hide-hfs "PC/*" -hide-hfs "UNIX/*" \
164 -o cd.iso MAC PC UNIX COMMON
165
166 which may appear to work - but when the CD is mounted as an ISO9660/Rock Ridge
167 or Joliet CD, then the directory "data" is missing.
168
169 Again this is a feature of mkisofs - the directories PC/data and UNIX/data
170 are mapped by mkisofs to the same output directory called "/data" - the
171 various "hide" flags are stored with this directory info - in this case as
172 the output directory "/data" is first hidden from the ISO9660/Rock Ridge and
173 then the Joliet directory, the net result is that "/data" gets hidden from
174 both directories ... the way mkisofs hides HFS directories is slightly
175 different, so in this case the directory "data" exists on the HFS volume
176 and contains the correct contents.
177
178 However, it is possible to obtain the required result, but we have to be
179 careful about hiding multiple input directories that map to a single output
180 directory.
181
182 To do this we have to hide just the files in these directories (or more
183 accurately, all the non-directories). This is best done by using lists of
184 files to hide for example:
185
186 find PC -type f -print > pc.list
187 find UNIX -type f -print > unix.list
188 find MAC -type f -print > mac.list
189
190 mkisofs -r -J -hfs -hide-list pc.list -hide-list mac.list \
191 -hide-joliet-list unix.list -hide-joliet-list mac.list \
192 -hide-hfs-list pc.list -hide-hfs-list unix.list \
193 -o cd.iso MAC PC UNIX COMMON
194
195 i.e. instead of trying to hide a directory and letting mkisofs hide its
196 contents, we explicitly hide all the files in the directory, but not the
197 directory and any of its sub-directories.
198
199 This will work for the above input files, but if your directory trees contain
200 symbolic links and/or directories that will not get merged, then the hide lists
201 will have to be tailored to get the required result.
202
203
204 James Pearson 22-Nov-2001
205
206 Any comments/problems to j.pearson@ge.ucl.ac.uk