9 #include <linux/ctype.h>
13 #ifdef CONFIG_PPC_PMAC
14 #include <asm/machdep.h>
22 static inline void mac_fix_string(
char *stg,
int len)
26 for (i = len - 1; i >= 0 && stg[
i] ==
' '; i--)
34 int slot, blocks_in_map;
36 #ifdef CONFIG_PPC_PMAC
38 int found_root_goodness = 0;
44 md = read_part_sector(state, 0, §);
53 data = read_part_sector(state, secsize/512, §);
62 if (blocks_in_map < 0 || blocks_in_map >= DISK_MAX_PARTS) {
67 for (slot = 1; slot <= blocks_in_map; ++
slot) {
68 int pos = slot * secsize;
70 data = read_part_sector(state, pos/512, §);
76 put_partition(state, slot,
81 state->
parts[
slot].flags = ADDPART_FLAG_RAID;
82 #ifdef CONFIG_PPC_PMAC
87 if (machine_is(powermac)) {
91 mac_fix_string(part->
name, 32);
92 mac_fix_string(part->
type, 32);
107 for (i = 0; i <= l - 4; ++
i) {
118 if (goodness > found_root_goodness) {
120 found_root_goodness = goodness;
125 #ifdef CONFIG_PPC_PMAC
126 if (found_root_goodness)
128 found_root_goodness);
131 put_dev_sector(sect);