add a "module_machine", that defaults to machine.

allows MD code to override the default subdir for modules.
This commit is contained in:
mrg 2011-04-17 05:16:28 +00:00
parent df0710a4ad
commit 2101d54084
2 changed files with 9 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_module.c,v 1.77 2011/04/02 08:11:31 mbalmer Exp $ */
/* $NetBSD: kern_module.c,v 1.78 2011/04/17 05:16:28 mrg Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.77 2011/04/02 08:11:31 mbalmer Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.78 2011/04/17 05:16:28 mrg Exp $");
#define _MODULE_INTERNAL
@ -60,6 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.77 2011/04/02 08:11:31 mbalmer Exp
#include <machine/stdarg.h>
struct vm_map *module_map;
char *module_machine;
char module_base[MODULE_BASE_SIZE];
struct modlist module_list = TAILQ_HEAD_INITIALIZER(module_list);
@ -338,12 +339,14 @@ module_init(void)
module_init_md();
#endif
if (!module_machine)
module_machine = machine;
#if __NetBSD_Version__ / 1000000 % 100 == 99 /* -current */
snprintf(module_base, sizeof(module_base), "/stand/%s/%s/modules",
machine, osrelease);
module_machine, osrelease);
#else /* release */
snprintf(module_base, sizeof(module_base), "/stand/%s/%d.%d/modules",
machine, __NetBSD_Version__ / 100000000,
module_machine, __NetBSD_Version__ / 100000000,
__NetBSD_Version__ / 1000000 % 100);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: module.h,v 1.25 2010/08/21 13:17:32 pgoyette Exp $ */
/* $NetBSD: module.h,v 1.26 2011/04/17 05:16:29 mrg Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -157,6 +157,7 @@ void module_print(const char *, ...)
#define MODULE_BASE_SIZE 64
extern char module_base[MODULE_BASE_SIZE];
extern char *module_machine;
#else /* _KERNEL */