Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst Don't show a disk which is mounted as ...



details:   https://anonhg.NetBSD.org/src/rev/fb1cab706e4e
branches:  trunk
changeset: 782732:fb1cab706e4e
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Nov 17 20:34:24 2012 +0000

description:
Don't show a disk which is mounted as root partition
in the "Available disks" list during sysinst procedure
to prevent users from shooting their foot in case of
installation using install-image on a USB stick.
Per suggestion in PR/47195.

diffstat:

 distrib/utils/sysinst/disks.c |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r 289a1d01ee29 -r fb1cab706e4e distrib/utils/sysinst/disks.c
--- a/distrib/utils/sysinst/disks.c     Sat Nov 17 19:35:55 2012 +0000
+++ b/distrib/utils/sysinst/disks.c     Sat Nov 17 20:34:24 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disks.c,v 1.126 2012/06/23 14:06:02 christos Exp $ */
+/*     $NetBSD: disks.c,v 1.127 2012/11/17 20:34:24 tsutsui Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -377,6 +377,14 @@
                                        break;
                                continue;
                        }
+
+                       /*
+                        * Exclude a disk mounted as root partition,
+                        * in case of install-image on a USB memstick.
+                        */
+                       if (is_active_rootpart(dd->dd_name, 0))
+                               continue;
+
                        dd->dd_cyl = l.d_ncylinders;
                        dd->dd_head = l.d_ntracks;
                        dd->dd_sec = l.d_nsectors;



Home | Main Index | Thread Index | Old Index