~mmach/netext73/busybox

« back to all changes in this revision

Viewing changes to util-linux/fdisk_aix.c

  • Committer: mmach
  • Date: 2022-08-22 15:28:31 UTC
  • Revision ID: netbit73@gmail.com-20220822152831-vrsxgw6c75b03ujx
1.35.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 */
7
7
 
8
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];
 
9
        uint32_t magic;        /* expect AIX_LABEL_MAGIC */
 
10
        uint32_t fillbytes1[124];
 
11
        uint32_t physical_volume_id;
 
12
        uint32_t fillbytes2[124];
13
13
} aix_partition;
14
14
 
15
15
#define AIX_LABEL_MAGIC         0xc9c2d4c1
17
17
#define AIX_INFO_MAGIC          0x00072959
18
18
#define AIX_INFO_MAGIC_SWAPPED  0x59290700
19
19
 
20
 
#define aixlabel ((aix_partition *)MBRbuffer)
21
 
 
22
 
 
23
20
/*
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
 
*/
 
21
 * Changes:
 
22
 * 1999-03-20 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
 
23
 *     Internationalization
 
24
 *
 
25
 * 2003-03-20 Phillip Kesling <pkesling@sgi.com>
 
26
 *      Some fixes
 
27
 */
31
28
 
32
 
static smallint aix_other_endian; /* bool */
33
 
static smallint aix_volumes = 1; /* max 15 */
 
29
// Write-only vars, unfinished code?
 
30
//static smallint aix_other_endian; /* bool */
 
31
//static smallint aix_volumes = 1; /* max 15 */
34
32
 
35
33
/*
36
34
 * only dealing with free blocks here
54
52
static int
55
53
check_aix_label(void)
56
54
{
 
55
        aix_partition *aixlabel = (void*)MBRbuffer;
 
56
 
57
57
        if (aixlabel->magic != AIX_LABEL_MAGIC
58
58
         && aixlabel->magic != AIX_LABEL_MAGIC_SWAPPED
59
59
        ) {
60
 
                current_label_type = 0;
61
 
                aix_other_endian = 0;
 
60
                current_label_type = LABEL_DOS;
 
61
//              aix_other_endian = 0;
62
62
                return 0;
63
63
        }
64
 
        aix_other_endian = (aixlabel->magic == AIX_LABEL_MAGIC_SWAPPED);
 
64
//      aix_other_endian = (aixlabel->magic == AIX_LABEL_MAGIC_SWAPPED);
65
65
        update_units();
66
66
        current_label_type = LABEL_AIX;
67
67
        g_partitions = 1016;
68
 
        aix_volumes = 15;
 
68
//      aix_volumes = 15;
69
69
        aix_info();
70
70
        /*aix_nolabel();*/              /* %% */
71
71
        /*aix_label = 1;*/              /* %% */