From 3217288404aa07b38462bc509a9536d625ea904f Mon Sep 17 00:00:00 2001 From: okuji Date: Wed, 4 Dec 2002 04:43:23 +0000 Subject: [PATCH] 2002-12-04 Yoshinori K. Okuji * stage2/builtins.c (embed_func): When checking if the disk can store Stage 1.5, check every partition, if it isn't empty. --- ChangeLog | 5 +++++ stage2/builtins.c | 16 +++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41ff3d97a..bcf55b8b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-12-04 Yoshinori K. Okuji + + * stage2/builtins.c (embed_func): When checking if the disk can + store Stage 1.5, check every partition, if it isn't empty. + 2002-12-04 Yoshinori K. Okuji * stage2/stage2.c (print_entry): Put a right arrow, if the entry diff --git a/stage2/builtins.c b/stage2/builtins.c index d0051388c..b9e4ada95 100644 --- a/stage2/builtins.c +++ b/stage2/builtins.c @@ -1044,7 +1044,8 @@ embed_func (char *arg, int flags) char mbr[SECTOR_SIZE]; char ezbios_check[2*SECTOR_SIZE]; - + int i; + /* Open the partition. */ if (! open_partition ()) return 1; @@ -1068,12 +1069,13 @@ embed_func (char *arg, int flags) } /* Check if the disk can store the Stage 1.5. */ - if (PC_SLICE_START (mbr, 0) - 1 < size) - { - errnum = ERR_NO_DISK_SPACE; - return 1; - } - + for (i = 0; i < 4; i++) + if (PC_SLICE_TYPE (mbr, i) && PC_SLICE_START (mbr, i) - 1 < size) + { + errnum = ERR_NO_DISK_SPACE; + return 1; + } + /* Check for EZ-BIOS signature. It should be in the third * sector, but due to remapping it can appear in the second, so * load and check both.