changeset 19424:f1c9ab245adb

12256 reboot(1m) looks for 32-bit kernel only Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Alexander Pyhalov <alp@sfedu.ru> Reviewed by: C Fraire <seeemef@mac.com> Approved by: Dan McDonald <danmcd@joyent.com>
author Marcel Telka <marcel@telka.sk>
date Wed, 29 Jan 2020 06:55:18 +0100
parents c5d675ef85e3
children d07ea35a3ffd
files usr/src/cmd/halt/halt.c
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/halt/halt.c	Thu Dec 26 09:23:25 2019 +0200
+++ b/usr/src/cmd/halt/halt.c	Wed Jan 29 06:55:18 2020 +0100
@@ -645,6 +645,19 @@
 	if (rc != 0)
 		return (rc);
 
+	/*
+	 * Check for the usual case: 64-bit kernel
+	 */
+	(void) snprintf(kernpath, MAXPATHLEN,
+	    "%s/platform/i86pc/kernel/amd64/unix", mountpoint);
+	if (stat64(kernpath, &statbuf) == 0)
+		return (0);
+
+	/*
+	 * We no longer build 32-bit kernel but in a case we are trying to boot
+	 * some ancient filesystem with 32-bit only kernel we should be able to
+	 * proceed too
+	 */
 	(void) snprintf(kernpath, MAXPATHLEN, "%s/platform/i86pc/kernel/unix",
 	    mountpoint);
 
@@ -1150,7 +1163,7 @@
 	} else if (mplen != 0) {
 		/*
 		 * No unix argument, but mountpoint is not empty, use
-		 * /platform/i86pc/$ISADIR/kernel/unix as default.
+		 * /platform/i86pc/kernel/$ISADIR/unix as default.
 		 */
 		char isa[20];