Look for /boot/config in addition to /boot.config, with the former taking

precedence over the latter if it exists.

MFC after:	3 weeks
This commit is contained in:
des 2011-10-18 09:46:52 +00:00
parent 4ebe5d8b07
commit 6bf8732384
6 changed files with 24 additions and 13 deletions

View File

@ -64,7 +64,8 @@ __FBSDID("$FreeBSD$");
OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_VERBOSE) | \
OPT_SET(RBX_GDB)) OPT_SET(RBX_GDB))
#define PATH_CONFIG "/boot.config" #define PATH_DOTCONFIG "/boot.config"
#define PATH_CONFIG "/boot/config"
//#define PATH_KERNEL "/boot/kernel/kernel" //#define PATH_KERNEL "/boot/kernel/kernel"
#define PATH_KERNEL "/boot/kernel/kernel.gz.tramp" #define PATH_KERNEL "/boot/kernel/kernel.gz.tramp"
@ -160,7 +161,8 @@ main(void)
autoboot = 1; autoboot = 1;
/* Process configuration file */ /* Process configuration file */
if ((ino = lookup(PATH_CONFIG))) if ((ino = lookup(PATH_CONFIG)) ||
(ino = lookup(PATH_DOTCONFIG)))
fsread(ino, cmd, sizeof(cmd)); fsread(ino, cmd, sizeof(cmd));
if (*cmd) { if (*cmd) {

View File

@ -62,7 +62,8 @@ __FBSDID("$FreeBSD$");
OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_VERBOSE) | \
OPT_SET(RBX_GDB)) OPT_SET(RBX_GDB))
#define PATH_CONFIG "/boot.config" #define PATH_DOTCONFIG "/boot.config"
#define PATH_CONFIG "/boot/config"
#define PATH_KERNEL "/boot/kernel/kernel" #define PATH_KERNEL "/boot/kernel/kernel"
extern uint32_t _end; extern uint32_t _end;
@ -168,7 +169,8 @@ main(void)
autoboot = 1; autoboot = 1;
/* Process configuration file */ /* Process configuration file */
if ((ino = lookup(PATH_CONFIG))) if ((ino = lookup(PATH_CONFIG)) ||
(ino = lookup(PATH_DOTCONFIG)))
fsread(ino, cmd, sizeof(cmd)); fsread(ino, cmd, sizeof(cmd));
if (*cmd) { if (*cmd) {

View File

@ -75,7 +75,8 @@ __FBSDID("$FreeBSD$");
OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \
OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL))
#define PATH_CONFIG "/boot.config" #define PATH_DOTCONFIG "/boot.config"
#define PATH_CONFIG "/boot/config"
#define PATH_BOOT3 "/boot/loader" #define PATH_BOOT3 "/boot/loader"
#define PATH_KERNEL "/boot/kernel/kernel" #define PATH_KERNEL "/boot/kernel/kernel"
@ -241,7 +242,8 @@ main(void)
autoboot = 1; autoboot = 1;
if ((ino = lookup(PATH_CONFIG))) if ((ino = lookup(PATH_CONFIG)) ||
(ino = lookup(PATH_DOTCONFIG)))
fsread(ino, cmd, sizeof(cmd)); fsread(ino, cmd, sizeof(cmd));
if (*cmd) { if (*cmd) {

View File

@ -38,7 +38,8 @@ __FBSDID("$FreeBSD$");
#include "cons.h" #include "cons.h"
#include "gpt.h" #include "gpt.h"
#define PATH_CONFIG "/boot.config" #define PATH_DOTCONFIG "/boot.config"
#define PATH_CONFIG "/boot/config"
#define PATH_BOOT3 "/boot/loader" #define PATH_BOOT3 "/boot/loader"
#define PATH_KERNEL "/boot/kernel/kernel" #define PATH_KERNEL "/boot/kernel/kernel"
@ -163,8 +164,8 @@ main(void)
for (;;) { for (;;) {
*kname = '\0'; *kname = '\0';
ino = lookup(PATH_CONFIG); if ((ino = lookup(PATH_CONFIG)) ||
if (ino > 0) (ino = lookup(PATH_DOTCONFIG)))
fsread(ino, cmd, sizeof(cmd)); fsread(ino, cmd, sizeof(cmd));
if (*cmd != '\0') { if (*cmd != '\0') {

View File

@ -45,7 +45,8 @@ __FBSDID("$FreeBSD$");
/* Hint to loader that we came from ZFS */ /* Hint to loader that we came from ZFS */
#define KARGS_FLAGS_ZFS 0x4 #define KARGS_FLAGS_ZFS 0x4
#define PATH_CONFIG "/boot.config" #define PATH_DOTCONFIG "/boot.config"
#define PATH_CONFIG "/boot/config"
#define PATH_BOOT3 "/boot/zfsloader" #define PATH_BOOT3 "/boot/zfsloader"
#define PATH_KERNEL "/boot/kernel/kernel" #define PATH_KERNEL "/boot/kernel/kernel"
@ -533,7 +534,8 @@ main(void)
zfs_mount_pool(spa); zfs_mount_pool(spa);
if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0) { if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0 ||
zfs_lookup(spa, PATH_DOTCONFIG, &dn) == 0) {
off = 0; off = 0;
zfs_read(spa, &dn, &off, cmd, sizeof(cmd)); zfs_read(spa, &dn, &off, cmd, sizeof(cmd));
} }

View File

@ -77,7 +77,8 @@ __FBSDID("$FreeBSD$");
OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \
OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL))
#define PATH_CONFIG "/boot.config" #define PATH_DOTCONFIG "/boot.config"
#define PATH_CONFIG "/boot/config"
#define PATH_BOOT3 "/boot/loader" #define PATH_BOOT3 "/boot/loader"
#define PATH_KERNEL "/boot/kernel/kernel" #define PATH_KERNEL "/boot/kernel/kernel"
@ -379,7 +380,8 @@ main(void)
autoboot = 1; autoboot = 1;
if ((ino = lookup(PATH_CONFIG))) if ((ino = lookup(PATH_CONFIG)) ||
(ino = lookup(PATH_DOTCONFIG)))
fsread(ino, cmd, sizeof(cmd)); fsread(ino, cmd, sizeof(cmd));
if (*cmd) { if (*cmd) {