Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Based on mips chip, how to cross-compile htop on openwrt platform

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "based on mips chip, openwrt platform how to cross-compile htop", the content is easy to understand, clear, hope to help you solve your doubts, the following let Xiaobian lead you to study and learn "based on mips chip, openwrt platform how to cross-compile htop" this article.

1.1 background

Top under the Openwrt platform has been very obsolete, does not support top-H to view the status of threads in the process, does not support viewing the information of each child thread of the process, so today take a little time to port htop tools to openwrt, for optimizing code, monitoring resources play a great role, htop + strace can also track system calls.

1.2 download the source code

Http://hisham.hm/htop/index.php?page=downloads

Open the above link and git clone to the local area.

Git clone https://github.com/hishamhm/htop

1.3 modify permissions and configuration

Chmod 777 htop/*-R

Go to the htop directory, execute. / autogen.sh, and generate the .configure file

1.4 configure compilation options

In the process of compiling openwrt, the htop dependent libncursesw.so.5.9 library has been generated, find the path directly, and add the compilation option.

Configure, specify the path to the libncurses library and header file, and the compiler

CFLAGS= "- I/home/xxx/hdl/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include" LIBS= "- L/home/xxx/hdl/openwrt/staging_dir/target-mipsel_24kc_musl/usr/lib-lncursesw-lncurses". / configure-- host=mipsel-openwrt-linux-musl CC=mipsel-openwrt-linux-musl-gcc-- prefix=/home/xxx/hdl/lib/htop

1.5 make & & make install

The generated executable file is under the directory specified by prefix==/home/xxx/hdl/lib/htop. The executable program compiled by htop can be executed on the mips platform by using file htop.

Download it to a system with openwrt and execute it on mips platform with scp or winscp tools.

The htop program is placed under the / bin/ directory

Download the libncurses.so.5.9 that htop depends on to the / usr/lib/ directory and make a software link

Terminfo has been generated in the process of ln-s libncurses.so.5.9 libncurses.so.5 compiling the opwnert system. You can find the terminfo,find xxx directory-iname terminfo

When the htop tool is executed, it will rely on this. Use the scp or winscp tool to copy it to the mips platform with openwrt system, and store the directory / usr/share.

1.7 execution effect, some advanced usage to find online tutorials on their own

Press "s" to specify the corresponding thread and enter the system tracking call to view

The above is all the contents of the article "how to cross-compile htop on the openwrt platform based on mips chips". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report