Module Name: src Committed By: martin Date: Sun Nov 11 09:17:11 UTC 2018
Modified Files: src/usr.sbin/sysinst: defs.h disks.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/sysinst/defs.h cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sysinst/disks.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/sysinst/defs.h diff -u src/usr.sbin/sysinst/defs.h:1.22 src/usr.sbin/sysinst/defs.h:1.23 --- src/usr.sbin/sysinst/defs.h:1.22 Thu Nov 8 20:29:37 2018 +++ src/usr.sbin/sysinst/defs.h Sun Nov 11 09:17:10 2018 @@ -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 */ Index: src/usr.sbin/sysinst/disks.c diff -u src/usr.sbin/sysinst/disks.c:1.23 src/usr.sbin/sysinst/disks.c:1.24 --- src/usr.sbin/sysinst/disks.c:1.23 Fri Nov 9 15:20:36 2018 +++ src/usr.sbin/sysinst/disks.c Sun Nov 11 09:17:10 2018 @@ -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)