Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst/arch/hp700 Error if the root partition...



details:   https://anonhg.NetBSD.org/src/rev/ff2de601a595
branches:  trunk
changeset: 772581:ff2de601a595
user:      skrll <skrll%NetBSD.org@localhost>
date:      Mon Jan 09 11:51:41 2012 +0000

description:
Error if the root partition exceeds the PDC 2GB limit. The check now
catches invalid "existing" partitions. PR/45742

Thanks to martin for the German translation. The others are all my fault.

Thanks to mrg for comments

diffstat:

 distrib/utils/sysinst/arch/hp700/md.c      |  23 +++++++++++++++++++++--
 distrib/utils/sysinst/arch/hp700/msg.md.de |   5 ++++-
 distrib/utils/sysinst/arch/hp700/msg.md.en |   5 ++++-
 distrib/utils/sysinst/arch/hp700/msg.md.es |   5 ++++-
 distrib/utils/sysinst/arch/hp700/msg.md.fr |   4 +++-
 distrib/utils/sysinst/arch/hp700/msg.md.pl |   4 +++-
 6 files changed, 39 insertions(+), 7 deletions(-)

diffs (129 lines):

diff -r f491897e26a9 -r ff2de601a595 distrib/utils/sysinst/arch/hp700/md.c
--- a/distrib/utils/sysinst/arch/hp700/md.c     Mon Jan 09 11:44:53 2012 +0000
+++ b/distrib/utils/sysinst/arch/hp700/md.c     Mon Jan 09 11:51:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.13 2012/01/05 21:32:36 christos Exp $ */
+/*     $NetBSD: md.c,v 1.14 2012/01/09 11:51:41 skrll Exp $    */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -50,6 +50,8 @@
 #include "msg_defs.h"
 #include "menu_defs.h"
 
+#define HP700_PDC_LIMIT        ((unsigned)2*1024*1024*1024)
+
 void
 md_init(void)
 {
@@ -108,7 +110,7 @@
        /*
         * hp700 PDC can only address up to 2GB.
         */
-       root_limit = ((unsigned)2*1024*1024*1024) / (unsigned)sectorsize;
+       root_limit = HP700_PDC_LIMIT / (unsigned)sectorsize;
 
        return 1;
 }
@@ -128,6 +130,23 @@
 int
 md_check_partitions(void)
 {
+       /* Check the root partition is sane. */
+       uint32_t limit = HP700_PDC_LIMIT / (unsigned)sectorsize;
+       int part;
+
+       for (part = PART_A; part < MAXPARTITIONS; part++) {
+               if (strcmp(bsdlabel[part].pi_mount, "/") == 0) {
+                       uint32_t offset = bsdlabel[part].pi_offset;
+                       uint32_t size = bsdlabel[part].pi_size;
+
+                       if (offset > limit || offset + size > limit) {
+                               msg_display(MSG_md_pdclimit);
+                               process_menu(MENU_ok, NULL);
+                               return 0;
+                       }
+               }
+       }
+
        return 1;
 }
 
diff -r f491897e26a9 -r ff2de601a595 distrib/utils/sysinst/arch/hp700/msg.md.de
--- a/distrib/utils/sysinst/arch/hp700/msg.md.de        Mon Jan 09 11:44:53 2012 +0000
+++ b/distrib/utils/sysinst/arch/hp700/msg.md.de        Mon Jan 09 11:51:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.md.de,v 1.5 2011/04/04 08:30:29 mbalmer Exp $      */
+/*     $NetBSD: msg.md.de,v 1.6 2012/01/09 11:51:41 skrll Exp $        */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -50,3 +50,6 @@
 
 message set_kernel_1
 {Kernel (GENERIC)}
+
+message md_pdclimit
+{Die Root-Partition überschreitet die PDC Grenze von 2GB}
diff -r f491897e26a9 -r ff2de601a595 distrib/utils/sysinst/arch/hp700/msg.md.en
--- a/distrib/utils/sysinst/arch/hp700/msg.md.en        Mon Jan 09 11:44:53 2012 +0000
+++ b/distrib/utils/sysinst/arch/hp700/msg.md.en        Mon Jan 09 11:51:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.md.en,v 1.5 2011/04/04 08:30:29 mbalmer Exp $      */
+/*     $NetBSD: msg.md.en,v 1.6 2012/01/09 11:51:41 skrll Exp $        */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -50,3 +50,6 @@
 
 message set_kernel_1
 {Kernel (GENERIC)}
+
+message md_pdclimit
+{The root partition extends beyond the PDC limit of 2GB}
diff -r f491897e26a9 -r ff2de601a595 distrib/utils/sysinst/arch/hp700/msg.md.es
--- a/distrib/utils/sysinst/arch/hp700/msg.md.es        Mon Jan 09 11:44:53 2012 +0000
+++ b/distrib/utils/sysinst/arch/hp700/msg.md.es        Mon Jan 09 11:51:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.md.es,v 1.5 2011/04/04 08:30:29 mbalmer Exp $      */
+/*     $NetBSD: msg.md.es,v 1.6 2012/01/09 11:51:41 skrll Exp $        */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -50,3 +50,6 @@
 
 message set_kernel_1
 {Kernel (GENERIC)}
+
+message md_pdclimit
+{La partición raíz se extiende más allá del límite de 2 GB PDC}
diff -r f491897e26a9 -r ff2de601a595 distrib/utils/sysinst/arch/hp700/msg.md.fr
--- a/distrib/utils/sysinst/arch/hp700/msg.md.fr        Mon Jan 09 11:44:53 2012 +0000
+++ b/distrib/utils/sysinst/arch/hp700/msg.md.fr        Mon Jan 09 11:51:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.md.fr,v 1.6 2011/04/04 08:30:29 mbalmer Exp $      */
+/*     $NetBSD: msg.md.fr,v 1.7 2012/01/09 11:51:41 skrll Exp $        */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -51,3 +51,5 @@
 message set_kernel_1
 {Kernel (GENERIC)}
 
+message md_pdclimit
+{La partition racine s'étend au-delà de la limite de 2Go PDC}
diff -r f491897e26a9 -r ff2de601a595 distrib/utils/sysinst/arch/hp700/msg.md.pl
--- a/distrib/utils/sysinst/arch/hp700/msg.md.pl        Mon Jan 09 11:44:53 2012 +0000
+++ b/distrib/utils/sysinst/arch/hp700/msg.md.pl        Mon Jan 09 11:51:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.md.pl,v 1.5 2011/04/04 08:30:29 mbalmer Exp $      */
+/*     $NetBSD: msg.md.pl,v 1.6 2012/01/09 11:51:41 skrll Exp $        */
 /* Based on english version: */
 /*     NetBSD: msg.md.en,v 1.2 2002/12/03 01:54:49 minoura Exp */
 
@@ -53,3 +53,5 @@
 message set_kernel_1
 {Kernel (GENERIC)}
 
+message md_pdclimit
+{Partycja jest d?u?szy ni? PDC 2GB}



Home | Main Index | Thread Index | Old Index