diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-12 19:30:44 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-12 19:30:44 +0000 |
commit | 98ae2160b62b99424e5793e97d5abd4e3c2e576b (patch) | |
tree | 58f4e56d32330ea4abe200f3b2b0e21392d944e1 /util-linux/fdisk_aix.c | |
parent | a6dbb08a48903cb8f31fad2cf2d1cffa92bd4808 (diff) | |
download | busybox-w32-98ae2160b62b99424e5793e97d5abd4e3c2e576b.tar.gz busybox-w32-98ae2160b62b99424e5793e97d5abd4e3c2e576b.tar.bz2 busybox-w32-98ae2160b62b99424e5793e97d5abd4e3c2e576b.zip |
fdisk: separate sun/aix/etc code into #included files
Diffstat (limited to 'util-linux/fdisk_aix.c')
-rw-r--r-- | util-linux/fdisk_aix.c | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/util-linux/fdisk_aix.c b/util-linux/fdisk_aix.c new file mode 100644 index 000000000..a3d5fe15f --- /dev/null +++ b/util-linux/fdisk_aix.c | |||
@@ -0,0 +1,76 @@ | |||
1 | #ifdef CONFIG_FEATURE_AIX_LABEL | ||
2 | /* | ||
3 | * Copyright (C) Andreas Neuper, Sep 1998. | ||
4 | * This file may be redistributed under | ||
5 | * the terms of the GNU Public License. | ||
6 | */ | ||
7 | |||
8 | typedef struct { | ||
9 | unsigned int magic; /* expect AIX_LABEL_MAGIC */ | ||
10 | unsigned int fillbytes1[124]; | ||
11 | unsigned int physical_volume_id; | ||
12 | unsigned int fillbytes2[124]; | ||
13 | } aix_partition; | ||
14 | |||
15 | #define AIX_LABEL_MAGIC 0xc9c2d4c1 | ||
16 | #define AIX_LABEL_MAGIC_SWAPPED 0xc1d4c2c9 | ||
17 | #define AIX_INFO_MAGIC 0x00072959 | ||
18 | #define AIX_INFO_MAGIC_SWAPPED 0x59290700 | ||
19 | |||
20 | #define aixlabel ((aix_partition *)MBRbuffer) | ||
21 | |||
22 | |||
23 | /* | ||
24 | Changes: | ||
25 | * 1999-03-20 Arnaldo Carvalho de Melo <acme@conectiva.com.br> | ||
26 | * Internationalization | ||
27 | * | ||
28 | * 2003-03-20 Phillip Kesling <pkesling@sgi.com> | ||
29 | * Some fixes | ||
30 | */ | ||
31 | |||
32 | static int aix_other_endian; | ||
33 | static short aix_volumes = 1; | ||
34 | |||
35 | /* | ||
36 | * only dealing with free blocks here | ||
37 | */ | ||
38 | |||
39 | static void | ||
40 | aix_info(void) | ||
41 | { | ||
42 | puts( | ||
43 | _("\n\tThere is a valid AIX label on this disk.\n" | ||
44 | "\tUnfortunately Linux cannot handle these\n" | ||
45 | "\tdisks at the moment. Nevertheless some\n" | ||
46 | "\tadvice:\n" | ||
47 | "\t1. fdisk will destroy its contents on write.\n" | ||
48 | "\t2. Be sure that this disk is NOT a still vital\n" | ||
49 | "\t part of a volume group. (Otherwise you may\n" | ||
50 | "\t erase the other disks as well, if unmirrored.)\n" | ||
51 | "\t3. Before deleting this physical volume be sure\n" | ||
52 | "\t to remove the disk logically from your AIX\n" | ||
53 | "\t machine. (Otherwise you become an AIXpert).") | ||
54 | ); | ||
55 | } | ||
56 | |||
57 | static int | ||
58 | check_aix_label(void) | ||
59 | { | ||
60 | if (aixlabel->magic != AIX_LABEL_MAGIC && | ||
61 | aixlabel->magic != AIX_LABEL_MAGIC_SWAPPED) { | ||
62 | current_label_type = 0; | ||
63 | aix_other_endian = 0; | ||
64 | return 0; | ||
65 | } | ||
66 | aix_other_endian = (aixlabel->magic == AIX_LABEL_MAGIC_SWAPPED); | ||
67 | update_units(); | ||
68 | current_label_type = label_aix; | ||
69 | partitions = 1016; | ||
70 | aix_volumes = 15; | ||
71 | aix_info(); | ||
72 | /*aix_nolabel();*/ /* %% */ | ||
73 | /*aix_label = 1;*/ /* %% */ | ||
74 | return 1; | ||
75 | } | ||
76 | #endif /* AIX_LABEL */ | ||