From 4f6dc91b1539e46f9e69fad6e6bda9bd84f28909 Mon Sep 17 00:00:00 2001 From: Alex Hornung Date: Thu, 26 Nov 2009 14:31:59 +0000 Subject: [PATCH] boot - Improve lsdev (2) * Mark partitions from which it may be possible to load modules with a '*' prefix. * Change loader(8) man page accordingly. Suggested-by: Sascha Wildner --- sys/boot/common/loader.8 | 4 +++- sys/boot/pc32/libi386/biosdisk.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/boot/common/loader.8 b/sys/boot/common/loader.8 index 0e9bc51011..1a592c9baf 100644 --- a/sys/boot/common/loader.8 +++ b/sys/boot/common/loader.8 @@ -246,7 +246,9 @@ If is specified, file sizes will be shown too. .Pp .It Ic lsdev Op Fl v -Lists all of the devices from which it may be possible to load modules. +Lists all devices with known file systems, where a +'*' prefix indicates a device from which it may be +possible to load modules. If .Fl v is specified, more details are printed. diff --git a/sys/boot/pc32/libi386/biosdisk.c b/sys/boot/pc32/libi386/biosdisk.c index 332bf2d945..8e47f3fc34 100644 --- a/sys/boot/pc32/libi386/biosdisk.c +++ b/sys/boot/pc32/libi386/biosdisk.c @@ -391,7 +391,10 @@ print_partition(u_int8_t fstype, unsigned long long offset, /* Only print out statistics in verbose mode */ if (verbose) { - sprintf(line, " %s%c: %s %.6lluMB (%llu - %llu)\n", + sprintf(line, "%c %s%c: %s %.6lluMB (%llu - %llu)\n", + /* prefix disks that can be used to load modules with '*' */ + ((fstype == FS_BSDFFS) || (fstype == FS_UNUSED) || + (fstype == FS_VINUM)) ? '*' : ' ', prefix, 'a' + i, (fstype == FS_SWAP) ? "swap" : (fstype == FS_VINUM) ? "vinum" : @@ -404,7 +407,11 @@ print_partition(u_int8_t fstype, unsigned long long offset, offset, offset + size); } else { - sprintf(line, " %s%c: %s\n", prefix, 'a' + i, + sprintf(line, "%c %s%c: %s\n", + /* prefix disks that can be used to load modules with '*' */ + ((fstype == FS_BSDFFS) || (fstype == FS_UNUSED) || + (fstype == FS_VINUM)) ? '*' : ' ', + prefix, 'a' + i, (fstype == FS_SWAP) ? "swap" : (fstype == FS_VINUM) ? "vinum" : (fstype == FS_HAMMER) ? "HAMMER" : -- 2.41.0