10933 loader: Make lsdev -v output line up in neat columns

Review Request #1829 - Created May 9, 2019 and submitted

Information
Toomas Soome
illumos-gate
10933
cb206b1...
Reviewers
general
FreeBSD updates:

r344239
Use a couple local variables to avoid repetitive long expressions that
cause line-wrapping.

r344240
Make lsdev -v output line up in neat columns by using a fixed width for
the size field and a tab between the partition type and the size.

Changes this

  disk devices:
        disk0 (MMC)
        disk0s1: DOS/Windows            49MB
        disk0s2: FreeBSD                14GB
        disk0s2a: FreeBSD UFS         14GB
        disk0s2b: Unknown             2048KB
        disk0s2d: FreeBSD UFS         2040KB

to this

  disk devices:
        disk0 (MMC)
        disk0s1: DOS/Windows      49MB
        disk0s2: FreeBSD          14GB
        disk0s2a: FreeBSD UFS     14GB
        disk0s2b: Unknown       2048KB
        disk0s2d: FreeBSD UFS   2040KB

r344241
Garbage collection no-longer-used constant.

r347389
loader: ptable_print() needs two tabs sometimes

Since the partition/slice names do vary in length, check the length
of the fixed part of the line against 3 * 8, if the lenth is less than
3 tab stops, print out extra tab.

use snprintf() instead of sprintf.

  
Andy Fiddaman
Gergő Mihály Doma
Toomas Soome
Review request changed

Status: Closed (submitted)

Loading...