summaryrefslogtreecommitdiffstats
path: root/balkan
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-08-17 20:48:52 +0000
committerErik Troan <ewt@redhat.com>1999-08-17 20:48:52 +0000
commit49de9c7010421a7dc665c93e5f8692ecffcd9845 (patch)
tree1fd944926d114d390726b82fd061397fe6542e80 /balkan
parentcff6aae3f62631734d31e62f59deb423563eb54b (diff)
downloadanaconda-49de9c7010421a7dc665c93e5f8692ecffcd9845.tar.gz
anaconda-49de9c7010421a7dc665c93e5f8692ecffcd9845.tar.xz
anaconda-49de9c7010421a7dc665c93e5f8692ecffcd9845.zip
added generic partition types
Diffstat (limited to 'balkan')
-rw-r--r--balkan/balkan.h4
-rw-r--r--balkan/dos.c32
2 files changed, 34 insertions, 2 deletions
diff --git a/balkan/balkan.h b/balkan/balkan.h
index 905047c9d..c4fe75fa4 100644
--- a/balkan/balkan.h
+++ b/balkan/balkan.h
@@ -5,6 +5,10 @@
#define BALKAN_ERROR_BADMAGIC 2
#define BALKAN_ERROR_BADTABLE 3
+#define BALKAN_PART_DOS 1
+#define BALKAN_PART_EXT2 2
+#define BALKAN_PART_OTHER 3
+
struct partition {
long startSector;
long size; /* in sectors */
diff --git a/balkan/dos.c b/balkan/dos.c
index 687756489..8cfeadda0 100644
--- a/balkan/dos.c
+++ b/balkan/dos.c
@@ -105,7 +105,7 @@ static int readNextTable(int fd, struct partitionTable * table, int nextNum,
}
int dospReadTable(int fd, struct partitionTable * table) {
- int i;
+ int i, rc;
table->maxNumPartitions = 16;
@@ -114,7 +114,35 @@ int dospReadTable(int fd, struct partitionTable * table) {
table->sectorSize = SECTOR_SIZE;
- return readNextTable(fd, table, 0, 0, 0);
+ rc = readNextTable(fd, table, 0, 0, 0);
+
+ if (!rc) {
+ for (i = 0; i < 16; i++) {
+ if (table->parts[i].type == -1) continue;
+
+ switch (table->parts[i].type) {
+ case 0x01:
+ case 0x04:
+ case 0x06:
+ case 0x0b:
+ case 0x0c:
+ case 0x0e:
+ case 0x0f:
+ table->parts[i].type = BALKAN_PART_DOS;
+ break;
+
+ case 0x83:
+ table->parts[i].type = BALKAN_PART_EXT2;
+ break;
+
+ default:
+ table->parts[i].type = BALKAN_PART_OTHER;
+ break;
+ }
+ }
+ }
+
+ return rc;
}
#ifdef STANDALONE_TEST