Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sysinst Get rid of the evbarm preliminary menu: do ...



details:   https://anonhg.NetBSD.org/src/rev/1c8eacc129f6
branches:  trunk
changeset: 967492:1c8eacc129f6
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Dec 11 15:08:45 2019 +0000

description:
Get rid of the evbarm preliminary menu: do not bother to ask the user
whether this is a RPi - query the FDT instead.

diffstat:

 usr.sbin/sysinst/arch/evbarm/md.c        |  20 +++++++++++---------
 usr.sbin/sysinst/arch/evbarm/menus.md.en |   6 +-----
 usr.sbin/sysinst/arch/evbarm/menus.md.es |   6 +-----
 usr.sbin/sysinst/arch/evbarm/menus.md.fr |   6 +-----
 usr.sbin/sysinst/arch/evbarm/menus.md.pl |   6 +-----
 usr.sbin/sysinst/defs.h                  |   3 +--
 usr.sbin/sysinst/main.c                  |  11 +----------
 7 files changed, 17 insertions(+), 41 deletions(-)

diffs (155 lines):

diff -r ee28e1d68406 -r 1c8eacc129f6 usr.sbin/sysinst/arch/evbarm/md.c
--- a/usr.sbin/sysinst/arch/evbarm/md.c Wed Dec 11 14:03:37 2019 +0000
+++ b/usr.sbin/sysinst/arch/evbarm/md.c Wed Dec 11 15:08:45 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.9 2019/08/14 12:55:36 martin Exp $ */
+/*     $NetBSD: md.c,v 1.10 2019/12/11 15:08:45 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -48,18 +48,20 @@
 #include "msg_defs.h"
 #include "menu_defs.h"
 
-int boardtype = 0;
-
-void
-md_prelim_menu(void)
-{
-       /* get the boardtype from the user */
-       process_menu(MENU_prelim, NULL);
-}
+int boardtype = BOARD_TYPE_NORMAL;
 
 void
 md_init(void)
 {
+       int rv;
+
+       rv =run_program(RUN_SILENT|RUN_ERROR_OK, "sh -c 'ofctl -p / model | "
+           "fgrep \"Raspberry Pi\"'");
+       if (rv != 0)
+               return;
+
+       /* this is some kind of Raspberry Pi */
+       boardtype = BOARD_TYPE_RPI;
 }
 
 void
diff -r ee28e1d68406 -r 1c8eacc129f6 usr.sbin/sysinst/arch/evbarm/menus.md.en
--- a/usr.sbin/sysinst/arch/evbarm/menus.md.en  Wed Dec 11 14:03:37 2019 +0000
+++ b/usr.sbin/sysinst/arch/evbarm/menus.md.en  Wed Dec 11 15:08:45 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menus.md.en,v 1.1 2014/07/26 19:30:45 dholland Exp $   */
+/*     $NetBSD: menus.md.en,v 1.2 2019/12/11 15:08:45 martin Exp $     */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -35,7 +35,3 @@
 
 /* evbarm machine dependent menus, english */
 
-menu prelim, title "What kind of system do you have?", y=-10;
-       option "Raspberry PI", exit, action { boardtype = 1; };
-       option "Other", exit, action { boardtype = 0; };
-
diff -r ee28e1d68406 -r 1c8eacc129f6 usr.sbin/sysinst/arch/evbarm/menus.md.es
--- a/usr.sbin/sysinst/arch/evbarm/menus.md.es  Wed Dec 11 14:03:37 2019 +0000
+++ b/usr.sbin/sysinst/arch/evbarm/menus.md.es  Wed Dec 11 15:08:45 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menus.md.es,v 1.1 2014/07/26 19:30:45 dholland Exp $   */
+/*     $NetBSD: menus.md.es,v 1.2 2019/12/11 15:08:45 martin Exp $     */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -35,7 +35,3 @@
 
 /* evbarm machine dependent menus, spanish */
 
