diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:43:56 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:43:56 -0800 |
commit | 42d8af43992ba3bb3e6e3c9e41908b420070de72 (patch) | |
tree | 5c6d91909132e7371d606ad9334f9c0d40314e53 | |
parent | a2bb8bf00fbd01859e2475fc36fc6fa070e6eaa9 (diff) | |
download | diskinstaller-42d8af43992ba3bb3e6e3c9e41908b420070de72.tar.gz |
auto import from //branches/cupcake/...@130745
-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 */ |