2007-01-15 15:29:14 +01:00
|
|
|
--- parted-1.6.11/libparted/disk.c.type Fri May 24 00:32:16 2002
|
|
|
|
+++ parted-1.6.11/libparted/disk.c Wed Jul 24 13:47:58 2002
|
|
|
|
@@ -1761,6 +1761,8 @@
|
|
|
|
return N_("lba");
|
|
|
|
case PED_PARTITION_HPSERVICE:
|
|
|
|
return N_("hp-service");
|
|
|
|
+ case PED_PARTITION_TYPE:
|
|
|
|
+ return N_("type");
|
|
|
|
case PED_PARTITION_PALO:
|
|
|
|
return N_("palo");
|
|
|
|
|
|
|
|
--- parted-1.6.11/libparted/labels/dos.c.type Mon Apr 8 12:07:38 2002
|
|
|
|
+++ parted-1.6.11/libparted/labels/dos.c Wed Jul 24 13:47:58 2002
|
|
|
|
@@ -952,6 +952,10 @@
|
|
|
|
disk = part->disk;
|
|
|
|
|
|
|
|
switch (flag) {
|
|
|
|
+ case PED_PARTITION_TYPE:
|
|
|
|
+ dos_data->system = state;
|
|
|
|
+ return 1;
|
|
|
|
+
|
|
|
|
case PED_PARTITION_HIDDEN:
|
|
|
|
if (part->type == PED_PARTITION_EXTENDED) {
|
|
|
|
ped_exception_throw (
|
|
|
|
@@ -1350,6 +1350,9 @@
|
|
|
|
case PED_PARTITION_LBA:
|
|
|
|
return dos_data->lba;
|
|
|
|
|
|
|
|
+ case PED_PARTITION_TYPE:
|
|
|
|
+ return dos_data->system;
|
|
|
|
+
|
|
|
|
case PED_PARTITION_PALO:
|
|
|
|
return dos_data->palo;
|
|
|
|
|
|
|
|
@@ -1374,6 +1374,7 @@
|
|
|
|
case PED_PARTITION_RAID:
|
|
|
|
case PED_PARTITION_LVM:
|
|
|
|
case PED_PARTITION_LBA:
|
|
|
|
+ case PED_PARTITION_TYPE:
|
|
|
|
case PED_PARTITION_PALO:
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
--- parted-1.6.2/parted/ui.c.type Wed Jul 3 02:59:11 2002
|
|
|
|
+++ parted-1.6.2/parted/ui.c Wed Jul 24 13:47:58 2002
|
2007-03-22 21:00:14 +01:00
|
|
|
@@ -891,7 +891,10 @@
|
|
|
|
NULL, 1);
|
|
|
|
if (!input)
|
|
|
|
return 0;
|
|
|
|
- valid = sscanf (input, "%d", value);
|
|
|
|
+ if (strstr(input, "0x") == input)
|
2007-01-15 15:29:14 +01:00
|
|
|
+ valid = sscanf (input, "%x", value);
|
|
|
|
+ else
|
|
|
|
+ valid = sscanf (input, "%d", value);
|
2007-03-22 21:00:14 +01:00
|
|
|
free (input);
|
|
|
|
return valid;
|
2007-01-15 15:29:14 +01:00
|
|
|
}
|
|
|
|
--- parted-1.6.11/include/parted/disk.h.type Wed Apr 10 03:23:11 2002
|
|
|
|
+++ parted-1.6.11/include/parted/disk.h Wed Jul 24 13:47:58 2002
|
|
|
|
@@ -62,8 +62,9 @@
|
|
|
|
PED_PARTITION_LBA=7,
|
|
|
|
PED_PARTITION_HPSERVICE=8,
|
|
|
|
PED_PARTITION_PALO=9,
|
|
|
|
- PED_PARTITION_PREP=10,
|
|
|
|
- PED_PARTITION_MSFT_RESERVED=11
|
|
|
|
+ PED_PARTITION_TYPE=10,
|
|
|
|
+ PED_PARTITION_PREP=11,
|
|
|
|
+ PED_PARTITION_MSFT_RESERVED=12
|
2007-03-22 21:00:14 +01:00
|
|
|
};
|
2007-01-15 15:29:14 +01:00
|
|
|
#define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT
|
|
|
|
#define PED_PARTITION_LAST_FLAG PED_PARTITION_MSFT_RESERVED
|
|
|
|
--- parted-1.6.2/parted/parted.c.type Wed Jul 24 13:47:58 2002
|
|
|
|
+++ parted-1.6.2/parted/parted.c Wed Jul 24 14:26:45 2002
|
|
|
|
@@ -1094,17 +1094,28 @@
|
|
|
|
first_flag = 1;
|
|
|
|
for (flag = ped_partition_flag_next (0); flag;
|
|
|
|
flag = ped_partition_flag_next (flag)) {
|
|
|
|
- if (ped_partition_get_flag (part, flag)) {
|
|
|
|
- if (first_flag)
|
|
|
|
- first_flag = 0;
|
|
|
|
- else {
|
|
|
|
- _res = res;
|
|
|
|
- ped_realloc (&_res, strlen (res)
|
|
|
|
- + 1 + 2);
|
|
|
|
- res = _res;
|
|
|
|
- strncat (res, ", ", 2);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
+ if (first_flag)
|
|
|
|
+ first_flag = 0;
|
|
|
|
+ else {
|
|
|
|
+ _res = res;
|
|
|
|
+ ped_realloc (&_res, strlen (res)
|
|
|
|
+ + 1 + 2);
|
|
|
|
+ res = _res;
|
|
|
|
+ strncat (res, ", ", 2);
|
|
|
|
+ }
|
|
|
|
+ if (flag == PED_PARTITION_TYPE) {
|
|
|
|
+ int xtype = ped_partition_get_flag (part, flag);
|
|
|
|
+ if (xtype) {
|
|
|
|
+ char tmpstr[21];
|
|
|
|
+ int len = snprintf(tmpstr,sizeof(tmpstr)-1,"type=%02x",xtype);
|
|
|
|
+ _res = res;
|
|
|
|
+ ped_realloc (&_res, strlen (res) + 1 +
|
|
|
|
+ ((len>sizeof(tmpstr))?sizeof(tmpstr):len) );
|
|
|
|
+ res = _res;
|
|
|
|
+ strncat (res, tmpstr, 21);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if (ped_partition_get_flag (part, flag)) {
|
|
|
|
name = _(ped_partition_flag_get_name (flag));
|
|
|
|
_res = res;
|
|
|
|
ped_realloc (&_res, strlen (res) + 1
|
|
|
|
@@ -1726,12 +1737,19 @@
|
|
|
|
goto error_destroy_disk;
|
|
|
|
if (!command_line_get_part_flag (_("Flag to Invert?"), part, &flag))
|
|
|
|
goto error_destroy_disk;
|
|
|
|
- state = (ped_partition_get_flag (part, flag) == 0 ? 1 : 0);
|
|
|
|
+ if( flag == PED_PARTITION_TYPE )
|
|
|
|
+ state = ped_partition_get_flag (part, flag);
|
|
|
|
+ else
|
|
|
|
+ state = (ped_partition_get_flag (part, flag) == 0 ? 1 : 0);
|
|
|
|
|
|
|
|
- if (!is_toggle_mode) {
|
|
|
|
+ if (!is_toggle_mode && flag != PED_PARTITION_TYPE ) {
|
|
|
|
if (!command_line_get_state (_("New state?"), &state))
|
|
|
|
goto error_destroy_disk;
|
|
|
|
}
|
|
|
|
+ else if( flag == PED_PARTITION_TYPE ) {
|
|
|
|
+ if (!command_line_get_integer (_("New type?"), &state))
|
|
|
|
+ goto error_destroy_disk;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (!ped_partition_set_flag (part, flag, state))
|
|
|
|
goto error_destroy_disk;
|