diff --git a/distrib/utils/sysinst/arch/alpha/md.c b/distrib/utils/sysinst/arch/alpha/md.c index 279472148989..eea80fdf6bc0 100644 --- a/distrib/utils/sysinst/arch/alpha/md.c +++ b/distrib/utils/sysinst/arch/alpha/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.19 2000/03/14 22:42:50 fvdl Exp $ */ +/* $NetBSD: md.c,v 1.20 2000/09/26 23:12:44 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -349,3 +349,9 @@ void md_cleanup_install(void) { } + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/amiga/md.c b/distrib/utils/sysinst/arch/amiga/md.c index 731902e8c723..b4f96b08723d 100644 --- a/distrib/utils/sysinst/arch/amiga/md.c +++ b/distrib/utils/sysinst/arch/amiga/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.1 2000/02/20 20:34:57 is Exp $ */ +/* $NetBSD: md.c,v 1.2 2000/09/26 23:12:45 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -137,3 +137,9 @@ md_cleanup_install(void) run_prog(0, 0, NULL, "rm -f %s", target_expand("/.termcap")); run_prog(0, 0, NULL, "rm -f %s", target_expand("/.profile")); } + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/arm32/md.c b/distrib/utils/sysinst/arch/arm32/md.c index 6c32b610707b..c38d2747827c 100644 --- a/distrib/utils/sysinst/arch/arm32/md.c +++ b/distrib/utils/sysinst/arch/arm32/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.23 2000/03/14 22:42:50 fvdl Exp $ */ +/* $NetBSD: md.c,v 1.24 2000/09/26 23:12:45 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -515,3 +515,9 @@ md_cleanup_install(void) run_prog(0, 0, NULL, "rm -f %s", target_expand("/.profile")); #endif } + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/bebox/md.c b/distrib/utils/sysinst/arch/bebox/md.c index 05540399eec3..19b6ce90120b 100644 --- a/distrib/utils/sysinst/arch/bebox/md.c +++ b/distrib/utils/sysinst/arch/bebox/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.15 2000/03/14 22:42:51 fvdl Exp $ */ +/* $NetBSD: md.c,v 1.16 2000/09/26 23:12:45 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -360,3 +360,9 @@ md_cleanup_install(void) run_prog(0, 0, NULL, "rm -f %s", target_expand("/.termcap")); run_prog(0, 0, NULL, "rm -f %s", target_expand("/.profile")); } + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/hpcmips/md.c b/distrib/utils/sysinst/arch/hpcmips/md.c index 2fdd3164e7b9..5c1fc978abb0 100644 --- a/distrib/utils/sysinst/arch/hpcmips/md.c +++ b/distrib/utils/sysinst/arch/hpcmips/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.4 2000/03/14 22:42:51 fvdl Exp $ */ +/* $NetBSD: md.c,v 1.5 2000/09/26 23:12:45 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -651,3 +651,9 @@ disp_bootsel(part, mbsp) } } #endif + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/i386/md.c b/distrib/utils/sysinst/arch/i386/md.c index 75a08fbd0405..3a8c151a4d19 100644 --- a/distrib/utils/sysinst/arch/i386/md.c +++ b/distrib/utils/sysinst/arch/i386/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.37 2000/09/20 19:53:36 hubertf Exp $ */ +/* $NetBSD: md.c,v 1.38 2000/09/26 23:12:45 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -64,6 +64,7 @@ static int mbr_part_above_chs __P((struct mbr_partition *)); static int mbr_partstart_above_chs __P((struct mbr_partition *)); static void configure_bootsel __P((void)); static void md_upgrade_mbrtype __P((void)); +static void md_enable_swap __P((partinfo *pp)); struct mbr_bootsel *mbs; int defbootselpart, defbootseldisk; @@ -175,6 +176,8 @@ md_pre_disklabel() int md_post_disklabel(void) { + md_enable_swap(bsdlabel); + /* Sector forwarding / badblocks ... */ if (*doessf) { msg_display(MSG_dobad144); @@ -422,6 +425,38 @@ custom: ask_sizemult(dlcylsize); return (1); } +static void +md_enable_swap(pp) + partinfo *pp; +{ + partinfo parts[16]; + int i, maxpart; + + if (pp == NULL) { + emptylabel(parts); + if (incorelabel(diskdev, parts) < 0) + return; + pp = parts; + } + + maxpart = getmaxpartitions(); + + for (i = 0; i < maxpart; i++) { + if (pp[i].pi_fstype == FS_SWAP) { + run_prog(0, 0, NULL, + "/sbin/swapctl -a /dev/%s%c", diskdev, 'a' + i); + break; + } + } +} + +int +md_pre_update(void) +{ + md_enable_swap(NULL); + return 1; +} + /* Upgrade support */ int diff --git a/distrib/utils/sysinst/arch/mac68k/md.c b/distrib/utils/sysinst/arch/mac68k/md.c index 720467a37a73..89863270c24e 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.12 1999/09/12 15:29:38 briggs Exp $ */ +/* $NetBSD: md.c,v 1.13 2000/09/26 23:12:45 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -887,3 +887,8 @@ md_cleanup_install(void) run_prog(0, 0, NULL, "rm -f %s", target_expand("/.profile")); } +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/macppc/md.c b/distrib/utils/sysinst/arch/macppc/md.c index 48d4a3910378..9840cd774ccd 100644 --- a/distrib/utils/sysinst/arch/macppc/md.c +++ b/distrib/utils/sysinst/arch/macppc/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.14 2000/03/14 22:42:52 fvdl Exp $ */ +/* $NetBSD: md.c,v 1.15 2000/09/26 23:12:46 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -361,3 +361,9 @@ md_cleanup_install() { } + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/news68k/md.c b/distrib/utils/sysinst/arch/news68k/md.c index 40b35215181f..79afe601c036 100644 --- a/distrib/utils/sysinst/arch/news68k/md.c +++ b/distrib/utils/sysinst/arch/news68k/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.2 2000/03/14 22:42:52 fvdl Exp $ */ +/* $NetBSD: md.c,v 1.3 2000/09/26 23:12:46 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -361,3 +361,9 @@ md_cleanup_install() { } + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/pc532/md.c b/distrib/utils/sysinst/arch/pc532/md.c index e45eb85fbb9e..0791ea9a7765 100644 --- a/distrib/utils/sysinst/arch/pc532/md.c +++ b/distrib/utils/sysinst/arch/pc532/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.19 2000/03/14 22:42:52 fvdl Exp $ */ +/* $NetBSD: md.c,v 1.20 2000/09/26 23:12:46 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -324,3 +324,9 @@ void md_cleanup_install(void) { } + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/pmax/md.c b/distrib/utils/sysinst/arch/pmax/md.c index ebf7bebdfad6..11b8c9894806 100644 --- a/distrib/utils/sysinst/arch/pmax/md.c +++ b/distrib/utils/sysinst/arch/pmax/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.38 1999/11/28 06:32:21 simonb Exp $ */ +/* $NetBSD: md.c,v 1.39 2000/09/26 23:12:46 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -222,3 +222,9 @@ md_cleanup_install(void) run_prog(0, 0, NULL, "rm -f %s", target_expand("/.termcap")); run_prog(0, 0, NULL, "rm -f %s", target_expand("/.profile")); } + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/sparc/md.c b/distrib/utils/sysinst/arch/sparc/md.c index 1fdc90843d2b..c5aeeee99421 100644 --- a/distrib/utils/sysinst/arch/sparc/md.c +++ b/distrib/utils/sysinst/arch/sparc/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.18 1999/08/16 08:29:06 abs Exp $ */ +/* $NetBSD: md.c,v 1.19 2000/09/26 23:12:46 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -215,3 +215,9 @@ md_cleanup_install(void) run_prog(0, 0, NULL, "rm -f %s", target_expand("/.termcap")); run_prog(0, 0, NULL, "rm -f %s", target_expand("/.profile")); } + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/sparc64/md.c b/distrib/utils/sysinst/arch/sparc64/md.c index 1afb4a37c010..409533472d80 100644 --- a/distrib/utils/sysinst/arch/sparc64/md.c +++ b/distrib/utils/sysinst/arch/sparc64/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.1 2000/08/19 13:22:40 mrg Exp $ */ +/* $NetBSD: md.c,v 1.2 2000/09/26 23:12:46 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -208,3 +208,9 @@ md_cleanup_install(void) run_prog(0, 0, NULL, "rm -f %s", target_expand("/.termcap")); run_prog(0, 0, NULL, "rm -f %s", target_expand("/.profile")); } + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/vax/md.c b/distrib/utils/sysinst/arch/vax/md.c index 06b834b1341e..738841c07f9b 100644 --- a/distrib/utils/sysinst/arch/vax/md.c +++ b/distrib/utils/sysinst/arch/vax/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.10 1999/08/16 08:29:07 abs Exp $ */ +/* $NetBSD: md.c,v 1.11 2000/09/26 23:12:46 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -207,3 +207,9 @@ md_cleanup_install(void) run_prog(0, 0, NULL, "rm -f %s", target_expand("/.termcap")); run_prog(0, 0, NULL, "rm -f %s", target_expand("/.profile")); } + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/arch/x68k/md.c b/distrib/utils/sysinst/arch/x68k/md.c index 8b005229ce73..a7a8838e87c7 100644 --- a/distrib/utils/sysinst/arch/x68k/md.c +++ b/distrib/utils/sysinst/arch/x68k/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.7 2000/09/16 13:12:09 minoura Exp $ */ +/* $NetBSD: md.c,v 1.8 2000/09/26 23:12:47 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -335,3 +335,9 @@ md_cleanup_install(void) run_prog(0, 0, NULL, "rm -f %s", target_expand("/.termcap")); run_prog(0, 0, NULL, "rm -f %s", target_expand("/.profile")); } + +int +md_pre_update() +{ + return 1; +} diff --git a/distrib/utils/sysinst/defs.h b/distrib/utils/sysinst/defs.h index 5c2aa3570e22..1362d85e50d5 100644 --- a/distrib/utils/sysinst/defs.h +++ b/distrib/utils/sysinst/defs.h @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.58 2000/09/26 13:26:02 fvdl Exp $ */ +/* $NetBSD: defs.h,v 1.59 2000/09/26 23:12:44 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -256,6 +256,7 @@ int md_make_bsd_partitions __P((void)); int md_post_disklabel __P((void)); int md_post_newfs __P((void)); int md_pre_disklabel __P((void)); +int md_pre_update __P((void)); int md_update __P((void)); /* from main.c */ diff --git a/distrib/utils/sysinst/upgrade.c b/distrib/utils/sysinst/upgrade.c index 3168230286d5..6b2c6177844c 100644 --- a/distrib/utils/sysinst/upgrade.c +++ b/distrib/utils/sysinst/upgrade.c @@ -1,4 +1,4 @@ -/* $NetBSD: upgrade.c,v 1.22 2000/09/09 00:21:36 hubertf Exp $ */ +/* $NetBSD: upgrade.c,v 1.23 2000/09/26 23:12:44 fvdl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -73,6 +73,9 @@ do_upgrade() if (find_disks() < 0) return; + if (md_pre_update() < 0) + return; + /* if we need the user to mount root, ask them to. */ if (must_mount_root()) { msg_display(MSG_pleasemountroot, diskdev, diskdev, diskdev);