Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst Make use of the new positional parameters t...
details: https://anonhg.NetBSD.org/src/rev/6263f5720ecb
branches: trunk
changeset: 994613:6263f5720ecb
user: martin <martin%NetBSD.org@localhost>
date: Thu Nov 15 10:34:21 2018 +0000
description:
Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.
diffstat:
usr.sbin/sysinst/bsddisklabel.c | 16 +----------
usr.sbin/sysinst/defsizes.h | 54 +++++++++++++++++++++++++++++++++++++++++
usr.sbin/sysinst/mbr.c | 22 +++++++++++++++-
usr.sbin/sysinst/msg.mbr.de | 34 +++++++++++++++---------
usr.sbin/sysinst/msg.mbr.en | 30 +++++++++++++++-------
usr.sbin/sysinst/msg.mbr.es | 30 +++++++++++++++-------
usr.sbin/sysinst/msg.mbr.fr | 18 ++++++++++---
usr.sbin/sysinst/msg.mbr.pl | 18 ++++++++++---
usr.sbin/sysinst/msg.mi.de | 7 ++++-
usr.sbin/sysinst/msg.mi.en | 7 ++++-
usr.sbin/sysinst/msg.mi.es | 6 +++-
usr.sbin/sysinst/msg.mi.fr | 7 ++++-
usr.sbin/sysinst/msg.mi.pl | 7 ++++-
13 files changed, 194 insertions(+), 62 deletions(-)
diffs (truncated from 453 to 300 lines):
diff -r e6dda17f654b -r 6263f5720ecb usr.sbin/sysinst/bsddisklabel.c
--- a/usr.sbin/sysinst/bsddisklabel.c Thu Nov 15 10:23:55 2018 +0000
+++ b/usr.sbin/sysinst/bsddisklabel.c Thu Nov 15 10:34:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bsddisklabel.c,v 1.4 2018/06/03 13:16:30 martin Exp $ */
+/* $NetBSD: bsddisklabel.c,v 1.5 2018/11/15 10:34:21 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -48,6 +48,7 @@
#include <dirent.h>
#include "defs.h"
#include "md.h"
+#include "defsizes.h"
#include "endian.h"
#include "msg_defs.h"
#include "menu_defs.h"
@@ -70,19 +71,6 @@
#define PART_USR PART_ANY
#endif
-#ifndef DEFVARSIZE
-#define DEFVARSIZE 32
-#endif
-#ifndef DEFROOTSIZE
-#define DEFROOTSIZE 32
-#endif
-#ifndef DEFUSRSIZE
-#define DEFUSRSIZE 128
-#endif
-#ifndef DEFSWAPSIZE
-#define DEFSWAPSIZE 128
-#endif
-
int
save_ptn(int ptn, daddr_t start, daddr_t size, int fstype, const char *mountpt)
{
diff -r e6dda17f654b -r 6263f5720ecb usr.sbin/sysinst/defsizes.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/sysinst/defsizes.h Thu Nov 15 10:34:21 2018 +0000
@@ -0,0 +1,54 @@
+/* $NetBSD: defsizes.h,v 1.1 2018/11/15 10:34:21 martin Exp $ */
+
+/*
+ * Copyright 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+/*
+ * The size likely needed to build the whole system from source, including
+ * X, CTF, MKDEBUG, ...
+ * This is used in some messages as a hint when partitioning.
+ * Rough estimate, round high, in MB.
+ */
+#ifndef SYSTEM_BUILD_SIZE
+#define SYSTEM_BUILD_SIZE 15*1024
+#endif
+
+
+#ifndef DEFVARSIZE
+#define DEFVARSIZE 32
+#endif
+#ifndef DEFROOTSIZE
+#define DEFROOTSIZE 32
+#endif
+#ifndef DEFUSRSIZE
+#define DEFUSRSIZE 128
+#endif
+#ifndef DEFSWAPSIZE
+#define DEFSWAPSIZE 128
+#endif
+
diff -r e6dda17f654b -r 6263f5720ecb usr.sbin/sysinst/mbr.c
--- a/usr.sbin/sysinst/mbr.c Thu Nov 15 10:23:55 2018 +0000
+++ b/usr.sbin/sysinst/mbr.c Thu Nov 15 10:34:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mbr.c,v 1.6 2018/06/03 13:16:30 martin Exp $ */
+/* $NetBSD: mbr.c,v 1.7 2018/11/15 10:34:21 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -75,6 +75,7 @@
#include "md.h"
#include "msg_defs.h"
#include "menu_defs.h"
+#include "defsizes.h"
#include "endian.h"
#define NO_BOOTMENU (-0x100)
@@ -1277,7 +1278,24 @@
if (partman_go)
usefull = 0;
else {
- msg_display(MSG_fullpart, pm->diskdev);
+ uint64_t m_size =
+ DEFROOTSIZE + DEFSWAPSIZE + DEFUSRSIZE + XNEEDMB;
+ char min_size[5], build_size[5];
+
+ humanize_number(min_size, sizeof(min_size),
+ 3 * m_size * 1024*1024UL,
+ "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
+ humanize_number(build_size, sizeof(build_size),
+ SYSTEM_BUILD_SIZE * 1024 * 1024UL, "", HN_AUTOSCALE,
+ HN_B | HN_NOSPACE | HN_DECIMAL);
+
+ msg_display_subst(MSG_fullpart, 7,
+ pm->diskdev,
+ msg_string(MSG_parttype_mbr),
+ msg_string(MSG_parttype_disklabel),
+ msg_string(MSG_parttype_mbr_short),
+ msg_string(MSG_parttype_disklabel_short),
+ min_size, build_size);
process_menu(MENU_fullpart, &usefull);
}
diff -r e6dda17f654b -r 6263f5720ecb usr.sbin/sysinst/msg.mbr.de
--- a/usr.sbin/sysinst/msg.mbr.de Thu Nov 15 10:23:55 2018 +0000
+++ b/usr.sbin/sysinst/msg.mbr.de Thu Nov 15 10:34:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mbr.de,v 1.2 2014/08/03 16:09:38 martin Exp $ */
+/* $NetBSD: msg.mbr.de,v 1.3 2018/11/15 10:34:21 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -36,21 +36,29 @@
/* NB: Lines ending in spaces force line breaks */
+/* Called with: Example
+ * $0 = device name wd0
+ * $1 = outer partitioning name Master Boot Record (MBR)
+ * $2 = inner partitioning name BSD disklabel
+ * $3 = short version of $1 MBR
+ * $4 = short version of $2 disklabel
+ * $5 = size needed for NetBSD 250M
+ * $6 = size needed to build NetBSD 15G
+ */
message fullpart
-{NetBSD wird auf die Festplatte %s installiert.
-
-NetBSD benötigt eine eigene Partition in der Partitionstabelle des Master
-Boot Record (MBR). Diese Partition wird später durch das NetBSD-Disklabel
-weiter aufgeteilt. NetBSD kann auch auf Dateisysteme zugreifen, die in
-anderen MBR-Partitionen definiert werden.
+{NetBSD wird auf die Festplatte $0 installiert.
-Wenn Sie 'Die ganze Festplatte nutzen' auswählen, werden alle MBR-Partitionen
-gelöscht und eine NetBSD-Partition für die gesamte Festplatte erstellt.
-Wenn Sie mehr als ein Betriebssystem installieren möchten, bearbeiten Sie
-die MBR-Partitionstabelle und erstellen eine kleinere NetBSD Partition.
+NetBSD benötigt eine eigene Partition im $1. Diese Partition
+wird später durch das $2 weiter aufgeteilt.
+NetBSD kann auch auf Dateisysteme in anderen $3-Partitionen zugreifen.
-Einige hundert MB reichen für eine Basisinstallation, allerdings sollten
-Sie auch Platz für zusätzliche Software und Anwenderdaten einkalkulieren.
+'Die ganze Festplatte nutzen' löscht alle vorhandenen $3-Partitionen.
+Um auch andere Betriebssysteme zu nutzen, erstellen Sie eine
+$3 Partition.
+
+Etwa $5 reichen für eine Basisinstallation, aber Sie sollten
+zusätzlichen Platz für Erweiterungen und Benutzerdateien einrechnen.
+Reservieren Sie mindestens $6 wenn Sie NetBSD selbst compilieren möchten.
}
message Select_your_choice
diff -r e6dda17f654b -r 6263f5720ecb usr.sbin/sysinst/msg.mbr.en
--- a/usr.sbin/sysinst/msg.mbr.en Thu Nov 15 10:23:55 2018 +0000
+++ b/usr.sbin/sysinst/msg.mbr.en Thu Nov 15 10:34:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mbr.en,v 1.2 2014/08/03 16:09:38 martin Exp $ */
+/* $NetBSD: msg.mbr.en,v 1.3 2018/11/15 10:34:21 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -36,22 +36,32 @@
/* NB: Lines ending in spaces force line breaks */
-message fullpart
-{We are now going to install NetBSD on the disk %s.
-NetBSD requires a single partition in the disk's MBR partition table,
-this is split further by the NetBSD disklabel.
-NetBSD can also access file systems in other MBR partitions.
+/* Called with: Example
+ * $0 = device name wd0
+ * $1 = outer partitioning name Master Boot Record (MBR)
+ * $2 = inner partitioning name BSD disklabel
+ * $3 = short version of $1 MBR
+ * $4 = short version of $2 disklabel
+ * $5 = size needed for NetBSD 250M
+ * $6 = size needed to build NetBSD 15G
+ */
+message fullpart
+{We are now going to install NetBSD on the disk $0.
+
+NetBSD requires a single partition in the disk's $1
+partition table, this is split further by the $2.
+NetBSD can also access file systems in other $3 partitions.
If you select 'Use the entire disk' then the previous contents of the
-disk will be overwritten and a single MBR partition used to cover the
+disk will be overwritten and a single $3 partition used to cover the
entire disk.
If you want to install more than one operating system then edit the
-MBR partition table and create a partition for NetBSD.
+$3 partition table and create a partition for NetBSD.
-A few hundred MB is enough for a basic installation, but you should allow
+About $5 is enough for a basic installation, but you should allow
extra for additional software and user files.
-Allow at least 5GB if you want to build NetBSD itself.
+Allow at least $6 if you want to build NetBSD itself.
}
message Select_your_choice
diff -r e6dda17f654b -r 6263f5720ecb usr.sbin/sysinst/msg.mbr.es
--- a/usr.sbin/sysinst/msg.mbr.es Thu Nov 15 10:23:55 2018 +0000
+++ b/usr.sbin/sysinst/msg.mbr.es Thu Nov 15 10:34:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mbr.es,v 1.2 2014/08/03 16:09:38 martin Exp $ */
+/* $NetBSD: msg.mbr.es,v 1.3 2018/11/15 10:34:21 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -36,21 +36,31 @@
/* NB: Lines ending in spaces force line breaks */
-message fullpart
-{Se va a instalar NetBSD en el disco %s.
-NetBSD requiere una sola partición en la tabla de particiones MBR del disco,
-que es subsiguientemente dividida por el disklabel de NetBSD.
-NetBSD también puede acceder a sistemas de ficheros de otras particiones MBR.
+/* Called with: Example
+ * $0 = device name wd0
+ * $1 = outer partitioning name Master Boot Record (MBR)
+ * $2 = inner partitioning name BSD disklabel
+ * $3 = short version of $1 MBR
+ * $4 = short version of $2 disklabel
+ * $5 = size needed for NetBSD 250M
+ * $6 = size needed to build NetBSD 15G
+ */
+message fullpart
+{Se va a instalar NetBSD en el disco $0.
+
+NetBSD requiere una sola partición en la tabla de particiones $1 del disco,
+que es subsiguientemente dividida por el $2.
+NetBSD también puede acceder a sistemas de ficheros de otras particiones $3.
Si selecciona 'Usar todo el disco', se sobreescribirá el contenido anterior
-del disco, y se usará una sola partición MBR para cubrir todo el disco.
+del disco, y se usará una sola partición $3 para cubrir todo el disco.
Si desea instalar más de un sistema operativo, edite la tabla de particiones
-MBR y cree una partición para NetBSD.
+$3 y cree una partición para NetBSD.
-Para una instalación básica bastan unos pocos cientos de MB, pero deberá
+Para una instalación básica bastan unos pocos $5, pero deberá
dejar espacio extra para programas adicionales y los ficheros de usuario.
-Proporcione al menos 5 GB si quiere construir el propio NetBSD.
+Proporcione al menos $6 si quiere construir el propio NetBSD.
}
message Select_your_choice
diff -r e6dda17f654b -r 6263f5720ecb usr.sbin/sysinst/msg.mbr.fr
--- a/usr.sbin/sysinst/msg.mbr.fr Thu Nov 15 10:23:55 2018 +0000
+++ b/usr.sbin/sysinst/msg.mbr.fr Thu Nov 15 10:34:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mbr.fr,v 1.4 2015/04/20 14:10:31 maxv Exp $ */
+/* $NetBSD: msg.mbr.fr,v 1.5 2018/11/15 10:34:21 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -34,14 +34,24 @@
Home |
Main Index |
Thread Index |
Old Index