From owner-svn-src-all@freebsd.org Sun Nov 22 20:38:52 2015 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 45226A2E84F; Sun, 22 Nov 2015 20:38:52 +0000 (UTC) (envelope-from ian@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 E93D019C9; Sun, 22 Nov 2015 20:38:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAMKcoUe066062; Sun, 22 Nov 2015 20:38:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAMKcoWk066061; Sun, 22 Nov 2015 20:38:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201511222038.tAMKcoWk066061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 22 Nov 2015 20:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291164 - head/sys/boot/uboot/common X-SVN-Group: head 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: Sun, 22 Nov 2015 20:38:52 -0000 Author: ian Date: Sun Nov 22 20:38:50 2015 New Revision: 291164 URL: https://svnweb.freebsd.org/changeset/base/291164 Log: Print more detailed info about the disk and partition chosen for booting. No behavioral changes, just cosmetics. A partition number of zero is not a wildcard, it's the 'a' partition in a BSD slice, so don't print it as "". (Only slices are 1-based, unit and partition numbers are 0-based and -1 is their wildcard marker.) Also, after doing all the probing and choosing, print the final result as "Booting from " where disk spec has all the wildcards resolved and looks like familiar BSD slice-and-partition notation (disk0s3a, etc). Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Sun Nov 22 17:03:38 2015 (r291163) +++ head/sys/boot/uboot/common/main.c Sun Nov 22 20:38:50 2015 (r291164) @@ -315,7 +315,7 @@ print_disk_probe_info() else strcpy(slice, ""); - if (currdev.d_disk.partition > 0) + if (currdev.d_disk.partition >= 0) sprintf(partition, "%d", currdev.d_disk.partition); else strcpy(partition, ""); @@ -382,7 +382,7 @@ probe_disks(int devidx, int load_type, i printf("\n"); } - printf(" Requested disk type/unit not found\n"); + printf(" Requested disk type/unit/slice/partition not found\n"); return (-1); } @@ -392,7 +392,7 @@ main(void) struct api_signature *sig = NULL; int load_type, load_unit, load_slice, load_partition; int i; - const char * loaderdev; + const char *ldev; /* * If we can't find the magic signature and related info, exit with a @@ -485,10 +485,10 @@ main(void) return (0xbadef1ce); } - env_setenv("currdev", EV_VOLATILE, uboot_fmtdev(&currdev), - uboot_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, uboot_fmtdev(&currdev), - env_noset, env_nounset); + ldev = uboot_fmtdev(&currdev); + env_setenv("currdev", EV_VOLATILE, ldev, uboot_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, ldev, env_noset, env_nounset); + printf("Booting from %s %\n", ldev); setenv("LINES", "24", 1); /* optional */ setenv("prompt", "loader>", 1);