Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst Fix the "reinstall sets" action.
details: https://anonhg.NetBSD.org/src/rev/81f200dfc47f
branches: trunk
changeset: 462039:81f200dfc47f
user: martin <martin%NetBSD.org@localhost>
date: Tue Jul 23 16:02:32 2019 +0000
description:
Fix the "reinstall sets" action.
diffstat:
usr.sbin/sysinst/defs.h | 4 ++--
usr.sbin/sysinst/menus.mi | 4 ++--
usr.sbin/sysinst/upgrade.c | 24 +++++++++++++++++-------
3 files changed, 21 insertions(+), 11 deletions(-)
diffs (89 lines):
diff -r ebaf5685548b -r 81f200dfc47f usr.sbin/sysinst/defs.h
--- a/usr.sbin/sysinst/defs.h Tue Jul 23 15:56:14 2019 +0000
+++ b/usr.sbin/sysinst/defs.h Tue Jul 23 16:02:32 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.39 2019/07/23 15:23:14 martin Exp $ */
+/* $NetBSD: defs.h,v 1.40 2019/07/23 16:02:32 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -684,7 +684,7 @@
/* from upgrade.c */
void do_upgrade(void);
-void do_reinstall_sets(struct install_partition_desc*);
+void do_reinstall_sets(void);
void restore_etc(void);
/* from part_edit.c */
diff -r ebaf5685548b -r 81f200dfc47f usr.sbin/sysinst/menus.mi
--- a/usr.sbin/sysinst/menus.mi Tue Jul 23 15:56:14 2019 +0000
+++ b/usr.sbin/sysinst/menus.mi Tue Jul 23 16:02:32 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.mi,v 1.18 2019/06/20 00:43:55 christos Exp $ */
+/* $NetBSD: menus.mi,v 1.19 2019/07/23 16:02:32 martin Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -270,7 +270,7 @@
option MSG_Upgrade_NetBSD_on_a_hard_disk,
action { do_upgrade(); };
option MSG_Re_install_sets_or_install_additional_sets,
- action { do_reinstall_sets(NULL); };
+ action { do_reinstall_sets(); };
option MSG_Reboot_the_computer, exit,
action (endwin) { system("/sbin/reboot -q"); };
option MSG_Utility_menu, sub menu utility;
diff -r ebaf5685548b -r 81f200dfc47f usr.sbin/sysinst/upgrade.c
--- a/usr.sbin/sysinst/upgrade.c Tue Jul 23 15:56:14 2019 +0000
+++ b/usr.sbin/sysinst/upgrade.c Tue Jul 23 16:02:32 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: upgrade.c,v 1.10 2019/07/23 15:23:14 martin Exp $ */
+/* $NetBSD: upgrade.c,v 1.11 2019/07/23 16:02:32 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -193,9 +193,11 @@
* Unpacks sets, clobbering existing contents.
*/
void
-do_reinstall_sets(struct install_partition_desc *install)
+do_reinstall_sets()
{
+ struct install_partition_desc install;
int retcode = 0;
+ partman_go = 0;
unwind_mounts();
msg_display(MSG_reinstallusure);
@@ -205,17 +207,25 @@
if (find_disks(msg_string(MSG_reinstall)) < 0)
return;
- /* XXX find proper pm pointer and pass it here, make sure we have
- * read partitions and provide "infos" in there */
- if (mount_disks(install) != 0)
+ if (pm->parts == NULL) {
+ hit_enter_to_continue(MSG_noroot, NULL);
return;
+ }
+
+ install_desc_from_parts(&install, pm->parts);
+
+ if (mount_disks(&install) != 0)
+ goto free_install;
/* Unpack the distribution. */
process_menu(MENU_distset, &retcode);
if (retcode == 0)
- return;
+ goto free_install;
if (get_and_unpack_sets(0, NULL, MSG_unpackcomplete, MSG_abortunpack) != 0)
- return;
+ goto free_install;
sanity_check();
+
+free_install:
+ free_install_desc(&install);
}
Home |
Main Index |
Thread Index |
Old Index