Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/installboot Some FAT16 filesystems don't have 'hidd...



details:   https://anonhg.NetBSD.org/src/rev/5405e5bcc523
branches:  trunk
changeset: 777935:5405e5bcc523
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sat Mar 10 18:42:18 2012 +0000

description:
Some FAT16 filesystems don't have 'hidden sectors' correctly set to
the offset of the filesystem on the disk.
Let '-b s1blk' be used to fix the value.

diffstat:

 usr.sbin/installboot/arch/i386.c   |  13 +++++++++----
 usr.sbin/installboot/installboot.8 |  11 +++++++++--
 2 files changed, 18 insertions(+), 6 deletions(-)

diffs (85 lines):

diff -r 833c001b6824 -r 5405e5bcc523 usr.sbin/installboot/arch/i386.c
--- a/usr.sbin/installboot/arch/i386.c  Sat Mar 10 18:01:10 2012 +0000
+++ b/usr.sbin/installboot/arch/i386.c  Sat Mar 10 18:42:18 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i386.c,v 1.37 2011/08/14 17:50:17 christos Exp $ */
+/* $NetBSD: i386.c,v 1.38 2012/03/10 18:42:18 dsl Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(__lint)
-__RCSID("$NetBSD: i386.c,v 1.37 2011/08/14 17:50:17 christos Exp $");
+__RCSID("$NetBSD: i386.c,v 1.38 2012/03/10 18:42:18 dsl Exp $");
 #endif /* !__lint */
 
 #include <sys/param.h>
@@ -79,13 +79,15 @@
        { "i386", i386_setboot, no_clearboot, i386_editboot,
                IB_RESETVIDEO | IB_CONSOLE | IB_CONSPEED | IB_CONSADDR |
                IB_KEYMAP | IB_PASSWORD | IB_TIMEOUT |
-               IB_MODULES | IB_BOOTCONF };
+               IB_MODULES | IB_BOOTCONF |
+               IB_STAGE1START };
 
 struct ib_mach ib_mach_amd64 =
        { "amd64", i386_setboot, no_clearboot, i386_editboot,
                IB_RESETVIDEO | IB_CONSOLE | IB_CONSPEED | IB_CONSADDR |
                IB_KEYMAP | IB_PASSWORD | IB_TIMEOUT |
-               IB_MODULES | IB_BOOTCONF };
+               IB_MODULES | IB_BOOTCONF |
+               IB_STAGE1START };
 
 /*
  * Attempting to write the 'labelsector' (or a sector near it - within 8k?)
@@ -440,6 +442,9 @@
                                /* Old BPB is shorter, leave zero filled */
                                u = disk_buf.b[1];
                        }
+                       if (params->s1start != 0)
+                               /* Fixup physical offset of filesytem */
+                               bpb->bpbHiddenSecs = htole32(params->s1start);
                        memcpy(bootstrap.b + 2, disk_buf.b + 2, u);
                }
                #undef USE_F
diff -r 833c001b6824 -r 5405e5bcc523 usr.sbin/installboot/installboot.8
--- a/usr.sbin/installboot/installboot.8        Sat Mar 10 18:01:10 2012 +0000
+++ b/usr.sbin/installboot/installboot.8        Sat Mar 10 18:42:18 2012 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: installboot.8,v 1.84 2012/02/11 07:27:25 ast Exp $
+.\"    $NetBSD: installboot.8,v 1.85 2012/03/10 18:42:18 dsl Exp $
 .\"
 .\" Copyright (c) 2002-2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 11, 2012
+.Dd March 10, 2012
 .Dt INSTALLBOOT 8
 .Os
 .Sh NAME
@@ -165,6 +165,7 @@
 .Ar s1bno
 instead of the default location for the machine and file system type.
 .Sy [ alpha ,
+.Sy i386/amd64 (bootxx_fat16 only) ,
 .Sy pmax ,
 .Sy vax ]
 .
@@ -453,6 +454,12 @@
 It also uses the information in the
 .Ql Boot Parameter Block
 to get the media and filesytem properties.
+The
+.Ql hidden sectors
+field of the BPB must the offset of the partition in the disk.
+This can be set using the
+.Fl b Ar s1bno
+option.
 .
 .It Pa /usr/mdec/bootxx_ffsv1
 Primary bootstrap for



Home | Main Index | Thread Index | Old Index