~ubuntu-branches/ubuntu/intrepid/parted/intrepid

« back to all changes in this revision

Viewing changes to debian/patches/sparc-new-label.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-06-24 14:31:05 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080624143105-rd7yw67a9qnvh51i
Tags: 1.8.8.git.2008.03.24-7ubuntu1
* Resynchronise with Debian (LP: #237568). Remaining changes:
  - swap-uuid.dpatch: Create UUIDs on new swap partitions.
  - gptsync.dpatch: On Intel Mac systems, write a synced MBR rather than a
    protective MBR.
  - Add -fno-stack-protector on sparc.
  - sparc-new-label.dpatch: Fix sparc disk label generation. This is
    required for LDOM and parallel installations with Solaris 10.
  - loop-partitions.dpatch: Loop devices can only have one partition, so
    don't generate device names such as "/dev/loop0p1".
  - unpartitioned-disks.dpatch: Don't try to call BLKPG ioctls on
    unpartitionable disks (only implemented for loop devices at the
    moment), as they will always fail.
  - When building with gcc-4.3, add -Wno-array-bounds to CFLAGS.
  - Cell partition tables are misdetected as pc98, so disable pc98 support
    on powerpc.
  - array-bounds.dpatch: Backport patch from git to allow building with
    gcc-4.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## sparc-new-label.dpatch by  <fabbione@vultus5.int.fabbione.net>
 
2
## sparc-new-label.dpatch by David S. Miller and
 
3
## Fabio M. Di Nitto <fabbione@ubuntu.com>
3
4
##
4
5
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: No description.
 
6
## DP: Fix sparc disk label generation. This is required for LDOM and
 
7
## DP: parallel installations with Solaris 10.
6
8
 
7
9
@DPATCH@
8
 
diff -urNad parted-1.7.1~/libparted/labels/sun.c parted-1.7.1/libparted/labels/sun.c
9
 
--- parted-1.7.1~/libparted/labels/sun.c        2007-07-02 07:21:20.000000000 +0200
10
 
+++ parted-1.7.1/libparted/labels/sun.c 2007-07-02 07:22:37.000000000 +0200
11
 
@@ -43,9 +43,27 @@
 
10
diff -urNad parted-1.8.8.git.2008.03.24~/libparted/labels/sun.c parted-1.8.8.git.2008.03.24/libparted/labels/sun.c
 
11
--- parted-1.8.8.git.2008.03.24~/libparted/labels/sun.c 2008-06-24 12:52:11.000000000 +0100
 
12
+++ parted-1.8.8.git.2008.03.24/libparted/labels/sun.c  2008-06-24 12:56:06.000000000 +0100
 
13
@@ -38,12 +38,30 @@
12
14
 #define SUN_DISK_MAGIC         0xDABE  /* Disk magic number */
13
15
 #define SUN_DISK_MAXPARTITIONS 8
14
16
 
36
38
 #define WHOLE_DISK_PART                2       /* as in 0, 1, 2 (3rd partition) */
37
39
-#define LINUX_SWAP_ID          0x82
38
40
 
39
 
 typedef struct {
40
 
        u_int32_t       start_cylinder; /* where the part starts... */
41
 
@@ -53,17 +71,30 @@
42
 
 } __attribute__ ((packed)) SunRawPartition;
 
41
 typedef struct _SunRawPartition     SunRawPartition;
 
42
-typedef struct _SunPartitionInfo    SunPartitionInfo;
 
43
+typedef struct _SunPartInfo         SunPartInfo;
 
44
 typedef struct _SunRawLabel         SunRawLabel;
 
45
 typedef struct _SunPartitionData    SunPartitionData;
 
46
 typedef struct _SunDiskData         SunDiskData;
 
47
@@ -53,18 +71,31 @@
 
48
        u_int32_t       num_sectors;    /* ...and it's length */
 
49
 };
43
50
 
44
 
 typedef struct {
 
51
-struct __attribute__ ((packed)) _SunPartitionInfo {
45
52
-       u_int8_t        spare1;
46
53
-       u_int8_t        id;             /* Partition type */
47
54
-       u_int8_t        spare2;
48
55
-       u_int8_t        flags;          /* Partition flags */
49
 
-} __attribute__ ((packed)) SunPartitionInfo;
50
 
+        u_int16_t      tag;            /* Tagged type */
 
56
+struct __attribute__ ((packed)) _SunPartInfo {
 
57
+       u_int16_t       tag;            /* Tagged type */
51
58
+       u_int16_t       flags;          /* Partition flags */
52
 
+} __attribute__ ((packed)) SunPartInfo;
53
 
+
 
59
 };
 
60
 
