]> git.pld-linux.org Git - packages/cdrtools.git/blob - cdrtools-zisofs.patch
- lots of updates in %files section
[packages/cdrtools.git] / cdrtools-zisofs.patch
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
4 @@ -0,0 +1,17 @@
5 +Transparent decompression (-z option) is available on Linux kernels
6 +using kernel version 2.4.14 or 2.4.9-ac14 or later.
7 +
8 +You also need the zisofs-tools package, containing the mkzftree
9 +utility, to create the compressed files; this package is available at:
10 +
11 +ftp://ftp.kernel.org/pub/linux/utils/fs/zisofs/
12 +
13 +The mkzftree utility can also be used to read compressed CD-ROMs on
14 +systems which do not support transparent decompression.
15 +
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
18 +system.
19 +
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
25 @@ -206,7 +206,7 @@
26  .B \-pad
27  ]
28  [
29 -.B \-no\-pad
30 +.B \-no-pad
31  ]
32  [
33  .B \-path-list
34 @@ -383,40 +383,40 @@
35  .I folder_name
36  ]
37  [
38 -.B \--cap
39 +.B \-\-cap
40  ]
41  [
42 -.B \--netatalk
43 +.B \-\-netatalk
44  ]
45  [
46 -.B \--double
47 +.B \-\-double
48  ]
49  [
50 -.B \--ethershare
51 +.B \-\-ethershare
52  ]
53  [
54 -.B \--ushare
55 +.B \-\-ushare
56  ]
57  [
58 -.B \--exchange
59 +.B \-\-exchange
60  ]
61  [
62 -.B \--sgi
63 +.B \-\-sgi
64  ]
65  [
66 -.B \--xinet
67 +.B \-\-xinet
68  ]
69  [
70 -.B \--macbin
71 +.B \-\-macbin
72  ]
73  [
74 -.B \--single
75 +.B \-\-single
76  ]
77  [
78 -.B \--dave
79 +.B \-\-dave
80  ]
81  [
82 -.B \--sfm
83 +.B \-\-sfm
84  ]
85  .\" end mkhybrid options
86  .B \-o
87 @@ -1398,15 +1398,25 @@
88  
89  mkisofs \-o cd \-x /local/dir1 \-x /local/dir2 /local
90  .sp
91 -NOTE: The \-m and \-x option description should both be updated, they are wrong.
92 +NOTE: The
93 +.B \-m
94 +and
95 +.B \-x
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.
99  .TP
100  .B \-z
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
108 +.B \-R
109 +or
110 +.B \-r
111 +options to enable RockRidge, and generate compressed files using the
112 +.B mkzftree
113 +utility before running
114 +.BR mkisofs .
115  
116  .SH "HFS OPTIONS
117  .TP
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
121  files. Implies the
122 -.B \--exchange
123 +.B \-\-exchange
124  option. See the
125  .B HFS MACINTOSH FILE FORMATS
126  section below.
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).
130  .TP
131 -.B \--cap
132 +.B \-\-cap
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,
135  unless other
136  .I double dash
137  options are given.
138  .TP
139 -.B \--netatalk
140 +.B \-\-netatalk
141  Look for NETATALK Macintosh files
142  .TP
143 -.B \--double
144 +.B \-\-double
145  Look for AppleDouble Macintosh files
146  .TP
147 -.B \--ethershare
148 +.B \-\-ethershare
149  Look for Helios EtherShare Macintosh files
150  .TP
151 -.B \--ushare
152 +.B \-\-ushare
153  Look for IPT UShare Macintosh files
154  .TP
155 -.B \--exchange
156 +.B \-\-exchange
157  Look for PC Exchange Macintosh files
158  .TP
159 -.B \--sgi
160 +.B \-\-sgi
161  Look for SGI Macintosh files
162  .TP
163 -.B \--xinet
164 +.B \-\-xinet
165  Look for XINET Macintosh files
166  .TP
167 -.B \--macbin
168 +.B \-\-macbin
169  Look for MacBinary Macintosh files
170  .TP
171 -.B \--single
172 +.B \-\-single
173  Look for AppleSingle Macintosh files
174  .TP
175 -.B \--dave
176 +.B \-\-dave
177  Look for Thursby Software Systems DAVE Macintosh files
178  .TP
179 -.B \--sfm
180 +.B \-\-sfm
181  Look for Microsoft's Services for Macintosh files (NT only) (Alpha)
182  
183  .SH "CHARACTER SETS
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:
187  
188 -       mkisofs \--cap \-o output source_dir /mnt/floppy
189 +       mkisofs \-\-cap \-o output source_dir /mnt/floppy
190  
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 @@
194  .B mkisofs
195  by using something like:
196  
197 -       mkisofs \--macbin \-o output source_dir icon_dir
198 +       mkisofs \-\-macbin \-o output source_dir icon_dir
199  .PP
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 @@
203  that contains
204  Netatalk Apple/Unix files:
205  .PP
206 -% mkisofs \-o cd.iso \--netatalk cd_dir
207 +% mkisofs \-o cd.iso \-\-netatalk cd_dir
208  .PP
209  To create a HFS hybrid CD from the source directory
210  .IR cd_dir ,
211 @@ -2754,9 +2764,10 @@
212  options.
213  
214  .SH "SEE ALSO
215 -.BR cdrecord(1)
216 +.BR cdrecord (1),
217 +.BR mkzftree (1),
218  .BR magic (5),
219 -.BR apple_driver (8)
220 +.BR apple_driver (8).
221  
222  .SH "FUTURE IMPROVEMENTS
223  Some sort of gui interface.
224 @@ -2764,8 +2775,13 @@
225  .B m\&kisofs
226  is available as part of the cdrecord package from
227  ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/
228 +
229  .B hfsutils
230  from ftp://ftp.mars.org/pub/hfs
231 +
232 +.B mkzftree
233 +is available as part of the zisofs-tools package
234 +from ftp://ftp.kernel.org/pub/linux/utils/fs/zisofs/
235  .SH "MAILING LISTS
236  If you want to actively take part on the development of m\&kisofs,
237  and/or mkhybrid,
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
241 @@ -561,10 +561,8 @@
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},
248 -#endif
249  #ifdef APPLE_HYB
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");
255         }
256 -
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");
261 +       }
262         init_nls();             /* Initialize UNICODE tables */
263  
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
269 @@ -45,7 +45,7 @@
270  #define PX_SIZE 36
271  #define RE_SIZE 4
272  #define SL_SIZE 20
273 -#define ZZ_SIZE 15
274 +#define ZF_SIZE 16
275  #ifdef APPLE_HYB
276  #define AA_SIZE 14     /* size of Apple extension */
277  #endif /* APPLE_HYB */
278 @@ -577,17 +577,24 @@
279  #ifndef VMS
280         /*
281          * If transparent compression was requested, fill in the correct field
282 -        * for this file
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.
287 +        *
288 +        * In the future it would be nice if mkisofs actually did the
289 +        * compression.
290          */
291 -       if (transparent_compression &&
292 -               S_ISREG(lstatbuf->st_mode) &&
293 -               strlen(name) > 3 &&
294 -               strcmp(name + strlen(name) - 3, ".gZ") == 0) {
295 -               FILE           *zipfile;
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 };
299 +               FILE           *zffile;
300                 char           *checkname;
301                 unsigned int    file_size;
302 -               unsigned char   header[8];
303 +               unsigned char   header[16];
304                 int             OK_flag;
305 +               int             blocksize;
306 +               int             headersize;
307  
308                 /*
309                  * First open file and verify that the correct algorithm was
310 @@ -596,73 +603,43 @@
311                 file_size = 0;
312                 OK_flag = 1;
313  
314 -               zipfile = fopen(whole_name, "rb");
315 -               fread(header, 1, sizeof(header), zipfile);
316 +               memset(header, 0, sizeof(header));
317  
318 -               /* Check some magic numbers from gzip. */
319 -               if (header[0] != 0x1f || header[1] != 0x8b || header[2] != 8)
320 -                       OK_flag = 0;
321 -               /* Make sure file was blocksized. */
322 -               if (((header[3] & 0x40) == 0))
323 -                       OK_flag = 0;
324 -               /* OK, now go to the end of the file and get some more info */
325 -               if (OK_flag) {
326 -                       int     status;
327 -
328 -                       status = (long) lseek(fileno(zipfile), (off_t)(-8),
329 -                                                               SEEK_END);
330 -                       if (status == -1)
331 +               zffile = fopen(whole_name, "rb");
332 +               if ( zffile ) {
333 +                       if ( fread(header, 1, sizeof(header), zffile) != sizeof(header) )
334                                 OK_flag = 0;
335 -               }
336 -               if (OK_flag) {
337 -                       if (read(fileno(zipfile), (char *) header,
338 -                                       sizeof(header)) != sizeof(header)) {
339 +                       
340 +                       /* Check magic number */
341 +                       if ( memcmp(header, zisofs_magic, sizeof zisofs_magic) )
342                                 OK_flag = 0;
343 -                       } else {
344 -                               int             blocksize;
345  
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) |
350 -                                                       header[4];
351 -#if 0
352 -                               fprintf(stderr, "Blocksize = %d %d\n",
353 -                                               blocksize, file_size);
354 -#endif
355 -                               if (blocksize != SECTOR_SIZE)
356 -                                       OK_flag = 0;
357 -                       }
358 -               }
359 -               fclose(zipfile);
360 -
361 -               checkname = strdup(whole_name);
362 -               checkname[strlen(whole_name) - 3] = 0;
363 -               zipfile = fopen(checkname, "rb");
364 -               if (zipfile) {
365 +                       /* Get the real size of the file */
366 +                       file_size = get_731(header+8);
367 +                       
368 +                       /* Get the header size (>> 2) */
369 +                       headersize = header[12];
370 +                       
371 +                       /* Get the block size (log2) */
372 +                       blocksize = header[13];
373 +                       
374 +                       fclose(zffile);
375 +               } else {
376                         OK_flag = 0;
377 -#ifdef USE_LIBSCHILY
378 -                       errmsg(
379 -                       "Unable to insert transparent compressed file - name conflict\n");
380 -#else
381 -                       fprintf(stderr,
382 -                       "Unable to insert transparent compressed file - name conflict\n");
383 -#endif
384 -                       fclose(zipfile);
385                 }
386 -               free(checkname);
387 -
388 +               
389                 if (OK_flag) {
390 -                       if (MAYBE_ADD_CE_ENTRY(ZZ_SIZE))
391 +                       if (MAYBE_ADD_CE_ENTRY(ZF_SIZE))
392                                 add_CE_entry();
393                         Rock[ipnt++] = 'Z';
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
400 -                                                  technique used */
401 +                       Rock[ipnt++] = 'p'; /* Algorithm: "paged zlib" */
402                         Rock[ipnt++] = 'z';
403 -                       Rock[ipnt++] = 3;
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 */
408                         ipnt += 8;
409                 };
This page took 0.091886 seconds and 3 git commands to generate.