From 9ef6b561d77b08fcb32324fc1decbba12d3f6bfa Mon Sep 17 00:00:00 2001 From: dsl Date: Wed, 25 Jun 2003 15:45:21 +0000 Subject: [PATCH] Add a -D (debug) option for testing. Ignore inability to remove swap if -D specified. Select disk before sets (but label after) Let mac68k sysinst run on i386. --- distrib/utils/sysinst/aout2elf.c | 4 ++-- distrib/utils/sysinst/arch/mac68k/md.c | 5 +++-- distrib/utils/sysinst/defs.h | 4 +++- distrib/utils/sysinst/install.c | 9 +++++---- distrib/utils/sysinst/main.c | 7 +++++-- distrib/utils/sysinst/target.c | 7 ++++--- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/distrib/utils/sysinst/aout2elf.c b/distrib/utils/sysinst/aout2elf.c index 018db78cdcdf..b4b7b5f20f2e 100644 --- a/distrib/utils/sysinst/aout2elf.c +++ b/distrib/utils/sysinst/aout2elf.c @@ -1,4 +1,4 @@ -/* $NetBSD: aout2elf.c,v 1.6 2003/06/16 19:42:13 dsl Exp $ +/* $NetBSD: aout2elf.c,v 1.7 2003/06/25 15:45:21 dsl Exp $ * * Copyright 1997 Piermont Information Systems Inc. * All rights reserved. @@ -35,7 +35,7 @@ * */ -/* aout2elf.c -- routines for upgrading an a.out system to elf */ +/* aout2elf.c -- routines for upgrading an a.out system to ELF */ #include #include diff --git a/distrib/utils/sysinst/arch/mac68k/md.c b/distrib/utils/sysinst/arch/mac68k/md.c index c3828b2a1f13..3b1a2954001c 100644 --- a/distrib/utils/sysinst/arch/mac68k/md.c +++ b/distrib/utils/sysinst/arch/mac68k/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.34 2003/06/11 21:35:43 dsl Exp $ */ +/* $NetBSD: md.c,v 1.35 2003/06/25 15:45:23 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -656,7 +656,8 @@ md_get_info() char devname[100]; struct apple_part_map_entry block; - snprintf (devname, sizeof(devname), "/dev/r%sc", diskdev); + snprintf(devname, sizeof(devname), "/dev/r%s%c", + diskdev, 'a' + getrawpartition()); /* * Open the disk as a raw device diff --git a/distrib/utils/sysinst/defs.h b/distrib/utils/sysinst/defs.h index 9713ac49a761..e1dc3ea33bc4 100644 --- a/distrib/utils/sysinst/defs.h +++ b/distrib/utils/sysinst/defs.h @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.91 2003/06/16 10:42:47 dsl Exp $ */ +/* $NetBSD: defs.h,v 1.92 2003/06/25 15:45:21 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -145,6 +145,8 @@ typedef struct _partinfo { /* variables */ +EXTERN int debug; /* set by -D option */ + EXTERN char rel[SSTRSIZE] INIT(REL); EXTERN char machine[SSTRSIZE] INIT(MACH); diff --git a/distrib/utils/sysinst/install.c b/distrib/utils/sysinst/install.c index e6247d3e8dc8..e6c9046f5a36 100644 --- a/distrib/utils/sysinst/install.c +++ b/distrib/utils/sysinst/install.c @@ -1,4 +1,4 @@ -/* $NetBSD: install.c,v 1.34 2003/06/16 19:42:14 dsl Exp $ */ +/* $NetBSD: install.c,v 1.35 2003/06/25 15:45:22 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -58,8 +58,6 @@ do_install(void) get_ramsize(); - process_menu(MENU_distset, NULL); - if (find_disks() < 0) return; @@ -69,10 +67,13 @@ do_install(void) if (check_swap(diskdev, 1) < 0) { msg_display(MSG_swapdelfailed); process_menu(MENU_ok, NULL); - return; + if (!debug) + return; } } + process_menu(MENU_distset, NULL); + /* if we need the user to mount root, ask them to. */ if (must_mount_root()) { msg_display(MSG_pleasemountroot, diskdev, diskdev, diskdev, diskdev); diff --git a/distrib/utils/sysinst/main.c b/distrib/utils/sysinst/main.c index 99ec3f31f9c4..e6dac3dffd66 100644 --- a/distrib/utils/sysinst/main.c +++ b/distrib/utils/sysinst/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.34 2003/06/16 19:42:14 dsl Exp $ */ +/* $NetBSD: main.c,v 1.35 2003/06/25 15:45:22 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -92,8 +92,11 @@ main(int argc, char **argv) } /* argv processing */ - while ((ch = getopt(argc, argv, "r:f:")) != -1) + while ((ch = getopt(argc, argv, "Dr:f:")) != -1) switch(ch) { + case 'D': /* set to get past certain errors in testing */ + debug = 1; + break; case 'r': /* Release name other than compiled in release. */ strncpy(rel, optarg, SSTRSIZE); diff --git a/distrib/utils/sysinst/target.c b/distrib/utils/sysinst/target.c index b4ad3725b619..5effc4d7f319 100644 --- a/distrib/utils/sysinst/target.c +++ b/distrib/utils/sysinst/target.c @@ -1,4 +1,4 @@ -/* $NetBSD: target.c,v 1.35 2003/06/16 19:42:14 dsl Exp $ */ +/* $NetBSD: target.c,v 1.36 2003/06/25 15:45:22 dsl Exp $ */ /* * Copyright 1997 Jonathan Stone @@ -75,7 +75,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: target.c,v 1.35 2003/06/16 19:42:14 dsl Exp $"); +__RCSID("$NetBSD: target.c,v 1.36 2003/06/25 15:45:22 dsl Exp $"); #endif /* @@ -588,7 +588,8 @@ mv_within_target_or_die(const char *frompath, const char *topath) } /* Do a cp where both pathnames are within the target filesystem. */ -int cp_within_target(const char *frompath, const char *topath) +int +cp_within_target(const char *frompath, const char *topath) { char realfrom[STRSIZE]; char realto[STRSIZE];