Module Name: src
Committed By: skrll
Date: Mon Jan 9 11:51:41 UTC 2012
Modified Files:
src/distrib/utils/sysinst/arch/hp700: md.c msg.md.de msg.md.en
msg.md.es msg.md.fr msg.md.pl
Log Message:
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
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/distrib/utils/sysinst/arch/hp700/md.c
cvs rdiff -u -r1.5 -r1.6 src/distrib/utils/sysinst/arch/hp700/msg.md.de \
src/distrib/utils/sysinst/arch/hp700/msg.md.en \
src/distrib/utils/sysinst/arch/hp700/msg.md.es \
src/distrib/utils/sysinst/arch/hp700/msg.md.pl
cvs rdiff -u -r1.6 -r1.7 src/distrib/utils/sysinst/arch/hp700/msg.md.fr
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/utils/sysinst/arch/hp700/md.c
diff -u src/distrib/utils/sysinst/arch/hp700/md.c:1.13 src/distrib/utils/sysinst/arch/hp700/md.c:1.14
--- src/distrib/utils/sysinst/arch/hp700/md.c:1.13 Thu Jan 5 21:32:36 2012
+++ src/distrib/utils/sysinst/arch/hp700/md.c Mon Jan 9 11:51:41 2012
@@ -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 @@ md_get_info(void)
/*
* 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 @@ md_make_bsd_partitions(void)
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;
}
Index: src/distrib/utils/sysinst/arch/hp700/msg.md.de
diff -u src/distrib/utils/sysinst/arch/hp700/msg.md.de:1.5 src/distrib/utils/sysinst/arch/hp700/msg.md.de:1.6
--- src/distrib/utils/sysinst/arch/hp700/msg.md.de:1.5 Mon Apr 4 08:30:29 2011
+++ src/distrib/utils/sysinst/arch/hp700/msg.md.de Mon Jan 9 11:51:41 2012
@@ -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 dobootblks
message set_kernel_1
{Kernel (GENERIC)}
+
+message md_pdclimit
+{Die Root-Partition �berschreitet die PDC Grenze von 2GB}
Index: src/distrib/utils/sysinst/arch/hp700/msg.md.en
diff -u src/distrib/utils/sysinst/arch/hp700/msg.md.en:1.5 src/distrib/utils/sysinst/arch/hp700/msg.md.en:1.6
--- src/distrib/utils/sysinst/arch/hp700/msg.md.en:1.5 Mon Apr 4 08:30:29 2011
+++ src/distrib/utils/sysinst/arch/hp700/msg.md.en Mon Jan 9 11:51:41 2012
@@ -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 dobootblks
message set_kernel_1
{Kernel (GENERIC)}
+
+message md_pdclimit
+{The root partition extends beyond the PDC limit of 2GB}
Index: src/distrib/utils/sysinst/arch/hp700/msg.md.es
diff -u src/distrib/utils/sysinst/arch/hp700/msg.md.es:1.5 src/distrib/utils/sysinst/arch/hp700/msg.md.es:1.6
--- src/distrib/utils/sysinst/arch/hp700/msg.md.es:1.5 Mon Apr 4 08:30:29 2011
+++ src/distrib/utils/sysinst/arch/hp700/msg.md.es Mon Jan 9 11:51:41 2012
@@ -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 dobootblks
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}
Index: src/distrib/utils/sysinst/arch/hp700/msg.md.pl
diff -u src/distrib/utils/sysinst/arch/hp700/msg.md.pl:1.5 src/distrib/utils/sysinst/arch/hp700/msg.md.pl:1.6
--- src/distrib/utils/sysinst/arch/hp700/msg.md.pl:1.5 Mon Apr 4 08:30:29 2011
+++ src/distrib/utils/sysinst/arch/hp700/msg.md.pl Mon Jan 9 11:51:41 2012
@@ -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 dobootblks
message set_kernel_1
{Kernel (GENERIC)}
+message md_pdclimit
+{Partycja jest d?u?szy ni? PDC 2GB}
Index: src/distrib/utils/sysinst/arch/hp700/msg.md.fr
diff -u src/distrib/utils/sysinst/arch/hp700/msg.md.fr:1.6 src/distrib/utils/sysinst/arch/hp700/msg.md.fr:1.7
--- src/distrib/utils/sysinst/arch/hp700/msg.md.fr:1.6 Mon Apr 4 08:30:29 2011
+++ src/distrib/utils/sysinst/arch/hp700/msg.md.fr Mon Jan 9 11:51:41 2012
@@ -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 dobootblks
message set_kernel_1
{Kernel (GENERIC)}
+message md_pdclimit
+{La partition racine s'�tend au-del� de la limite de 2Go PDC}