]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
hide and unhide support logical partitions.
authorokuji <okuji@localhost>
Wed, 28 Nov 2001 18:43:56 +0000 (18:43 +0000)
committerokuji <okuji@localhost>
Wed, 28 Nov 2001 18:43:56 +0000 (18:43 +0000)
AUTHORS
ChangeLog
Makefile.in
NEWS
docs/grub-install.8
docs/grub-md5-crypt.8
docs/grub.8
docs/mbchk.1
docs/stamp-vti
docs/version.texi
stage2/disk_io.c

diff --git a/AUTHORS b/AUTHORS
index 8719c2f70c2be537dd823fd94a779f15894ff3f0..c16e381ec1e4e402f2fc6d27a9c47bb6f4b0e95b 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -40,4 +40,5 @@ Kristoffer Branemyr added VSTa filesystem 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.
index 4b9f8b5a81551f8bddbda614e07088f7e55b0718..5ddd08f2bf707b3a53b6dbbf8e1d93c3d5815e0e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * docs/grub.texi: The copyright of this file is only held by
index 20de465f0fea8e4a4ec176fae2eff1d3c9bb93d8..ffecbb43e0946f1045c7092cca1746badc4792a4 100644 (file)
@@ -103,8 +103,9 @@ RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
        uninstall-recursive check-recursive installcheck-recursive
 DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
        Makefile.am Makefile.in NEWS THANKS TODO acconfig.h \
-       acinclude.m4 aclocal.m4 config.guess config.h.in config.sub \
-       configure configure.in depcomp install-sh missing mkinstalldirs
+       acinclude.m4 aclocal.m4 compile config.guess config.h.in \
+       config.sub configure configure.in depcomp install-sh missing \
+       mkinstalldirs
 DIST_SUBDIRS = $(SUBDIRS)
 all: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
diff --git a/NEWS b/NEWS
index 8e7c16766e56f6aa8896f75023caf4b7051dde02..c66678190f690b88fd73be3d9bc3154f140ed7e4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ NEWS - list of user-visible changes between releases of GRUB
 New in 0.91:
 * Support for Linux DAC960 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.
 
 New in 0.90 - 2001-07-11:
index 947ae3785cfe7c3d03bbf6c3f62c7cbf08126633..30051e63292f16a39d9cbc9e49125247335fc8d5 100644 (file)
@@ -1,5 +1,5 @@
 .\" 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
 grub-install \- install GRUB on your drive
 .SH SYNOPSIS
index 22ba0bfcd2bc9688894fd6c6508196702f400e41..1995f7f5e8a2c223600ccf29f4eea1319ff5843b 100644 (file)
@@ -1,5 +1,5 @@
 .\" 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
 grub-md5-crypt \- Encrypt a password in MD5 format
 .SH SYNOPSIS
index 7b967246af1328cecc1df60c9081c81eba460de2..cd5fb7cd39f4c07ccb78ee568cbe94b9e830abfe 100644 (file)
@@ -1,5 +1,5 @@
 .\" 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
 grub \- the grub shell
 .SH SYNOPSIS
index 89afb67c274d69f42ac2af5adea1caaa9b81817b..a611a29cd414d64b3dfc8f6ab2c1bba345254d65 100644 (file)
@@ -1,5 +1,5 @@
 .\" 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
 mbchk \- check the format of a Multiboot kernel
 .SH SYNOPSIS
index 770dd17d072e42923bcbdfd7373da77c694337fd..c81ca723b059cbbbca34378d3f79ef42da5ed566 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 13 October 2001
-@set UPDATED-MONTH October 2001
+@set UPDATED 12 November 2001
+@set UPDATED-MONTH November 2001
 @set EDITION 0.90
 @set VERSION 0.90
index 770dd17d072e42923bcbdfd7373da77c694337fd..c81ca723b059cbbbca34378d3f79ef42da5ed566 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 13 October 2001
-@set UPDATED-MONTH October 2001
+@set UPDATED 12 November 2001
+@set UPDATED-MONTH November 2001
 @set EDITION 0.90
 @set VERSION 0.90
index 173451177142758247037236b41c6034d57ebf8b..12ca31f3e2d80c39126403704dd5c8988dbd6667 100644 (file)
@@ -460,30 +460,49 @@ make_saved_active (void)
 int
 set_partition_hidden_flag (int hidden)
 {
+  unsigned long part = 0xFFFFFF;
+  unsigned long start, len, offset, ext_offset;
+  int entry, type;
   char mbr[512];
   
-  if (current_drive & 0x80)
+  /* The drive must be a hard disk.  */
+  if (! (current_drive & 0x80))
     {
-      int part = current_partition >> 16;
-
-      if (part > 3)
+      errnum = ERR_BAD_ARGUMENT;
+      return 1;
+    }
+  
+  /* 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)
        {
-          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;
+         /* 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;
 }