Solved freebsd 13.0 top battery: -1%

Hello.
I installed freebsd 13.0, in the utility top I see the parameter battery: -1%.
I have a server, not a laptop.
How do I remove parameter the battery: -1% from the system?
 
Note:
$ run as a normal user, esp. for Git
# run as root

I. Install Git
# pkg install devel/git

II. Setup the Git
$ git config --global user.name "USERNAME"
$ git config --global user.email USERNAME@HOST
$ git config --global pull.rebase true
$ git config --global fetch.prune true
$ git config --global diff.colorMoved

III. Fetch the src
# cd /usr

Generally you have "/usr/src", but if not:
# mkdir src

# chgrp wheel src
# chmod 775 src
$ git clone -o freebsd https://git.FreeBSD.org/src.git /usr/src

IV. Edit the top.c and Comment out the "i_battery"
# cd /usr/src/usr.bin/top
# vi /usr/src/usr.bin/top/top.c

Comment this out:
Code:
i_battery(statics.nbatteries, system_info.battery);

The result:
Code:
/* i_battery(statics.nbatteries, system_info.battery); */

V. Compile
# make clean
# make obj
# make depend
# make
# make install

VI. Lucky6
Now you have new top(1). Of course next src and/or base update will screw this establishment, but that's another story, i.e. "how to keep your local patches".
 
Back
Top