summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2008-03-08 19:15:27 +0000
committerMarc Espie <espie@cvs.openbsd.org>2008-03-08 19:15:27 +0000
commit21642aeb1b060a20071ffb86cee35d04f6cfb940 (patch)
treec10a38cd94b70f4af0a7b7ea89841fdb9d7eb66e /sys/dev
parente3e5af15507a727b66aa69312b984458ba60926b (diff)
look for firmload on /mnt/etc/firmware as well, only for ramdisks.
okay deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/firmload.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/firmload.c b/sys/dev/firmload.c
index bdab719ba6f..3304b3d8bea 100644
--- a/sys/dev/firmload.c
+++ b/sys/dev/firmload.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: firmload.c,v 1.8 2006/06/27 03:51:29 pedro Exp $ */
+/* $OpenBSD: firmload.c,v 1.9 2008/03/08 19:15:26 espie Exp $ */
/*
* Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org>
@@ -54,6 +54,19 @@ loadfirmware(const char *name, u_char **bufp, size_t *buflen)
NDINIT(&nid, LOOKUP, NOFOLLOW|LOCKLEAF, UIO_SYSSPACE, path, p);
error = namei(&nid);
+#ifdef RAMDISK_HOOKS
+ /* try again with mounted disk */
+ if (error) {
+ if (snprintf(path, MAXPATHLEN, "/mnt/etc/firmware/%s", name) >=
+ MAXPATHLEN) {
+ error = ENAMETOOLONG;
+ goto err;
+ }
+
+ NDINIT(&nid, LOOKUP, NOFOLLOW|LOCKLEAF, UIO_SYSSPACE, path, p);
+ error = namei(&nid);
+ }
+#endif
if (error)
goto err;
error = VOP_GETATTR(nid.ni_vp, &va, p->p_ucred, p);