summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2018-11-11 09:17:10 +0000
committermartin <martin@NetBSD.org>2018-11-11 09:17:10 +0000
commitca08ac536b2d64eaf7c16079eada39df7a4a42ee (patch)
tree319ff4f0491b1e89124ab57fbdb3ff8e87363425
parent60b90364d032bd130805e0aed64605df8c115c4d (diff)
Do not allow installation onto floppy disk - can be overriden by
architectures where it would make sense (none currently), and also works around a bug in QEMU for sparc that kills our -current anita tests.
-rw-r--r--usr.sbin/sysinst/defs.h10
-rw-r--r--usr.sbin/sysinst/disks.c18
2 files changed, 24 insertions, 4 deletions
diff --git a/usr.sbin/sysinst/defs.h b/usr.sbin/sysinst/defs.h
index c2fec48eb78..bd5932337c1 100644
--- a/usr.sbin/sysinst/defs.h
+++ b/usr.sbin/sysinst/defs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.22 2018/11/08 20:29:37 martin Exp $ */
+/* $NetBSD: defs.h,v 1.23 2018/11/11 09:17:10 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -178,8 +178,14 @@ enum {
#define PI_ISBSDFS(p) ((p)->pi_fstype == FS_BSDLFS || \
(p)->pi_fstype == FS_BSDFFS)
-/* standard cd0 device */
+/*
+ * We do not offer CDs or floppies as installation target usually.
+ * Architectures might want to undefine if they want to allow
+ * these devices or redefine if they have unusual CD device names.
+ * Do not define to empty or an empty string, undefine instead.
+ */
#define CD_NAMES "cd*"
+#define FLOPPY_NAMES "fd*"
/* Types */
diff --git a/usr.sbin/sysinst/disks.c b/usr.sbin/sysinst/disks.c
index 44531f3d829..ca227a0a625 100644
--- a/usr.sbin/sysinst/disks.c
+++ b/usr.sbin/sysinst/disks.c
@@ -1,4 +1,4 @@
-/* $NetBSD: disks.c,v 1.23 2018/11/09 15:20:36 martin Exp $ */
+/* $NetBSD: disks.c,v 1.24 2018/11/11 09:17:10 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -515,7 +515,21 @@ is_ffs_wedge(const char *dev)
bool
is_cdrom_device(const char *dev)
{
- static const char *cdrom_devices[] = { CD_NAMES, 0 };
+ static const char *cdrom_devices[] = {
+#ifdef CD_NAMES
+ CD_NAMES
+#endif
+#if defined(CD_NAMES) && defined(FLOPPY_NAMES)
+ ,
+#endif
+#ifdef FLOPPY_NAMES
+ FLOPPY_NAMES
+#endif
+#if defined(CD_NAMES) || defined(FLOPPY_NAMES)
+ ,
+#endif
+ 0
+ };
for (const char **dev_pat = cdrom_devices; *dev_pat; dev_pat++)
if (fnmatch(*dev_pat, dev, 0) == 0)