diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2009-03-18 16:57:16 -0700 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2009-03-18 16:57:16 -0700 |
commit | 8a5bf5700b673c70c1075621ca54c7fddbe9197f (patch) | |
tree | 5c6d91909132e7371d606ad9334f9c0d40314e53 | |
parent | a2bb8bf00fbd01859e2475fc36fc6fa070e6eaa9 (diff) | |
parent | 8fd8fc6c4d23e1a287fc64f817de23cabcf55b78 (diff) | |
download | diskinstaller-8a5bf5700b673c70c1075621ca54c7fddbe9197f.tar.gz |
Merge commit 'remotes/korg/cupcake' into cupcake_to_master
-rw-r--r-- | libdiskconfig/config_mbr.c | 13 | ||||
-rw-r--r-- | libdiskconfig/diskconfig.h | 4 |
2 files changed, 12 insertions, 5 deletions
diff --git a/libdiskconfig/config_mbr.c b/libdiskconfig/config_mbr.c index 4836f80..c168c78 100644 --- a/libdiskconfig/config_mbr.c +++ b/libdiskconfig/config_mbr.c @@ -31,9 +31,16 @@ static void cfg_pentry(struct pc_partition *pentry, uint8_t status, uint8_t type, uint32_t start, uint32_t len) { - /* zero out the c/h/s entries.. they are not used */ - memset(&pentry->start, 0, sizeof(struct chs)); - memset(&pentry->end, 0, sizeof(struct chs)); + if (len > 0) { + /* seems that somes BIOSens can get wedged on boot while verifying + * the mbr if these are 0 */ + memset(&pentry->start, 0xff, sizeof(struct chs)); + memset(&pentry->end, 0xff, sizeof(struct chs)); + } else { + /* zero out the c/h/s entries.. they are not used */ + memset(&pentry->start, 0, sizeof(struct chs)); + memset(&pentry->end, 0, sizeof(struct chs)); + } pentry->status = status; pentry->type = type; diff --git a/libdiskconfig/diskconfig.h b/libdiskconfig/diskconfig.h index 9ff8c4d..1e9762a 100644 --- a/libdiskconfig/diskconfig.h +++ b/libdiskconfig/diskconfig.h @@ -48,10 +48,10 @@ #define PART_ACTIVE_FLAG 0x1 struct chs { - uint8_t cylinder; uint8_t head; uint8_t sector; -}; + uint8_t cylinder; +} __attribute__((__packed__)); /* 16 byte pc partition descriptor that sits in MBR and EPBR. * Note: multi-byte entities have little-endian layout on disk */ |