1 |
> 8 16 80418240 sdb |
2 |
> 8 27 8 sdb11 |
3 |
|
4 |
it's very possible that the mini creates "extra" partitions for some type |
5 |
of resource management. |
6 |
|
7 |
This is how I installed mac-fdisk-0.1-r4: |
8 |
|
9 |
$ FEATURES=keepwork ACCEPT_KEYWORDS="~x86" emerge -avt mac-fdisk |
10 |
|
11 |
Here's the patch, same instructions as before. I also added some other |
12 |
stuff to fix the warnings that were popping up. |
13 |
|
14 |
--cut here-- |
15 |
diff -ru mac-fdisk-0.1/errors.c /tmp/mac-fdisk-0.1/errors.c |
16 |
--- mac-fdisk-0.1/errors.c 1997-01-14 15:29:39.000000000 -0500 |
17 |
+++ /tmp/mac-fdisk-0.1/errors.c 2005-10-19 21:49:03.000000000 -0400 |
18 |
@@ -115,11 +115,7 @@ |
19 |
va_end(ap); |
20 |
|
21 |
#ifdef __linux__ |
22 |
- if (value > 0 && value < sys_nerr) { |
23 |
- fprintf(stderr, " (%s)\n", sys_errlist[value]); |
24 |
- } else { |
25 |
- fprintf(stderr, "\n"); |
26 |
- } |
27 |
+ fprintf(stderr, " (%s)\n", strerror(value)); |
28 |
#else |
29 |
fprintf(stderr, "\n"); |
30 |
#endif |
31 |
@@ -144,11 +140,7 @@ |
32 |
va_end(ap); |
33 |
|
34 |
#ifdef __linux__ |
35 |
- if (value > 0 && value < sys_nerr) { |
36 |
- fprintf(stderr, " (%s)\n", sys_errlist[value]); |
37 |
- } else { |
38 |
- fprintf(stderr, "\n"); |
39 |
- } |
40 |
+ fprintf(stderr, " (%s)\n", strerror(value)); |
41 |
#else |
42 |
fprintf(stderr, "\n"); |
43 |
#endif |
44 |
diff -ru mac-fdisk-0.1/fdisk.c /tmp/mac-fdisk-0.1/fdisk.c |
45 |
--- mac-fdisk-0.1/fdisk.c 2005-10-19 21:51:48.000000000 -0400 |
46 |
+++ /tmp/mac-fdisk-0.1/fdisk.c 2005-10-19 21:44:22.000000000 -0400 |
47 |
@@ -1415,7 +1415,7 @@ |
48 |
} |
49 |
} |
50 |
|
51 |
-void main(int argc, char **argv) |
52 |
+int main(int argc, char **argv) |
53 |
{ |
54 |
if (argc > 3) |
55 |
fatal(usage); |
56 |
diff -ru mac-fdisk-0.1/fdisklabel.c /tmp/mac-fdisk-0.1/fdisklabel.c |
57 |
--- mac-fdisk-0.1/fdisklabel.c 2005-10-19 21:51:48.000000000 -0400 |
58 |
+++ /tmp/mac-fdisk-0.1/fdisklabel.c 2005-10-19 21:40:18.000000000 -0400 |
59 |
@@ -68,7 +68,7 @@ |
60 |
static int bsd_readlabel (struct partition *p, struct disklabel *d); |
61 |
static int bsd_writelabel (struct partition *p, struct disklabel *d); |
62 |
static void sync_disks (void); |
63 |
-#if defined (i386) |
64 |
+#if defined (i386) || defined (__x86_64__) |
65 |
static int bsd_translate_fstype (int linux_type); |
66 |
static void bsd_link_part (void); |
67 |
#endif |
68 |
@@ -78,7 +78,7 @@ |
69 |
|
70 |
static struct disklabel bsd_dlabel; |
71 |
static char buffer[BSD_BBSIZE]; |
72 |
-#if defined (i386) |
73 |
+#if defined (i386) || defined (__x86_64__) |
74 |
static struct partition *bsd_part; |
75 |
static int bsd_part_index; |
76 |
#endif |
77 |
@@ -95,13 +95,13 @@ |
78 |
" n add a new BSD partition\n" |
79 |
" p print BSD partition table\n" |
80 |
" q quit without saving changes\n" |
81 |
-#if defined (i386) |
82 |
+#if defined (i386) || defined (__x86_64__) |
83 |
" r return to main menu\n" |
84 |
#endif |
85 |
" s show complete disklabel\n" |
86 |
" t change a partition's filesystem id\n" |
87 |
" w write disklabel to disk\n" |
88 |
-#if defined (i386) |
89 |
+#if defined (i386) || defined (__x86_64__) |
90 |
" x link BSD partition to non-BSD partition" |
91 |
#endif |
92 |
); |
93 |
@@ -110,7 +110,7 @@ |
94 |
void |
95 |
bselect (void) |
96 |
{ |
97 |
-#if defined (i386) |
98 |
+#if defined (i386) || defined (__x86_64__) |
99 |
int t; |
100 |
|
101 |
for (t=0; t<4; t++) |
102 |
@@ -181,7 +181,7 @@ |
103 |
case 'w': |
104 |
bsd_write_disklabel (); |
105 |
break; |
106 |
-#if defined (i386) |
107 |
+#if defined (i386) || defined (__x86_64__) |
108 |
case 'r': |
109 |
return; |
110 |
case 'x': |
111 |
@@ -219,7 +219,7 @@ |
112 |
if (!bsd_check_new_partition (&i)) |
113 |
return; |
114 |
|
115 |
-#if defined (i386) |
116 |
+#if defined (i386) || defined (__x86_64__) |
117 |
begin = bsd_part -> start_sect; |
118 |
end = begin + bsd_part -> nr_sects - 1; |
119 |
#elif defined (__alpha__) || defined (__powerpc__) |
120 |
@@ -253,7 +253,7 @@ |
121 |
|
122 |
if (show_all) |
123 |
{ |
124 |
-#if defined (i386) |
125 |
+#if defined (i386) || defined (__x86_64__) |
126 |
fprintf(f, "# %s%d:\n", disk_device, bsd_part_index+1); |
127 |
#elif defined (__alpha__) || defined (__powerpc__) |
128 |
fprintf(f, "# %s:\n", disk_device); |
129 |
@@ -348,7 +348,7 @@ |
130 |
static void |
131 |
bsd_write_disklabel (void) |
132 |
{ |
133 |
-#if defined (i386) |
134 |
+#if defined (i386) || defined (__x86_64__) |
135 |
printf ("Writing disklabel to %s%d.\n", disk_device, bsd_part_index+1); |
136 |
bsd_writelabel (bsd_part, &bsd_dlabel); |
137 |
#elif defined (__alpha__) || defined (__powerpc__) |
138 |
@@ -362,7 +362,7 @@ |
139 |
{ |
140 |
char c; |
141 |
|
142 |
-#if defined (i386) |
143 |
+#if defined (i386) || defined (__x86_64__) |
144 |
fprintf (stderr, "%s%d contains no disklabel.\n", |
145 |
disk_device, bsd_part_index+1); |
146 |
#elif defined (__alpha__) || defined (__powerpc__) |
147 |
@@ -372,7 +372,7 @@ |
148 |
while (1) |
149 |
if ((c = tolower (read_char ("Do you want to create a disklabel? (y/n) "))) == 'y') |
150 |
{ |
151 |
-#if defined (i386) |
152 |
+#if defined (i386) || defined (__x86_64__) |
153 |
if (bsd_initlabel (bsd_part, &bsd_dlabel, bsd_part_index) == 1) |
154 |
#elif defined (__alpha__) || defined (__powerpc__) || defined (__mc68000__) |
155 |
if (bsd_initlabel (NULL, &bsd_dlabel, 0) == 1) |
156 |
@@ -503,7 +503,7 @@ |
157 |
|
158 |
bcopy (&dl, d, sizeof (struct disklabel)); |
159 |
|
160 |
-#if defined (i386) |
161 |
+#if defined (i386) || defined (__x86_64__) |
162 |
sector = bsd_part -> start_sect; |
163 |
#elif defined (__powerpc__) |
164 |
sector = 0; |
165 |
@@ -517,7 +517,7 @@ |
166 |
if (BSD_BBSIZE != write (fd, buffer, BSD_BBSIZE)) |
167 |
fatal (unable_to_write); |
168 |
|
169 |
-#if defined (i386) |
170 |
+#if defined (i386) || defined (__x86_64__) |
171 |
printf ("Bootstrap installed on %s%d.\n", disk_device, bsd_part_index+1); |
172 |
#elif defined (__alpha__) || defined (__powerpc__) |
173 |
printf ("Bootstrap installed on %s.\n", disk_device); |
174 |
@@ -621,7 +621,7 @@ |
175 |
d -> d_subtype = BSD_DSTYPE_INDOSPART & pindex; |
176 |
#endif |
177 |
|
178 |
-#if defined (i386) |
179 |
+#if defined (i386) || defined (__x86_64__) |
180 |
d -> d_flags = BSD_D_DOSPART; |
181 |
#else |
182 |
d -> d_flags = 0; |
183 |
@@ -644,7 +644,7 @@ |
184 |
d -> d_bbsize = BSD_BBSIZE; |
185 |
d -> d_sbsize = BSD_SBSIZE; |
186 |
|
187 |
-#if defined (i386) |
188 |
+#if defined (i386) || defined (__x86_64__) |
189 |
d -> d_npartitions = 4; |
190 |
pp = &d -> d_partitions[2]; /* Partition C should be the NetBSD partition */ |
191 |
pp -> p_offset = p -> start_sect; |
192 |
@@ -670,7 +670,7 @@ |
193 |
{ |
194 |
int t, sector; |
195 |
|
196 |
-#if defined (i386) |
197 |
+#if defined (i386) || defined (__x86_64__) |
198 |
sector = p -> start_sect; |
199 |
#elif defined (__alpha__) || defined (__powerpc__) |
200 |
sector = 0; |
201 |
@@ -704,7 +704,7 @@ |
202 |
{ |
203 |
int sector; |
204 |
|
205 |
-#if defined (i386) |
206 |
+#if defined (i386) || defined (__x86_64__) |
207 |
sector = p -> start_sect + BSD_LABELSECTOR; |
208 |
#elif defined (__alpha__) || defined (__powerpc__) |
209 |
sector = BSD_LABELSECTOR; |
210 |
@@ -745,7 +745,7 @@ |
211 |
sleep (4); |
212 |
} |
213 |
|
214 |
-#if defined (i386) |
215 |
+#if defined (i386) || defined (__x86_64__) |
216 |
static int |
217 |
bsd_translate_fstype (int linux_type) |
218 |
{ |
219 |
diff -ru mac-fdisk-0.1/fdisklabel.h /tmp/mac-fdisk-0.1/fdisklabel.h |
220 |
--- mac-fdisk-0.1/fdisklabel.h 2005-10-19 21:51:48.000000000 -0400 |
221 |
+++ /tmp/mac-fdisk-0.1/fdisklabel.h 2005-10-19 21:39:20.000000000 -0400 |
222 |
@@ -35,7 +35,7 @@ |
223 |
#define BSD_MAXPARTITIONS 8 |
224 |
#define BSD_LINUX_BOOTDIR "/usr/ucb/mdec" |
225 |
|
226 |
-#if defined (i386) |
227 |
+#if defined (i386) || defined (__x86_64__) |
228 |
#define BSD_LABELSECTOR 1 |
229 |
#define BSD_LABELOFFSET 0 |
230 |
#define BSD_BBSIZE 8192 /* size of boot area, with label */ |
231 |
diff -ru mac-fdisk-0.1/kernel-defs.h /tmp/mac-fdisk-0.1/kernel-defs.h |
232 |
--- mac-fdisk-0.1/kernel-defs.h 2005-10-19 21:51:48.000000000 -0400 |
233 |
+++ /tmp/mac-fdisk-0.1/kernel-defs.h 2005-10-19 21:42:25.000000000 -0400 |
234 |
@@ -15,8 +15,8 @@ |
235 |
/* from asm/ioctl.h */ |
236 |
#define _IOC_NRBITS 8 |
237 |
#define _IOC_TYPEBITS 8 |
238 |
-#define _IOC_SIZEBITS 13 |
239 |
-#define _IOC_DIRBITS 3 |
240 |
+// #define _IOC_SIZEBITS 13 |
241 |
+// #define _IOC_DIRBITS 3 |
242 |
|
243 |
#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) |
244 |
#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) |
245 |
|
246 |
-- |
247 |
gentoo-amd64@g.o mailing list |