Gert Hulselmans
2011-Jan-24  22:08 UTC
[PATCH] disklib: Detect new Syslinux (normal + isohybrid) MBR
Add detection code for new Syslinux (normal + isohybrid) MBR to disklib.
Switch old Syslinux MBR and Master Boot LoaDeR detection code.
Signed-off-by: Gert Hulselmans <gerth at zytor.com>
---
 com32/gpllib/disk/mbrs.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/com32/gpllib/disk/mbrs.c b/com32/gpllib/disk/mbrs.c
index 41bb20c..79c62da 100644
--- a/com32/gpllib/disk/mbrs.c
+++ b/com32/gpllib/disk/mbrs.c
@@ -39,7 +39,16 @@ void get_mbr_string(const uint32_t label, char *buffer, const
int buffer_size)
 	strlcpy(buffer, "Acer 3", buffer_size - 1);
 	break;
     case 0x33c0:
-	strlcpy(buffer, "Windows", buffer_size - 1);
+	/* We need more than 2 bytes */
+	if (((label >> 8) & 0xff) == 0x8e)
+	    strlcpy(buffer, "Windows", buffer_size - 1);
+	else if (((label >> 8) & 0xff) == 0xfa)
+	    strlcpy(buffer, "Syslinux", buffer_size - 1);
+	else
+	    strlcpy(buffer, "Unknown mbr", buffer_size - 1);
+	break;
+    case 0x33ed:
+	strlcpy(buffer, "Syslinux ISOhybrid", buffer_size - 1);
 	break;
     case 0x33ff:
 	strlcpy(buffer, "HP/Gateway", buffer_size - 1);
@@ -78,10 +87,10 @@ void get_mbr_string(const uint32_t label, char *buffer,
const int buffer_size)
 	break;
     case 0xfa31:
 	/* We need more than 2 bytes */
-	if (((label >> 8) & 0xff) == 0xc9)
-	    strlcpy(buffer, "Master Boot LoaDeR", buffer_size - 1);
-	else if (((label >> 8) & 0xff) == 0xc0)
+	if (((label >> 8) & 0xff) == 0xc0)
 	    strlcpy(buffer, "Syslinux", buffer_size - 1);
+	else if (((label >> 8) & 0xff) == 0xc9)
+	    strlcpy(buffer, "Master Boot LoaDeR", buffer_size - 1);
 	else
 	    strlcpy(buffer, "Unknown mbr", buffer_size - 1);
 	break;
-- 
1.7.1
------=_20110124152841_33905
Content-Type: text/x-patch;
name="0001-disklib-Detect-DiskCryptor-MBR.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename="0001-disklib-Detect-DiskCryptor-MBR.patch"