Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst Don't try to convert the CHS values if...



details:   https://anonhg.NetBSD.org/src/rev/5739b4bd3fb3
branches:  trunk
changeset: 474544:5739b4bd3fb3
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Sat Jul 10 23:07:15 1999 +0000

description:
Don't try to convert the CHS values if not needed. Add extra flag
to write_mbr to for this.

diffstat:

 distrib/utils/sysinst/arch/bebox/md.c |   4 ++--
 distrib/utils/sysinst/arch/i386/md.c  |   6 +++---
 distrib/utils/sysinst/mbr.c           |  19 +++++++++++--------
 distrib/utils/sysinst/mbr.h           |   4 ++--
 4 files changed, 18 insertions(+), 15 deletions(-)

diffs (105 lines):

diff -r 500bb3f5ea32 -r 5739b4bd3fb3 distrib/utils/sysinst/arch/bebox/md.c
--- a/distrib/utils/sysinst/arch/bebox/md.c     Sat Jul 10 22:18:34 1999 +0000
+++ b/distrib/utils/sysinst/arch/bebox/md.c     Sat Jul 10 23:07:15 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.12 1999/06/22 00:57:08 cgd Exp $ */
+/*     $NetBSD: md.c,v 1.13 1999/07/10 23:07:15 fvdl Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -67,7 +67,7 @@
        printf ("%s", msg_string (MSG_dofdisk));
 
        /* write edited MBR onto disk. */
-       if (write_mbr(diskdev, mbr, sizeof mbr) != 0) {
+       if (write_mbr(diskdev, mbr, sizeof mbr, 1) != 0) {
                msg_display(MSG_wmbrfail);
                process_menu(MENU_ok);
                return 1;
diff -r 500bb3f5ea32 -r 5739b4bd3fb3 distrib/utils/sysinst/arch/i386/md.c
--- a/distrib/utils/sysinst/arch/i386/md.c      Sat Jul 10 22:18:34 1999 +0000
+++ b/distrib/utils/sysinst/arch/i386/md.c      Sat Jul 10 23:07:15 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.30 1999/07/04 08:01:40 cgd Exp $ */
+/*     $NetBSD: md.c,v 1.31 1999/07/10 23:07:16 fvdl Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -163,7 +163,7 @@
        msg_display(MSG_dofdisk);
 
        /* write edited MBR onto disk. */
-       if (write_mbr(diskdev, mbr, sizeof mbr) != 0) {
+       if (write_mbr(diskdev, mbr, sizeof mbr, 1) != 0) {
                msg_display(MSG_wmbrfail);
                process_menu(MENU_ok);
                return 1;
@@ -458,7 +458,7 @@
 
        if (netbsdpart == -1 && oldbsdcount == 1) {
                mbrp[oldbsdpart].mbrp_typ = MBR_PTYPE_NETBSD;
-               write_mbr(diskdev, mbr, sizeof mbr);
+               write_mbr(diskdev, mbr, sizeof mbr, 0);
        }
 }
 
diff -r 500bb3f5ea32 -r 5739b4bd3fb3 distrib/utils/sysinst/mbr.c
--- a/distrib/utils/sysinst/mbr.c       Sat Jul 10 22:18:34 1999 +0000
+++ b/distrib/utils/sysinst/mbr.c       Sat Jul 10 23:07:15 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbr.c,v 1.17 1999/07/04 08:01:39 cgd Exp $ */
+/*     $NetBSD: mbr.c,v 1.18 1999/07/10 23:07:15 fvdl Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -428,9 +428,10 @@
 }
 
 int
-write_mbr(disk, buf, len)
+write_mbr(disk, buf, len, convert)
        char *disk, *buf;
        int len;
+       int convert;
 {
        char diskpath[MAXPATHLEN];
        int fd, i, ret = 0;
@@ -462,12 +463,14 @@
                        psize = mbrp[i].mbrp_size;
                        mbrp[i].mbrp_start = native_to_le32(pstart);
                        mbrp[i].mbrp_size = native_to_le32(psize);
-                       convert_mbr_chs(bcyl, bhead, bsec,
-                           &mbrp[i].mbrp_scyl, &mbrp[i].mbrp_shd,
-                           &mbrp[i].mbrp_ssect, pstart);
-                       convert_mbr_chs(bcyl, bhead, bsec,
-                           &mbrp[i].mbrp_ecyl, &mbrp[i].mbrp_ehd,
-                           &mbrp[i].mbrp_esect, pstart + psize);
+                       if (convert) {
+                               convert_mbr_chs(bcyl, bhead, bsec,
+                                   &mbrp[i].mbrp_scyl, &mbrp[i].mbrp_shd,
+                                   &mbrp[i].mbrp_ssect, pstart);
+                               convert_mbr_chs(bcyl, bhead, bsec,
+                                   &mbrp[i].mbrp_ecyl, &mbrp[i].mbrp_ehd,
+                                   &mbrp[i].mbrp_esect, pstart + psize);
+                       }
                }
        }
 
diff -r 500bb3f5ea32 -r 5739b4bd3fb3 distrib/utils/sysinst/mbr.h
--- a/distrib/utils/sysinst/mbr.h       Sat Jul 10 22:18:34 1999 +0000
+++ b/distrib/utils/sysinst/mbr.h       Sat Jul 10 23:07:15 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbr.h,v 1.7 1999/06/20 06:08:14 cgd Exp $      */
+/*     $NetBSD: mbr.h,v 1.8 1999/07/10 23:07:15 fvdl Exp $     */
 
 /*
  * Copyright 1997, 1988 Piermont Information Systems Inc.
@@ -78,7 +78,7 @@
 /* from mbr.c */
  
 int     read_mbr __P((char *, char *, int));
-int     write_mbr __P((char *, char *, int));
+int     write_mbr __P((char *, char *, int, int));
 int     valid_mbr __P((char *));
 int    guess_biosgeom_from_mbr __P((char *, int *, int *, int *));
 int    md_bios_info __P((char *));



Home | Main Index | Thread Index | Old Index