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