hide and unhide support logical partitions.

This commit is contained in:
okuji 2001-11-28 18:43:56 +00:00
parent 3a150c2b37
commit 502a79c799
11 changed files with 59 additions and 31 deletions

View file

@ -40,4 +40,5 @@ Kristoffer Branemyr added VSTa filesystem support.
Serguei Tzukanov added JFS and XFS support. Serguei Tzukanov added JFS and XFS support.
Jason Thomas added Linux DAC960 support. Jason Thomas added Linux DAC960 support and support for hiding/unhiding
logical partitions.

View file

@ -1,3 +1,9 @@
2001-11-29 Yoshinori K. Okuji <okuji@gnu.org>
From Jason Thomas:
* stage2/disk_io.c (set_partition_hidden_flag): Complete rewrite
of this function which now supports logical partitions.
2001-11-12 Yoshinori K. Okuji <okuji@gnu.org> 2001-11-12 Yoshinori K. Okuji <okuji@gnu.org>
* docs/grub.texi: The copyright of this file is only held by * docs/grub.texi: The copyright of this file is only held by

View file

@ -103,8 +103,9 @@ RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
uninstall-recursive check-recursive installcheck-recursive uninstall-recursive check-recursive installcheck-recursive
DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
Makefile.am Makefile.in NEWS THANKS TODO acconfig.h \ Makefile.am Makefile.in NEWS THANKS TODO acconfig.h \
acinclude.m4 aclocal.m4 config.guess config.h.in config.sub \ acinclude.m4 aclocal.m4 compile config.guess config.h.in \
configure configure.in depcomp install-sh missing mkinstalldirs config.sub configure configure.in depcomp install-sh missing \
mkinstalldirs
DIST_SUBDIRS = $(SUBDIRS) DIST_SUBDIRS = $(SUBDIRS)
all: config.h all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive $(MAKE) $(AM_MAKEFLAGS) all-recursive

1
NEWS
View file

@ -3,6 +3,7 @@ NEWS - list of user-visible changes between releases of GRUB
New in 0.91: New in 0.91:
* Support for Linux DAC960 is added. * Support for Linux DAC960 is added.
* JFS and XFS support is added. * JFS and XFS support is added.
* The commands "hide" and "unhide" support logical partitions.
* Important bugfixes are made for ReiserFS, APM, TFTP, etc. * Important bugfixes are made for ReiserFS, APM, TFTP, etc.
New in 0.90 - 2001-07-11: New in 0.90 - 2001-07-11:

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
.TH GRUB-INSTALL "8" "October 2001" "grub-install (GNU GRUB 0.90)" FSF .TH GRUB-INSTALL "8" "November 2001" "grub-install (GNU GRUB 0.90)" FSF
.SH NAME .SH NAME
grub-install \- install GRUB on your drive grub-install \- install GRUB on your drive
.SH SYNOPSIS .SH SYNOPSIS

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
.TH GRUB-MD5-CRYPT "8" "October 2001" "grub-md5-crypt (GNU GRUB )" FSF .TH GRUB-MD5-CRYPT "8" "November 2001" "grub-md5-crypt (GNU GRUB )" FSF
.SH NAME .SH NAME
grub-md5-crypt \- Encrypt a password in MD5 format grub-md5-crypt \- Encrypt a password in MD5 format
.SH SYNOPSIS .SH SYNOPSIS

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
.TH GRUB "8" "October 2001" "grub (GNU GRUB 0.90)" FSF .TH GRUB "8" "November 2001" "grub (GNU GRUB 0.90)" FSF
.SH NAME .SH NAME
grub \- the grub shell grub \- the grub shell
.SH SYNOPSIS .SH SYNOPSIS

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
.TH MBCHK "1" "October 2001" "mbchk (GNU GRUB 0.90)" FSF .TH MBCHK "1" "November 2001" "mbchk (GNU GRUB 0.90)" FSF
.SH NAME .SH NAME
mbchk \- check the format of a Multiboot kernel mbchk \- check the format of a Multiboot kernel
.SH SYNOPSIS .SH SYNOPSIS

View file

@ -1,4 +1,4 @@
@set UPDATED 13 October 2001 @set UPDATED 12 November 2001
@set UPDATED-MONTH October 2001 @set UPDATED-MONTH November 2001
@set EDITION 0.90 @set EDITION 0.90
@set VERSION 0.90 @set VERSION 0.90

View file

@ -1,4 +1,4 @@
@set UPDATED 13 October 2001 @set UPDATED 12 November 2001
@set UPDATED-MONTH October 2001 @set UPDATED-MONTH November 2001
@set EDITION 0.90 @set EDITION 0.90
@set VERSION 0.90 @set VERSION 0.90

View file

@ -460,30 +460,49 @@ make_saved_active (void)
int int
set_partition_hidden_flag (int hidden) set_partition_hidden_flag (int hidden)
{ {
unsigned long part = 0xFFFFFF;
unsigned long start, len, offset, ext_offset;
int entry, type;
char mbr[512]; char mbr[512];
if (current_drive & 0x80) /* The drive must be a hard disk. */
if (! (current_drive & 0x80))
{ {
int part = current_partition >> 16; errnum = ERR_BAD_ARGUMENT;
return 1;
if (part > 3)
{
errnum = ERR_NO_PART;
return 0;
}
if (! rawread (current_drive, 0, 0, SECTOR_SIZE, mbr))
return 0;
if (hidden)
PC_SLICE_TYPE (mbr, part) |= PC_SLICE_TYPE_HIDDEN_FLAG;
else
PC_SLICE_TYPE (mbr, part) &= ~PC_SLICE_TYPE_HIDDEN_FLAG;
if (! rawwrite (current_drive, 0, mbr))
return 0;
} }
/* The partition must be a PC slice. */
if ((current_partition >> 16) == 0xFF
|| (current_partition & 0xFFFF) != 0xFFFF)
{
errnum = ERR_BAD_ARGUMENT;
return 1;
}
/* Look for the partition. */
while (next_partition (current_drive, 0xFFFFFF, &part, &type,
&start, &len, &offset, &entry,
&ext_offset, mbr))
{
if (part == current_partition)
{
/* Found. */
if (hidden)
PC_SLICE_TYPE (mbr, entry) |= PC_SLICE_TYPE_HIDDEN_FLAG;
else
PC_SLICE_TYPE (mbr, entry) &= ~PC_SLICE_TYPE_HIDDEN_FLAG;
/* Write back the MBR to the disk. */
buf_track = -1;
if (! rawwrite (current_drive, offset, mbr))
return 1;
/* Succeed. */
return 0;
}
}
return 1; return 1;
} }