[syslinux:master] memdisk: make sure the disk type is actually set

syslinux-bot for H. Peter Anvin hpa at zytor.com
Wed Mar 16 13:18:36 PDT 2011


Commit-ID:  b4c7ad318371764675dbd598318f2945bec71132
Gitweb:     http://syslinux.zytor.com/commit/b4c7ad318371764675dbd598318f2945bec71132
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Wed, 16 Mar 2011 13:02:26 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Wed, 16 Mar 2011 13:02:26 -0700

memdisk: make sure the disk type is actually set

Make sure we actually set the disk CMOS type.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 memdisk/setup.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/memdisk/setup.c b/memdisk/setup.c
index 61cf420..bc79e12 100644
--- a/memdisk/setup.c
+++ b/memdisk/setup.c
@@ -523,6 +523,8 @@ static const struct geometry *get_disk_image_geometry(uint32_t where,
 			   sectors at the end of the image... */
 			xsectors++;
 		    }
+
+		    hd_geometry.type = type;
 		}
 	    } else {
 		/* Assume it is a hard disk image and scan for a partition table */
@@ -558,6 +560,8 @@ static const struct geometry *get_disk_image_geometry(uint32_t where,
 			}
 		    }
 		}
+
+		hd_geometry.type = 0;
 	    }
 	}
 
@@ -566,8 +570,8 @@ static const struct geometry *get_disk_image_geometry(uint32_t where,
 	if (!max_s)
 	    max_s = xsectors > 2097152 ? 63 : 32;
 
-	hd_geometry.h = max_h;
-	hd_geometry.s = max_s;
+	hd_geometry.h    = max_h;
+	hd_geometry.s    = max_s;
     }
 
     if (!hd_geometry.c)



More information about the Syslinux-commits mailing list