diff --git a/ChangeLog b/ChangeLog index ef0167e43..2855033da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-01-07 OKUJI Yoshinori + + * stage2/builtins.c (boot_func): In the chain-loading mode, + clear the active flag of each of the loaded partition entries, + and then set the active flag of the booted partition image. + 2001-01-04 Jochen Hoenicke * stage2/builtins.c (embed_func): Call open_partition() even for diff --git a/docs/grub.8 b/docs/grub.8 index 2640ab114..05dcbcb5e 100644 --- a/docs/grub.8 +++ b/docs/grub.8 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH GRUB "8" "December 2000" "grub (GNU GRUB 0.5.97)" FSF +.TH GRUB "8" "January 2001" "grub (GNU GRUB 0.5.97)" FSF .SH NAME grub \- the grub shell .SH SYNOPSIS diff --git a/stage2/builtins.c b/stage2/builtins.c index d890d7740..3506f8cec 100644 --- a/stage2/builtins.c +++ b/stage2/builtins.c @@ -2,7 +2,7 @@ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 1996 Erich Boleyn - * Copyright (C) 1999, 2000 Free Software Foundation, Inc. + * Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -291,6 +291,7 @@ boot_func (char *arg, int flags) if (boot_drive & 0x80) { char *dst, *src; + int i; /* Read the MBR here, because it might be modified after opening the partition. */ @@ -309,6 +310,12 @@ boot_func (char *arg, int flags) src = (char *) SCRATCHADDR + BOOTSEC_PART_OFFSET; while (dst < (char *) BOOT_PART_TABLE + BOOTSEC_PART_LENGTH) *dst++ = *src++; + + /* Set the active flag of the booted partition. */ + for (i = 0; i < 4; i++) + PC_SLICE_FLAG (BOOT_PART_TABLE, i) = 0; + + *((unsigned char *) boot_part_addr) = PC_SLICE_FLAG_BOOTABLE; } chain_stage1 (0, BOOTSEC_LOCATION, boot_part_addr);