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

OpenRT firmware update proc

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

Share

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

1 scope of use

This document is suitable for technicians who analyze problems related to OpenRT core network routers.

2 firmware update requirements

OpenRT system includes many components, such as system image, configuration file, Web page, kernel module, business APP and so on. The system update operation may involve multiple parts and multiple components need to be updated. This puts forward high requirements for the maintenance personnel of OpenRT and increases the maintenance cost. Therefore, it is necessary to design a convenient and concise system firmware upgrade process, simplify the OpenRT maintenance process, reduce the threshold of use, and improve the competitiveness of the OpenRT core network routing system.

3 firmware update scheme

3.1 basic ideas

Because the OpenRT system contains multiple components, all the latest components are packaged and transferred to the system background through a Web page as a single file. After unpacking, execute the corresponding script in the package to replace the components in order to achieve the purpose of updating the OpenRT system as a whole.

3.2 Web file transfer

OpenRT uses goAhead as the Web server, and goAhead itself has the function of file transfer. The front-end design needs to add an input whose type attribute is file in the form to realize the function of transmitting the updated firmware package to the background.

3.3 firmware package update proc

The firmware update package is a tar.gz package that contains the latest version of each component of OpenRT and an update script update.sh. After the OpenRT backend successfully obtains the firmware update package, the update flag file updating.flg is created, indicating that the new version has been obtained and needs to be updated in a timely manner. After decompressing the package, replace the internal components of the system by update.sh and restart, to achieve the overall update of the system, the detailed process is shown in figure 3.1.

The update package processing process may be interrupted due to unexpected conditions such as a system power outage, resulting in errors in system updates. Therefore, it is necessary to carry out update detection every time it is turned on, mainly to detect whether there is an update flag file updating.flg. If you find that this file indicates that the last update operation was interrupted unexpectedly, you need to re-execute update.sh to complete the update process. The detailed process is shown in figure 3.2.

3.4 Update script example

OpenRT involves many functions, and the content of each update is very different. New components may be involved and a new directory structure needs to be added. It may also involve new configuration files, etc. Therefore, we need to design the update script update.sh according to the specific content of each update. The basic function of the script is to replace, add, and delete components in the OpenRT file system, as shown in listing 3.1 of the program.

Listing 3.1 update.sh example

Echo "updating firmware..." # # dhcpserver#rm / etc/dhcpdconfig.inicp. / dhcpserver/dhcpdconfig.ini / etcrm_tool-r / var/dhcpleasemkdir / var/dhcpleasecp. / dhcpserver/dhcpd.leases / var/dhcpleaserm_tool-r / apps/dhcpservermkdir / apps/dhcpservercp. / dhcpserver/dhcpserver / apps/dhcpserver # # goahead#rm_tool-r / apps/goaheadmkdir / apps/goaheadcp. / goahead/route.txt / apps/goaheadcp. / goahead/goahead / apps/goaheadcp. / goahead/gopass / apps/goaheadcp. / goahead/webcomp / apps/goaheadcp . / goahead/auth.txt / apps/goaheadrm / lib/libgoahead.socp. / goahead/libgoahead.so / lib## OpenRTCfgTool#rm_tool-r / apps/OpenRTCfgTool/OpenRTCfgToolmkdir / apps/OpenRTCfgToolcp. / OpenRTCfgTool/OpenRTCfgTool / apps/OpenRTCfgTool## libcomm#rm / lib/libcomm.socp . / libcomm/libcomm.so / lib## libnethandle#rm / lib/libnethandle.socp. / libnethandle/libnethandle.so / lib## tmstat#rm / lib/modules/trafficStats.kocp. / tmstat/trafficStats.ko / lib/modules## web#untar. / web.tar.gz / apps/goahead## startup#rm / etc/startup.shcp. / startup.sh / etc/## bsp#rm / boot/grldrrm / boot/menu.lstrm / boot/OpenRT-bsp.elfcp. / bsp/grldr / bootcp . / bsp/menu.lst / bootcp. / bsp/OpenRT-bsp.elf / bootecho "update finish."

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