svn commit: r291164 - head/sys/boot/uboot/common
Ian Lepore
ian at FreeBSD.org
Sun Nov 22 20:38:52 UTC 2015
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 "<auto>". (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 <disk spec>" 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, "<auto>");
- if (currdev.d_disk.partition > 0)
+ if (currdev.d_disk.partition >= 0)
sprintf(partition, "%d", currdev.d_disk.partition);
else
strcpy(partition, "<auto>");
@@ -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);
More information about the svn-src-all
mailing list