-menu prelim, title "What kind of system do you have?", y=-10;
-       option "Raspberry PI", exit, action { boardtype = 1; };
-       option "Other", exit, action { boardtype = 0; };
-
diff -r ee28e1d68406 -r 1c8eacc129f6 usr.sbin/sysinst/arch/evbarm/menus.md.fr
--- a/usr.sbin/sysinst/arch/evbarm/menus.md.fr  Wed Dec 11 14:03:37 2019 +0000
+++ b/usr.sbin/sysinst/arch/evbarm/menus.md.fr  Wed Dec 11 15:08:45 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menus.md.fr,v 1.1 2014/07/26 19:30:45 dholland Exp $   */
+/*     $NetBSD: menus.md.fr,v 1.2 2019/12/11 15:08:45 martin Exp $     */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -35,7 +35,3 @@
 
 /* evbarm machine dependent menus, french */
 
-menu prelim, title "What kind of system do you have?", y=-10;
-       option "Raspberry PI", exit, action { boardtype = 1; };
-       option "Other", exit, action { boardtype = 0; };
-
diff -r ee28e1d68406 -r 1c8eacc129f6 usr.sbin/sysinst/arch/evbarm/menus.md.pl
--- a/usr.sbin/sysinst/arch/evbarm/menus.md.pl  Wed Dec 11 14:03:37 2019 +0000
+++ b/usr.sbin/sysinst/arch/evbarm/menus.md.pl  Wed Dec 11 15:08:45 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menus.md.pl,v 1.1 2014/07/26 19:30:45 dholland Exp $   */
+/*     $NetBSD: menus.md.pl,v 1.2 2019/12/11 15:08:45 martin Exp $     */
 /* Based on english version: */
 /*     NetBSD: menus.md.en,v 1.2 2002/03/31 02:14:06 thorpej Exp */
 
@@ -37,7 +37,3 @@
 
 /* evbarm machine dependent menus, Polish */
 
-menu prelim, title "What kind of system do you have?", y=-10;
-       option "Raspberry PI", exit, action { boardtype = 1; };
-       option "Other", exit, action { boardtype = 0; };
-
diff -r ee28e1d68406 -r 1c8eacc129f6 usr.sbin/sysinst/defs.h
--- a/usr.sbin/sysinst/defs.h   Wed Dec 11 14:03:37 2019 +0000
+++ b/usr.sbin/sysinst/defs.h   Wed Dec 11 15:08:45 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: defs.h,v 1.48 2019/11/14 13:58:22 martin Exp $ */
+/*     $NetBSD: defs.h,v 1.49 2019/12/11 15:08:45 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -583,7 +583,6 @@
 
 /* Machine dependent functions .... */
 void   md_init(void);
-void   md_prelim_menu(void);
 void   md_init_set_status(int); /* SFLAG_foo */
 
  /* MD functions if user selects install - in order called */
diff -r ee28e1d68406 -r 1c8eacc129f6 usr.sbin/sysinst/main.c
--- a/usr.sbin/sysinst/main.c   Wed Dec 11 14:03:37 2019 +0000
+++ b/usr.sbin/sysinst/main.c   Wed Dec 11 15:08:45 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.18 2019/11/12 16:33:14 martin Exp $ */
+/*     $NetBSD: main.c,v 1.19 2019/12/11 15:08:45 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -164,9 +164,6 @@
        multname = msg_string(MSG_secname);
 }
 
-__weakref_visible void prelim_menu(void)
-    __weak_reference(md_prelim_menu);
-
 int
 main(int argc, char **argv)
 {
@@ -264,12 +261,6 @@
        get_kb_encoding();
        init_lang();
 
-#ifdef __weak_reference
-       /* if md wants to ask anything before we start, do it now */
-       if (prelim_menu != 0)
-               prelim_menu();
-#endif
-
        /* Menu processing */
        if (partman_go)
                partman();



Home | Main Index | Thread Index | Old Index