From owner-svn-src-all@freebsd.org Tue Feb 9 22:32:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCF5AAA3510; Tue, 9 Feb 2016 22:32:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83FB1CB2; Tue, 9 Feb 2016 22:32:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19MWPRY090573; Tue, 9 Feb 2016 22:32:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19MWO6X089956; Tue, 9 Feb 2016 22:32:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602092232.u19MWO6X089956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Feb 2016 22:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295453 - in stable/10/sys/boot: arm/at91/boot2 arm/ixp425/boot2 common efi/boot1 i386/boot2 i386/common i386/gptboot i386/zfsboot pc98/boot2 powerpc/boot1.chrp sparc64/boot1 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 22:32:26 -0000 Author: emaste Date: Tue Feb 9 22:32:24 2016 New Revision: 295453 URL: https://svnweb.freebsd.org/changeset/base/295453 Log: MFC boot loader path and RBX constant deduplication r294765 (imp) Move all the separate copies of the same strings into paths.h. There's nothing machine specific about these. r294765 (imp) RBX_ defines are in rbx.h, move it there. r294847 (imp) Remove static from these two. They slipped through the cracks. r294925 (imp) Fix mistake when transitioning to the new defines with ZFS loader. I hate adding yet another define, but it is the lessor of the evil choices available. Kill another evil by removing PATH_BOOT3 and replacing it with PATH_LOADER or PATH_LOADER_ZFS as appropriate. Approved by: re (gjb) Added: stable/10/sys/boot/common/paths.h - copied, changed from r294765, head/sys/boot/common/paths.h stable/10/sys/boot/common/rbx.h - copied unchanged from r294766, head/sys/boot/common/rbx.h Deleted: stable/10/sys/boot/i386/common/rbx.h Modified: stable/10/sys/boot/arm/at91/boot2/boot2.c stable/10/sys/boot/arm/ixp425/boot2/boot2.c stable/10/sys/boot/efi/boot1/boot1.c stable/10/sys/boot/i386/boot2/boot2.c stable/10/sys/boot/i386/gptboot/gptboot.c stable/10/sys/boot/i386/zfsboot/zfsboot.c stable/10/sys/boot/pc98/boot2/boot2.c stable/10/sys/boot/powerpc/boot1.chrp/boot1.c stable/10/sys/boot/sparc64/boot1/boot1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/arm/at91/boot2/boot2.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/arm/at91/boot2/boot2.c Tue Feb 9 22:32:24 2016 (r295453) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2008 John Hay - * Copyright (c) 2006 Warner Losh + * Copyright (c) 2006 M Warner Losh * Copyright (c) 1998 Robert Nordier * All rights reserved. * @@ -30,52 +30,16 @@ __FBSDID("$FreeBSD$"); #include "lib.h" #include "board.h" +#include "paths.h" +#include "rbx.h" -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -/* #define RBX_KDB 0x6 -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -/* #define RBX_SERIAL 0xc -h */ -/* #define RBX_CDROM 0xd -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -/* #define RBX_MUTE 0x10 -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -/* #define RBX_PAUSE 0x14 -p */ -/* #define RBX_QUIET 0x15 -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -/* #define RBX_DUAL 0x1d -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -v, -g */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | \ - OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_GDB)) - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -//#define PATH_KERNEL "/boot/kernel/kernel" +#undef PATH_KERNEL #define PATH_KERNEL "/boot/kernel/kernel.gz.tramp" extern uint32_t _end; #define NOPT 6 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - static const char optstr[NOPT] = "agnrsv"; static const unsigned char flags[NOPT] = { RBX_ASKNAME, Modified: stable/10/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/arm/ixp425/boot2/boot2.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/arm/ixp425/boot2/boot2.c Tue Feb 9 22:32:24 2016 (r295453) @@ -28,51 +28,13 @@ __FBSDID("$FreeBSD$"); #include #include "lib.h" - -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -/* #define RBX_KDB 0x6 -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -/* #define RBX_SERIAL 0xc -h */ -/* #define RBX_CDROM 0xd -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -/* #define RBX_MUTE 0x10 -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -/* #define RBX_PAUSE 0x14 -p */ -/* #define RBX_QUIET 0x15 -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -/* #define RBX_DUAL 0x1d -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -v, -g */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | \ - OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_GDB)) - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" +#include "rbx.h" extern uint32_t _end; #define NOPT 6 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - static const char optstr[NOPT] = "agnrsv"; static const unsigned char flags[NOPT] = { RBX_ASKNAME, Copied and modified: stable/10/sys/boot/common/paths.h (from r294765, head/sys/boot/common/paths.h) ============================================================================== --- head/sys/boot/common/paths.h Tue Jan 26 06:26:19 2016 (r294765, copy source) +++ stable/10/sys/boot/common/paths.h Tue Feb 9 22:32:24 2016 (r295453) @@ -31,9 +31,9 @@ #define PATH_DOTCONFIG "/boot.config" #define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" #define PATH_LOADER "/boot/loader" #define PATH_LOADER_EFI "/boot/loader.efi" +#define PATH_LOADER_ZFS "/boot/zfsloader" #define PATH_KERNEL "/boot/kernel/kernel" #endif /* _PATHS_H_ */ Copied: stable/10/sys/boot/common/rbx.h (from r294766, head/sys/boot/common/rbx.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/common/rbx.h Tue Feb 9 22:32:24 2016 (r295453, copy of r294766, head/sys/boot/common/rbx.h) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + * + * $FreeBSD$ + */ + +#ifndef _RBX_H_ +#define _RBX_H_ + +#define RBX_ASKNAME 0x0 /* -a */ +#define RBX_SINGLE 0x1 /* -s */ +/* 0x2 is reserved for log2(RB_NOSYNC). */ +/* 0x3 is reserved for log2(RB_HALT). */ +/* 0x4 is reserved for log2(RB_INITNAME). */ +#define RBX_DFLTROOT 0x5 /* -r */ +#define RBX_KDB 0x6 /* -d */ +/* 0x7 is reserved for log2(RB_RDONLY). */ +/* 0x8 is reserved for log2(RB_DUMP). */ +/* 0x9 is reserved for log2(RB_MINIROOT). */ +#define RBX_CONFIG 0xa /* -c */ +#define RBX_VERBOSE 0xb /* -v */ +#define RBX_SERIAL 0xc /* -h */ +#define RBX_CDROM 0xd /* -C */ +/* 0xe is reserved for log2(RB_POWEROFF). */ +#define RBX_GDB 0xf /* -g */ +#define RBX_MUTE 0x10 /* -m */ +/* 0x11 is reserved for log2(RB_SELFTEST). */ +/* 0x12 is reserved for boot programs. */ +/* 0x13 is reserved for boot programs. */ +#define RBX_PAUSE 0x14 /* -p */ +#define RBX_QUIET 0x15 /* -q */ +#define RBX_NOINTR 0x1c /* -n */ +/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ +#define RBX_DUAL 0x1d /* -D */ +/* 0x1f is reserved for log2(RB_BOOTINFO). */ + +/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ +#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ + OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ + OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ + OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ + OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ + OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) + +#define OPT_SET(opt) (1 << (opt)) +#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) + +extern uint32_t opts; + +#endif /* !_RBX_H_ */ Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/efi/boot1/boot1.c Tue Feb 9 22:32:24 2016 (r295453) @@ -31,8 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include "boot_module.h" - -#define _PATH_LOADER "/boot/loader.efi" +#include "paths.h" static const boot_module_t *boot_modules[] = { @@ -99,13 +98,13 @@ try_load(const boot_module_t *mod) EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; - status = mod->load(_PATH_LOADER, &dev, &buf, &bufsize); + status = mod->load(PATH_LOADER_EFI, &dev, &buf, &bufsize); if (status == EFI_NOT_FOUND) return; if (status != EFI_SUCCESS) { - printf("%s failed to load %s (%lu)\n", mod->name, _PATH_LOADER, - EFI_ERROR_CODE(status)); + printf("%s failed to load %s (%lu)\n", mod->name, + PATH_LOADER_EFI, EFI_ERROR_CODE(status)); return; } @@ -174,7 +173,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_T conout->ClearScreen(conout); printf("\n>> FreeBSD EFI boot block\n"); - printf(" Loader path: %s\n\n", _PATH_LOADER); + printf(" Loader path: %s\n\n", PATH_LOADER_EFI); printf(" Initializing modules:"); for (i = 0; i < NUM_BOOT_MODULES; i++) { if (boot_modules[i] == NULL) Modified: stable/10/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/i386/boot2/boot2.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/i386/boot2/boot2.c Tue Feb 9 22:32:24 2016 (r295453) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" +#include "paths.h" +#include "rbx.h" /* Define to 0 to omit serial support */ #ifndef SERIAL @@ -52,46 +54,6 @@ __FBSDID("$FreeBSD$"); #define SECOND 18 /* Circa that many ticks in a second. */ -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -#define RBX_KDB 0x6 /* -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -#define RBX_SERIAL 0xc /* -h */ -#define RBX_CDROM 0xd /* -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -#define RBX_MUTE 0x10 /* -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -#define RBX_PAUSE 0x14 /* -p */ -#define RBX_QUIET 0x15 /* -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -#define RBX_DUAL 0x1d /* -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ - OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ - OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ - OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 @@ -106,9 +68,6 @@ __FBSDID("$FreeBSD$"); #define TYPE_MAXHARD TYPE_DA #define TYPE_FD 2 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ @@ -143,7 +102,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; -static uint32_t opts; +uint32_t opts; static struct bootinfo bootinfo; #if SERIAL static int comspeed = SIOSPD; @@ -275,7 +234,7 @@ main(void) */ if (!kname) { - kname = PATH_BOOT3; + kname = PATH_LOADER; if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; Modified: stable/10/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/10/sys/boot/i386/gptboot/gptboot.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/i386/gptboot/gptboot.c Tue Feb 9 22:32:24 2016 (r295453) @@ -37,11 +37,7 @@ __FBSDID("$FreeBSD$"); #include "util.h" #include "cons.h" #include "gpt.h" - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" #define ARGS 0x900 #define NOPT 14 @@ -180,7 +176,7 @@ main(void) if (autoboot && keyhit(3)) { if (*kname == '\0') - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER)); break; } autoboot = 0; @@ -192,7 +188,7 @@ main(void) */ if (*kname != '\0') load(); - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER)); load(); memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); load(); Modified: stable/10/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/10/sys/boot/i386/zfsboot/zfsboot.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/i386/zfsboot/zfsboot.c Tue Feb 9 22:32:24 2016 (r295453) @@ -42,14 +42,10 @@ __FBSDID("$FreeBSD$"); #include "util.h" #include "cons.h" #include "bootargs.h" +#include "paths.h" #include "libzfs.h" -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/zfsloader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 @@ -550,12 +546,12 @@ main(void) } /* - * Try to exec stage 3 boot loader. If interrupted by a keypress, + * Try to exec /boot/loader. If interrupted by a keypress, * or in case of failure, try to load a kernel directly instead. */ if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + memcpy(kname, PATH_LOADER_ZFS, sizeof(PATH_LOADER_ZFS)); if (!keyhit(3)) { load(); memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); Modified: stable/10/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/pc98/boot2/boot2.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/pc98/boot2/boot2.c Tue Feb 9 22:32:24 2016 (r295453) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" +#include "paths.h" +#include "rbx.h" /* Define to 0 to omit serial support */ #ifndef SERIAL @@ -54,46 +56,6 @@ __FBSDID("$FreeBSD$"); #define SECOND 1 /* Circa that many ticks in a second. */ -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -#define RBX_KDB 0x6 /* -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -#define RBX_SERIAL 0xc /* -h */ -#define RBX_CDROM 0xd /* -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -#define RBX_MUTE 0x10 /* -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -#define RBX_PAUSE 0x14 /* -p */ -#define RBX_QUIET 0x15 /* -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -#define RBX_DUAL 0x1d /* -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ - OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ - OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ - OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 @@ -105,9 +67,6 @@ __FBSDID("$FreeBSD$"); #define TYPE_DA 1 #define TYPE_FD 2 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ @@ -145,7 +104,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; -static uint32_t opts; +uint32_t opts; static struct bootinfo bootinfo; #if SERIAL static int comspeed = SIOSPD; @@ -414,7 +373,7 @@ main(void) */ if (!kname) { - kname = PATH_BOOT3; + kname = PATH_LOADER; if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; Modified: stable/10/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- stable/10/sys/boot/powerpc/boot1.chrp/boot1.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/powerpc/boot1.chrp/boot1.c Tue Feb 9 22:32:24 2016 (r295453) @@ -23,8 +23,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define _PATH_LOADER "/boot/loader" -#define _PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" #define BSIZEMAX 16384 @@ -396,7 +395,7 @@ main(int ac, char **av) char bootpath_full[255]; int i, len; - path = _PATH_LOADER; + path = PATH_LOADER; for (i = 0; i < ac; i++) { switch (av[i][0]) { case '-': Modified: stable/10/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/sparc64/boot1/boot1.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/sparc64/boot1/boot1.c Tue Feb 9 22:32:24 2016 (r295453) @@ -24,8 +24,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define _PATH_LOADER "/boot/loader" -#define _PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" + #define READ_BUF_SIZE 8192 typedef int putc_func_t(char c, void *arg); @@ -324,7 +324,7 @@ main(int ac, char **av) const char *path; int i; - path = _PATH_LOADER; + path = PATH_LOADER; for (i = 0; i < ac; i++) { switch (av[i][0]) { case '-':