54
61
+#define SUN_LABEL_ID_SIZE      128
55
62
+#define SUN_VOLUME_ID_SIZE     8
56
63
+
57
64
+#define SUN_LABEL_VERSION      0x00000001
58
65
+#define SUN_LABEL_SANE         0x600ddeee
59
 
 
60
 
 typedef struct {
 
66
+
 
67
 struct __attribute__ ((packed)) _SunRawLabel {
61
68
-       char            info[128];      /* Informative text string */
62
69
-       u_int8_t        spare0[14];
63
70
-       SunPartitionInfo infos[SUN_DISK_MAXPARTITIONS];
65
72
+       char            label_id[SUN_LABEL_ID_SIZE];    /* Informative text string */
66
73
+       u_int32_t       version;
67
74
+       char            volume_id[SUN_VOLUME_ID_SIZE];
68
 
+        u_int16_t      num_part;
 
75
+       u_int16_t       num_part;
69
76
+       SunPartInfo     infos[SUN_DISK_MAXPARTITIONS];
70
 
+        u_int16_t      pad1;
71
 
+        u_int32_t      bootinfo[3];
72
 
+        u_int32_t      sanity;
73
 
+        u_int32_t      resv[10];
74
 
+        u_int32_t      part_timestamps[SUN_DISK_MAXPARTITIONS];
75
 
+        u_int32_t      write_reinstruct;
76
 
+        u_int32_t      read_reinstruct;
 
77
+       u_int16_t       pad1;
 
78
+       u_int32_t       bootinfo[3];
 
79
+       u_int32_t       sanity;
 
80
+       u_int32_t       resv[10];
 
81
+       u_int32_t       part_timestamps[SUN_DISK_MAXPARTITIONS];
 
82
+       u_int32_t       write_reinstruct;
 
83
+       u_int32_t       read_reinstruct;
77
84
+       u_int8_t        pad2[148];
78
85
        u_int16_t       rspeed;         /* Disk rotational speed */
79
86
        u_int16_t       pcylcount;      /* Physical cylinder count */
80
87
        u_int16_t       sparecyl;       /* extra sects per cylinder */
81
 
@@ -194,6 +225,9 @@
 
88
@@ -193,6 +224,9 @@
82
89
 
83
90
        /* #gentoo-sparc people agree that nacyl = 0 is the best option */
84
91
        label->magic    = PED_CPU_TO_BE16 (SUN_DISK_MAGIC);
88
95
        label->nacyl    = 0;
89
96
        label->pcylcount        = PED_CPU_TO_BE16 (bios_geom->cylinders);
90
97
        label->rspeed   = PED_CPU_TO_BE16 (5400);
91
 
@@ -204,13 +238,13 @@
 
98
@@ -203,13 +237,13 @@
92
99
        label->ncyl     = PED_CPU_TO_BE16 (bios_geom->cylinders - 0);
93
100
 
94
101
        /* Add a whole disk partition at a minimum */
104
111
                 "GNU Parted Custom cyl %d alt %d hd %d sec %d",
105
112
                 PED_BE16_TO_CPU(label->ncyl),
106
113
                 PED_BE16_TO_CPU(label->nacyl),
107
 
@@ -327,9 +361,9 @@
 
114
@@ -326,9 +360,9 @@
108
115
        for (i = 0; i < SUN_DISK_MAXPARTITIONS; i++) {
109
116
                if (!PED_BE32_TO_CPU(label->partitions[i].num_sectors))
110
117
                        continue;
116
123
                        continue;
117
124
 
118
125
                start = PED_BE32_TO_CPU(label->partitions[i].start_cylinder)
119
 
@@ -342,11 +376,11 @@
 
126
@@ -341,11 +375,11 @@
120
127
                        goto error;
121
128
 
122
129
                sun_data = part->disk_specific;
133
140
 
134
141
                part->num = i + 1;
135
142
                part->fs_type = ped_file_system_probe (&part->geom);
136
 
@@ -374,7 +408,7 @@
 
143
@@ -373,7 +407,7 @@
137
144
 
138
145
        if (!ped_device_read (disk->dev, &old_label, 0, 1))
139
146
                return;
142
149
            && PED_BE16_TO_CPU (old_label.magic) == SUN_DISK_MAGIC)
143
150
                memcpy (&sun_specific->raw_label, &old_label, 512);
144
151
 }
145
 
@@ -399,7 +433,7 @@
 
152
@@ -398,7 +432,7 @@
146
153
        memset (label->partitions, 0,
147
154
                sizeof (SunRawPartition) * SUN_DISK_MAXPARTITIONS);
148
155
        memset (label->infos, 0,
151
158
 
152
159
        for (i = 0; i < SUN_DISK_MAXPARTITIONS; i++) {
153
160
                part = ped_disk_get_partition (disk, i + 1);
154
 
@@ -409,7 +443,7 @@
 
161
@@ -408,7 +442,7 @@
155
162
                           partition, so let's put it there for safety
156
163
                           sake.  */
157
164
 
160
167
                        label->partitions[i].start_cylinder = 0;
161
168
                        label->partitions[i].num_sectors = 
162
169
                                PED_CPU_TO_BE32(disk_data->length);
163
 
@@ -419,7 +453,7 @@
 
170
@@ -418,7 +452,7 @@
164
171
                        continue;
165
172
 
166
173
                sun_data = part->disk_specific;
169
176
                label->partitions[i].start_cylinder
170
177
                        = PED_CPU_TO_BE32 (part->geom.start
171
178
                                / (disk->dev->bios_geom.sectors
172
 
@@ -539,28 +573,28 @@
 
179
@@ -537,28 +571,28 @@
173
180
        part->fs_type = fs_type;
174
181
 
175
182
        if (sun_data->is_boot) {