mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

225 lines
7.2 KiB

  1. diff -ur cdrtools-2.00.3/mkisofs/mac_label.c cdrtools-2.00.3-local/mkisofs/mac_label.c
  2. --- cdrtools-2.00.3/mkisofs/mac_label.c 2002-05-20 11:58:11.000000000 +0100
  3. +++ cdrtools-2.00.3-local/mkisofs/mac_label.c 2003-07-30 21:23:28.000000000 +0100
  4. @@ -64,16 +64,46 @@
  5. struct directory_entry *de;
  6. int i,
  7. block,
  8. - size;
  9. + size,
  10. + entry = 0;
  11. MacLabel *mac_label = (MacLabel *) ml;
  12. if (verbose > 1) {
  13. fprintf(stderr, "Creating %d PReP boot partition(s)\n",
  14. - use_prep_boot);
  15. + use_prep_boot + use_chrp_boot);
  16. }
  17. mac_label->fdiskMagic[0] = fdiskMagic0;
  18. mac_label->fdiskMagic[1] = fdiskMagic1;
  19. + if (use_chrp_boot) {
  20. + fprintf(stderr, "CHRP boot partition 1\n");
  21. +
  22. + mac_label->image[entry].boot = 0x80;
  23. +
  24. + mac_label->image[entry].CHSstart[0] = 0xff;
  25. + mac_label->image[entry].CHSstart[1] = 0xff;
  26. + mac_label->image[entry].CHSstart[2] = 0xff;
  27. +
  28. + mac_label->image[entry].type = chrpPartType; /* 0x96 */
  29. +
  30. + mac_label->image[entry].CHSend[0] = 0xff;
  31. + mac_label->image[entry].CHSend[1] = 0xff;
  32. + mac_label->image[entry].CHSend[2] = 0xff;
  33. +
  34. + mac_label->image[entry].startSect[0] = 0;
  35. + mac_label->image[entry].startSect[1] = 0;
  36. + mac_label->image[entry].startSect[2] = 0;
  37. + mac_label->image[entry].startSect[3] = 0;
  38. +
  39. + size = (last_extent - session_start) * 2048 / 512;
  40. + mac_label->image[entry].size[0] = size & 0xff;
  41. + mac_label->image[entry].size[1] = (size >> 8) & 0xff;
  42. + mac_label->image[entry].size[2] = (size >> 16) & 0xff;
  43. + mac_label->image[entry].size[3] = (size >> 24) & 0xff;
  44. +
  45. + ++entry;
  46. + }
  47. +
  48. for (i = 0; i < use_prep_boot; i++) {
  49. de = search_tree_file(root, prep_boot_image[i]);
  50. if (!de) {
  51. @@ -88,18 +118,42 @@
  52. fprintf(stderr, "PReP boot partition %d is \"%s\"\n",
  53. i + 1, prep_boot_image[i]);
  54. + mac_label->image[entry].boot = 0x80;
  55. +
  56. + mac_label->image[entry].CHSstart[0] = 0xff;
  57. + mac_label->image[entry].CHSstart[1] = 0xff;
  58. + mac_label->image[entry].CHSstart[2] = 0xff;
  59. +
  60. + mac_label->image[entry].type = prepPartType; /* 0x41 */
  61. +
  62. + mac_label->image[entry].CHSend[0] = 0xff;
  63. + mac_label->image[entry].CHSend[1] = 0xff;
  64. + mac_label->image[entry].CHSend[2] = 0xff;
  65. +
  66. /* deal with endianess */
  67. - mac_label->image[i].type = prepPartType; /* 0x41 */
  68. - mac_label->image[i].startSect[0] = block & 0xff;
  69. - mac_label->image[i].startSect[1] = (block >> 8) & 0xff;
  70. - mac_label->image[i].startSect[2] = (block >> 16) & 0xff;
  71. - mac_label->image[i].startSect[3] = (block >> 24) & 0xff;
  72. - mac_label->image[i].size[0] = size & 0xff;
  73. - mac_label->image[i].size[1] = (size >> 8) & 0xff;
  74. - mac_label->image[i].size[2] = (size >> 16) & 0xff;
  75. - mac_label->image[i].size[3] = (size >> 24) & 0xff;
  76. + mac_label->image[entry].startSect[0] = block & 0xff;
  77. + mac_label->image[entry].startSect[1] = (block >> 8) & 0xff;
  78. + mac_label->image[entry].startSect[2] = (block >> 16) & 0xff;
  79. + mac_label->image[entry].startSect[3] = (block >> 24) & 0xff;
  80. +
  81. + mac_label->image[entry].size[0] = size & 0xff;
  82. + mac_label->image[entry].size[1] = (size >> 8) & 0xff;
  83. + mac_label->image[entry].size[2] = (size >> 16) & 0xff;
  84. + mac_label->image[entry].size[3] = (size >> 24) & 0xff;
  85. +
  86. + ++entry;
  87. }
  88. + while (entry < 4) {
  89. + mac_label->image[entry].CHSstart[0] = 0xff;
  90. + mac_label->image[entry].CHSstart[1] = 0xff;
  91. + mac_label->image[entry].CHSstart[2] = 0xff;
  92. +
  93. + mac_label->image[entry].CHSend[0] = 0xff;
  94. + mac_label->image[entry].CHSend[1] = 0xff;
  95. + mac_label->image[entry].CHSend[2] = 0xff;
  96. + ++entry;
  97. + }
  98. }
  99. #endif /* PREP_BOOT */
  100. diff -ur cdrtools-2.00.3/mkisofs/mac_label.h cdrtools-2.00.3-local/mkisofs/mac_label.h
  101. --- cdrtools-2.00.3/mkisofs/mac_label.h 2000-03-18 18:23:55.000000000 +0000
  102. +++ cdrtools-2.00.3-local/mkisofs/mac_label.h 2003-07-23 12:49:59.000000000 +0100
  103. @@ -37,6 +37,7 @@
  104. #ifdef PREP_BOOT
  105. struct fdiskPartition {
  106. #define prepPartType 0x41
  107. +#define chrpPartType 0x96
  108. unsigned char boot; /* bootable flag; not used */
  109. unsigned char CHSstart[3]; /* start CHS; not used */
  110. unsigned char type; /* Partition type, = 0x41 (PReP bootable) */
  111. diff -ur cdrtools-2.00.3/mkisofs/mkisofs.c cdrtools-2.00.3-local/mkisofs/mkisofs.c
  112. --- cdrtools-2.00.3/mkisofs/mkisofs.c 2003-05-15 15:12:44.000000000 +0100
  113. +++ cdrtools-2.00.3-local/mkisofs/mkisofs.c 2003-07-30 21:24:16.000000000 +0100
  114. @@ -197,7 +197,7 @@
  115. #ifdef PREP_BOOT
  116. char *prep_boot_image[4];
  117. int use_prep_boot = 0;
  118. -
  119. +int use_chrp_boot = 0;
  120. #endif /* PREP_BOOT */
  121. #endif /* APPLE_HYB */
  122. @@ -401,6 +401,8 @@
  123. #define OPTION_HFS_BLESS 2040
  124. #define OPTION_HFS_PARMS 2041
  125. +#define OPTION_CHRP_BOOT 2042
  126. +
  127. #endif /* APPLE_HYB */
  128. static int save_pname = 0;
  129. @@ -661,6 +663,8 @@
  130. #ifdef PREP_BOOT
  131. {{"prep-boot", required_argument, NULL, OPTION_PREP_BOOT},
  132. '\0', "FILE", "PReP boot image file -- up to 4 are allowed", ONE_DASH},
  133. + {{"chrp-boot", no_argument, NULL, OPTION_CHRP_BOOT},
  134. + '\0', NULL, "Add CHRP boot header", ONE_DASH},
  135. #endif /* PREP_BOOT */
  136. {{"cap", no_argument, NULL, OPTION_CAP},
  137. '\0', NULL, "Look for AUFS CAP Macintosh files", TWO_DASHES},
  138. @@ -2073,13 +2077,13 @@
  139. #ifdef PREP_BOOT
  140. case OPTION_PREP_BOOT:
  141. use_prep_boot++;
  142. - if (use_prep_boot > 4) {
  143. + if (use_prep_boot > 4 - use_chrp_boot) {
  144. #ifdef USE_LIBSCHILY
  145. comerrno(EX_BAD,
  146. - "Maximum of 4 PReP boot images are allowed\n");
  147. + "Maximum of 4 partition entries are allowed\n");
  148. #else
  149. fprintf(stderr,
  150. - "Maximum of 4 PReP boot images are allowed\n");
  151. + "Maximum of 4 partition entries are allowed\n");
  152. #endif
  153. exit(1);
  154. }
  155. @@ -2096,6 +2100,21 @@
  156. exit(1);
  157. }
  158. break;
  159. + case OPTION_CHRP_BOOT:
  160. + if (use_chrp_boot)
  161. + break; /* silently allow duplicates */
  162. + use_chrp_boot = 1;
  163. + if (use_prep_boot > 3) {
  164. +#ifdef USE_LIBSCHILY
  165. + comerrno(EX_BAD,
  166. + "Maximum of 4 partition entries are allowed\n");
  167. +#else
  168. + fprintf(stderr,
  169. + "Maximum of 4 partition entries are allowed\n");
  170. +#endif
  171. + exit(1);
  172. + }
  173. + break;
  174. #endif /* PREP_BOOT */
  175. #endif /* APPLE_HYB */
  176. default:
  177. @@ -2957,7 +2976,7 @@
  178. */
  179. #ifdef APPLE_HYB
  180. #ifdef PREP_BOOT
  181. - if (apple_hyb || use_prep_boot)
  182. + if (apple_hyb || use_prep_boot || use_chrp_boot)
  183. #else /* PREP_BOOT */
  184. if (apple_hyb)
  185. #endif /* PREP_BOOT */
  186. diff -ur cdrtools-2.00.3/mkisofs/mkisofs.h cdrtools-2.00.3-local/mkisofs/mkisofs.h
  187. --- cdrtools-2.00.3/mkisofs/mkisofs.h 2002-12-07 19:59:42.000000000 +0000
  188. +++ cdrtools-2.00.3-local/mkisofs/mkisofs.h 2003-07-23 12:54:29.000000000 +0100
  189. @@ -393,6 +393,7 @@
  190. #ifdef PREP_BOOT
  191. extern char *prep_boot_image[4];
  192. extern int use_prep_boot;
  193. +extern int use_chrp_boot;
  194. #endif /* PREP_BOOT */
  195. #endif /* APPLE_HYB */
  196. diff -ur cdrtools-2.00.3/mkisofs/write.c cdrtools-2.00.3-local/mkisofs/write.c
  197. --- cdrtools-2.00.3/mkisofs/write.c 2002-12-23 14:16:45.000000000 +0000
  198. +++ cdrtools-2.00.3-local/mkisofs/write.c 2003-07-30 21:17:53.000000000 +0100
  199. @@ -2131,7 +2131,7 @@
  200. if (apple_hyb)
  201. hfs_file_gen(start_extent);
  202. #ifdef PREP_BOOT
  203. - else if (use_prep_boot)
  204. + else if (use_prep_boot || use_chrp_boot)
  205. gen_prepboot();
  206. #endif /* PREP_BOOT */
  207. #endif /* APPLE_HYB */
  208. @@ -2290,7 +2290,7 @@
  209. /* reserve space for the label partition - if it is needed */
  210. #ifdef PREP_BOOT
  211. /* a PReP bootable partition needs the map.. */
  212. - if (gen_pt || use_prep_boot)
  213. + if (gen_pt || use_prep_boot || use_chrp_boot)
  214. #else
  215. if (gen_pt)
  216. #endif /* PREP_BOOT */