Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst/arch/sparc If all disk is allocated to...



details:   https://anonhg.NetBSD.org/src/rev/e892d1c295ad
branches:  trunk
changeset: 474647:e892d1c295ad
user:      abs <abs%NetBSD.org@localhost>
date:      Wed Jul 14 16:47:37 1999 +0000

description:
If all disk is allocated to root and/or swap do not prompt for a (bogus) /usr.
Fixed PR#7741
If the default swap is smaller than the remaining disk, truncate to the
available space.
Set rc_configured to YES in md_cleanup_install()

diffstat:

 distrib/utils/sysinst/arch/sparc/md.c |  54 ++++++++++++++++++++++++----------
 1 files changed, 38 insertions(+), 16 deletions(-)

diffs (82 lines):

diff -r a79fc9f107db -r e892d1c295ad distrib/utils/sysinst/arch/sparc/md.c
--- a/distrib/utils/sysinst/arch/sparc/md.c     Wed Jul 14 16:41:31 1999 +0000
+++ b/distrib/utils/sysinst/arch/sparc/md.c     Wed Jul 14 16:47:37 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.15 1999/07/14 16:41:31 abs Exp $      */
+/*     $NetBSD: md.c,v 1.16 1999/07/14 16:47:37 abs Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -270,6 +270,8 @@
                           MEG/sectorsize, dlcylsize) + partstart;
                partsize = NUMSEC (i/(MEG/sectorsize)+1, MEG/sectorsize,
                           dlcylsize) - partstart;
+               if (partsize > remain)
+                   partsize = remain;
                snprintf (isize, 20, "%d", partsize/sizemult);
                msg_prompt_add (MSG_askfsswap, isize, isize, 20,
                            remain/sizemult, multname);
@@ -280,20 +282,22 @@
                
                /* /usr */
                remain = fsdsize - partstart;
-               partsize = fsdsize - partstart;
-               snprintf (isize, 20, "%d", partsize/sizemult);
-               msg_prompt_add (MSG_askfsusr, isize, isize, 20,
-                           remain/sizemult, multname);
-               partsize = NUMSEC(atoi(isize),sizemult, dlcylsize);
-               if (remain - partsize < sizemult)
-                       partsize = remain;
-               bsdlabel[PART_USR].pi_fstype = FS_BSDFFS;
-               bsdlabel[PART_USR].pi_offset = partstart;
-               bsdlabel[PART_USR].pi_size = partsize;
-               bsdlabel[PART_USR].pi_bsize = 8192;
-               bsdlabel[PART_USR].pi_fsize = 1024;
-               strcpy (fsmount[PART_USR], "/usr");
-               partstart += partsize;
+               if (remain >= dlcylsize) {
+                       partsize = fsdsize - partstart;
+                       snprintf (isize, 20, "%d", partsize/sizemult);
+                       msg_prompt_add (MSG_askfsusr, isize, isize, 20,
+                                   remain/sizemult, multname);
+                       partsize = NUMSEC(atoi(isize),sizemult, dlcylsize);
+                       if (remain - partsize < sizemult)
+                               partsize = remain;
+                       bsdlabel[PART_USR].pi_fstype = FS_BSDFFS;
+                       bsdlabel[PART_USR].pi_offset = partstart;
+                       bsdlabel[PART_USR].pi_size = partsize;
+                       bsdlabel[PART_USR].pi_bsize = 8192;
+                       bsdlabel[PART_USR].pi_fsize = 1024;
+                       strcpy (fsmount[PART_USR], "/usr");
+                       partstart += partsize;
+               }
 
                /* Others ... */
                remain = fsdsize - partstart;
@@ -360,7 +364,25 @@
 }
 
 void
-md_cleanup_install()
+md_cleanup_install(void)
 {
+       char realfrom[STRSIZE];
+       char realto[STRSIZE];
+       char sedcmd[STRSIZE];
 
+       strncpy(realfrom, target_expand("/etc/rc.conf"), STRSIZE);
+       strncpy(realto, target_expand("/etc/rc.conf.install"), STRSIZE);
+       sprintf(sedcmd, "sed 's/rc_configured=NO/rc_configured=YES/' < %s > %s",
+           realfrom, realto);
+       if (logging)
+               (void)fprintf(log, "%s\n", sedcmd);
+       if (scripting)
+               (void)fprintf(script, "%s\n", sedcmd);
+       do_system(sedcmd);
+
+       run_prog(1, 0, NULL, "mv -f %s %s", realto, realfrom);
+
+       run_prog(0, 0, NULL, "rm -f %s", target_expand("/sysinst"));
+       run_prog(0, 0, NULL, "rm -f %s", target_expand("/.termcap"));
+       run_prog(0, 0, NULL, "rm -f %s", target_expand("/.profile"));
 }



Home | Main Index | Thread Index | Old Index