Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Oct 2019 03:21:30 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r353991 - in stable/12: stand/common stand/efi/loader sys/kern sys/sys
Message-ID:  <201910240321.x9O3LUTP015733@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Thu Oct 24 03:21:30 2019
New Revision: 353991
URL: https://svnweb.freebsd.org/changeset/base/353991

Log:
  MFC r349343: Use a common kernel path between loader and kernel

Modified:
  stable/12/stand/common/paths.h
  stable/12/stand/efi/loader/main.c
  stable/12/sys/kern/kern_mib.c
  stable/12/sys/sys/boot.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/stand/common/paths.h
==============================================================================
--- stable/12/stand/common/paths.h	Thu Oct 24 03:20:27 2019	(r353990)
+++ stable/12/stand/common/paths.h	Thu Oct 24 03:21:30 2019	(r353991)
@@ -29,11 +29,14 @@
 #ifndef _PATHS_H_
 #define	_PATHS_H_
 
+#include <sys/boot.h>	/* To get kernel path */
+
 #define PATH_DOTCONFIG	"/boot.config"
 #define PATH_CONFIG	"/boot/config"
 #define PATH_LOADER	"/boot/loader"
 #define PATH_LOADER_EFI	"/boot/loader.efi"
 #define PATH_LOADER_ZFS	"/boot/zfsloader"
-#define PATH_KERNEL	"/boot/kernel/kernel"
+#define PATH_LOADER_CONF "/boot/loader.conf"
+#define PATH_DEFAULTS_LOADER_CONF "/boot/defaults/loader.conf"
 
 #endif /* _PATHS_H_ */

Modified: stable/12/stand/efi/loader/main.c
==============================================================================
--- stable/12/stand/efi/loader/main.c	Thu Oct 24 03:20:27 2019	(r353990)
+++ stable/12/stand/efi/loader/main.c	Thu Oct 24 03:21:30 2019	(r353991)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/param.h>
 #include <sys/reboot.h>
 #include <sys/boot.h>
+#include <paths.h>
 #include <stdint.h>
 #include <string.h>
 #include <setjmp.h>
@@ -237,8 +238,8 @@ sanity_check_currdev(void)
 {
 	struct stat st;
 
-	return (stat("/boot/defaults/loader.conf", &st) == 0 ||
-	    stat("/boot/kernel/kernel", &st) == 0);
+	return (stat(PATH_DEFAULTS_LOADER_CONF, &st) == 0 ||
+	    stat(PATH_KERNEL, &st) == 0);
 }
 
 #ifdef EFI_ZFS_BOOT

Modified: stable/12/sys/kern/kern_mib.c
==============================================================================
--- stable/12/sys/kern/kern_mib.c	Thu Oct 24 03:20:27 2019	(r353990)
+++ stable/12/sys/kern/kern_mib.c	Thu Oct 24 03:21:30 2019	(r353991)
@@ -136,7 +136,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_R
     SYSCTL_NULL_INT_PTR, 0, "Whether saved set-group/user ID is available");
 #endif
 
-char kernelname[MAXPATHLEN] = "/boot/kernel/kernel";	/* XXX bloat */
+char kernelname[MAXPATHLEN] = PATH_KERNEL;	/* XXX bloat */
 
 SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE,
     kernelname, sizeof kernelname, "Name of kernel file booted");

Modified: stable/12/sys/sys/boot.h
==============================================================================
--- stable/12/sys/sys/boot.h	Thu Oct 24 03:20:27 2019	(r353990)
+++ stable/12/sys/sys/boot.h	Thu Oct 24 03:21:30 2019	(r353991)
@@ -32,6 +32,8 @@
 #ifndef _SYS_BOOT_H_
 #define _SYS_BOOT_H_
 
+#define PATH_KERNEL	"/boot/kernel/kernel"
+
 int boot_env_to_howto(void);
 void boot_howto_to_env(int howto);
 int boot_parse_arg(char *v);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910240321.x9O3LUTP015733>