1 diff -urN cdrtools-1.11a09/mkisofs/README.compression cdrtools-1.11a09-zisofs/mkisofs/README.compression
2 --- cdrtools-1.11a09/mkisofs/README.compression Wed Dec 31 16:00:00 1969
3 +++ cdrtools-1.11a09-zisofs/mkisofs/README.compression Thu Nov 8 12:01:31 2001
5 +Transparent decompression (-z option) is available on Linux kernels
6 +using kernel version 2.4.14 or 2.4.9-ac14 or later.
8 +You also need the zisofs-tools package, containing the mkzftree
9 +utility, to create the compressed files; this package is available at:
11 +ftp://ftp.kernel.org/pub/linux/utils/fs/zisofs/
13 +The mkzftree utility can also be used to read compressed CD-ROMs on
14 +systems which do not support transparent decompression.
16 +The use of a separate utility allows compression to be controlled on a
17 +per-file basis. A file which is not compressed can be read on any
20 +Transparent decompression is implemented as an extension to Rock
21 +Ridge, so Rock Ridge needs to be enabled (-R or -r options.)
22 diff -urN cdrtools-1.11a09/mkisofs/mkisofs.8 cdrtools-1.11a09-zisofs/mkisofs/mkisofs.8
23 --- cdrtools-1.11a09/mkisofs/mkisofs.8 Mon Jul 9 05:09:08 2001
24 +++ cdrtools-1.11a09-zisofs/mkisofs/mkisofs.8 Thu Nov 8 12:11:13 2001
85 .\" end mkhybrid options
87 @@ -1398,15 +1398,25 @@
89 mkisofs \-o cd \-x /local/dir1 \-x /local/dir2 /local
91 -NOTE: The \-m and \-x option description should both be updated, they are wrong.
96 +option description should both be updated, they are wrong.
97 Both now work identical and use filename globbing. A file is excluded if either
98 the last component matches or the whole path matches.
101 -Generate special SUSP records for transparently compressed files. This is
102 -only of use and interest for hosts that support transparent decompression.
103 -This is an experimental feature, and no hosts yet support this, but there
104 -are ALPHA patches for Linux that can make use of this feature.
105 +Generate special RRIP records for transparently compressed files.
106 +This is only of use and interest for hosts that support transparent
107 +decompression, such as Linux 2.4.14 or later. You must specify the
111 +options to enable RockRidge, and generate compressed files using the
113 +utility before running
118 @@ -1505,7 +1515,7 @@
119 .BI \-cluster-size " size
120 Set the size in bytes of the cluster or allocation units of PC Exchange
125 .B HFS MACINTOSH FILE FORMATS
127 @@ -1612,44 +1622,44 @@
128 called System Folder, then the whole path name is "./cddata/System Folder"
129 (remember to use quotes if the name contains spaces).
133 Look for AUFS CAP Macintosh files. Search for CAP Apple/Unix file formats
134 only. Searching for the other possible Apple/Unix file formats is disabled,
141 Look for NETATALK Macintosh files
145 Look for AppleDouble Macintosh files
149 Look for Helios EtherShare Macintosh files
153 Look for IPT UShare Macintosh files
157 Look for PC Exchange Macintosh files
161 Look for SGI Macintosh files
165 Look for XINET Macintosh files
169 Look for MacBinary Macintosh files
173 Look for AppleSingle Macintosh files
177 Look for Thursby Software Systems DAVE Macintosh files
181 Look for Microsoft's Services for Macintosh files (NT only) (Alpha)
184 @@ -2285,7 +2295,7 @@
185 The floppy will be mounted as a CAP file system by default. Then run mkisofs
186 using something like:
188 - mkisofs \--cap \-o output source_dir /mnt/floppy
189 + mkisofs \-\-cap \-o output source_dir /mnt/floppy
191 If you are not using Linux, then you can use the hfsutils to copy the icon
192 file from the floppy. However, care has to be taken, as the icon file
193 @@ -2301,7 +2311,7 @@
195 by using something like:
197 - mkisofs \--macbin \-o output source_dir icon_dir
198 + mkisofs \-\-macbin \-o output source_dir icon_dir
200 The procedure for creating/using custom folder icons is very similar - paste
201 an icon to folder's "Get Info" box and transfer the resulting 'Icon\\r'
202 @@ -2520,7 +2530,7 @@
204 Netatalk Apple/Unix files:
206 -% mkisofs \-o cd.iso \--netatalk cd_dir
207 +% mkisofs \-o cd.iso \-\-netatalk cd_dir
209 To create a HFS hybrid CD from the source directory
211 @@ -2754,9 +2764,10 @@
219 -.BR apple_driver (8)
220 +.BR apple_driver (8).
222 .SH "FUTURE IMPROVEMENTS
223 Some sort of gui interface.
224 @@ -2764,8 +2775,13 @@
226 is available as part of the cdrecord package from
227 ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/
230 from ftp://ftp.mars.org/pub/hfs
233 +is available as part of the zisofs-tools package
234 +from ftp://ftp.kernel.org/pub/linux/utils/fs/zisofs/
236 If you want to actively take part on the development of m\&kisofs,
238 diff -urN cdrtools-1.11a09/mkisofs/mkisofs.c cdrtools-1.11a09-zisofs/mkisofs/mkisofs.c
239 --- cdrtools-1.11a09/mkisofs/mkisofs.c Sat Oct 20 15:00:34 2001
240 +++ cdrtools-1.11a09-zisofs/mkisofs/mkisofs.c Thu Nov 8 11:57:58 2001
242 '\0', "#", "Set numbers of load sectors", ONE_DASH},
243 {{"boot-info-table", no_argument, NULL, OPTION_BOOT_INFO_TABLE},
244 '\0', NULL, "Patch boot image with info table", ONE_DASH},
245 -#ifdef ERIC_neverdef
246 {{"transparent-compression", no_argument, NULL, 'z'},
247 'z', NULL, "Enable transparent compression of files", ONE_DASH},
250 {{"hfs-type", required_argument, NULL, OPTION_HFS_TYPE},
251 '\0', "TYPE", "Set HFS default TYPE", ONE_DASH},
252 @@ -1984,7 +1982,11 @@
253 error(" but without (standard) Rock Ridge extensions.\n");
254 error(" It is highly recommended to add Rock Ridge\n");
257 + if (transparent_compression && !use_RockRidge) {
258 + error("Warning: transparent decompression is a Rock Ridge extension, but\n");
259 + error(" creating filesystem without Rock Ridge attributes; files\n");
260 + error(" will not be transparently decompressed.\n");
262 init_nls(); /* Initialize UNICODE tables */
264 /* initialize code tables from a file - if they exists */
265 diff -urN cdrtools-1.11a09/mkisofs/mkisofs.c.orig cdrtools-1.11a09-zisofs/mkisofs/mkisofs.c.orig
266 diff -urN cdrtools-1.11a09/mkisofs/rock.c cdrtools-1.11a09-zisofs/mkisofs/rock.c
267 --- cdrtools-1.11a09/mkisofs/rock.c Tue Jan 23 04:28:34 2001
268 +++ cdrtools-1.11a09-zisofs/mkisofs/rock.c Thu Nov 8 11:57:58 2001
276 #define AA_SIZE 14 /* size of Apple extension */
277 #endif /* APPLE_HYB */
278 @@ -577,17 +577,24 @@
281 * If transparent compression was requested, fill in the correct field
283 + * for this file, if (and only if) it is actually a compressed file!
284 + * This relies only on magic number, but it should in general not
285 + * be an issue since if you're using -z odds are most of your
286 + * files are already compressed.
288 + * In the future it would be nice if mkisofs actually did the
291 - if (transparent_compression &&
292 - S_ISREG(lstatbuf->st_mode) &&
293 - strlen(name) > 3 &&
294 - strcmp(name + strlen(name) - 3, ".gZ") == 0) {
296 + if (transparent_compression && S_ISREG(lstatbuf->st_mode)) {
297 + static const unsigned char zisofs_magic[8] =
298 + { 0x37, 0xE4, 0x53, 0x96, 0xC9, 0xDB, 0xD6, 0x07 };
301 unsigned int file_size;
302 - unsigned char header[8];
303 + unsigned char header[16];
309 * First open file and verify that the correct algorithm was
310 @@ -596,73 +603,43 @@
314 - zipfile = fopen(whole_name, "rb");
315 - fread(header, 1, sizeof(header), zipfile);
316 + memset(header, 0, sizeof(header));
318 - /* Check some magic numbers from gzip. */
319 - if (header[0] != 0x1f || header[1] != 0x8b || header[2] != 8)
321 - /* Make sure file was blocksized. */
322 - if (((header[3] & 0x40) == 0))
324 - /* OK, now go to the end of the file and get some more info */
328 - status = (long) lseek(fileno(zipfile), (off_t)(-8),
331 + zffile = fopen(whole_name, "rb");
333 + if ( fread(header, 1, sizeof(header), zffile) != sizeof(header) )
337 - if (read(fileno(zipfile), (char *) header,
338 - sizeof(header)) != sizeof(header)) {
340 + /* Check magic number */
341 + if ( memcmp(header, zisofs_magic, sizeof zisofs_magic) )
346 - blocksize = (header[3] << 8) | header[2];
347 - file_size = ((unsigned int) header[7] << 24) |
348 - ((unsigned int) header[6] << 16) |
349 - ((unsigned int) header[5] << 8) |
352 - fprintf(stderr, "Blocksize = %d %d\n",
353 - blocksize, file_size);
355 - if (blocksize != SECTOR_SIZE)
361 - checkname = strdup(whole_name);
362 - checkname[strlen(whole_name) - 3] = 0;
363 - zipfile = fopen(checkname, "rb");
365 + /* Get the real size of the file */
366 + file_size = get_731(header+8);
368 + /* Get the header size (>> 2) */
369 + headersize = header[12];
371 + /* Get the block size (log2) */
372 + blocksize = header[13];
377 -#ifdef USE_LIBSCHILY
379 - "Unable to insert transparent compressed file - name conflict\n");
382 - "Unable to insert transparent compressed file - name conflict\n");
390 - if (MAYBE_ADD_CE_ENTRY(ZZ_SIZE))
391 + if (MAYBE_ADD_CE_ENTRY(ZF_SIZE))
394 - Rock[ipnt++] = 'Z';
395 - Rock[ipnt++] = ZZ_SIZE;
396 + Rock[ipnt++] = 'F';
397 + Rock[ipnt++] = ZF_SIZE;
398 Rock[ipnt++] = SU_VERSION;
399 - Rock[ipnt++] = 'g'; /* Identify compression
401 + Rock[ipnt++] = 'p'; /* Algorithm: "paged zlib" */
404 + /* 2 bytes for algorithm-specific information */
405 + Rock[ipnt++] = headersize;
406 + Rock[ipnt++] = blocksize;
407 set_733((char *) Rock + ipnt, file_size); /* Real file size */