Skip to content

Rescue firmware & startup.sh

negan07 edited this page Nov 2, 2021 · 3 revisions

Rescue .img firmware

Since V1.0.1.80 firmware version, debug mode console access activation from web gui and telnetenabled udp magic packet, have been removed for preventive security reasons ( read ), avoiding the possibility of initializing the router for package installations.

The rescue firmware is the vendor .img firmware, recompiled with kernel & flag optimizations and garbage file removals, including: /usr/sbin/rc_app/rc_debug_mode startup service script.

Telnet daemon is activated as default setting.

To prevent eventually further similar security leaks, the telnet daemon can be started only if https router web gui remote login is disabled ( webGUI-->Advanced-->Advanced Setup-->Remote Management ).

To deactivate it permanently (factory reset required to reactivate it), type:

nvram set telnet_enable=0
rc debug_mode stop

To deactivate it temporary (until next reboot), type:

rc debug_mode stop

No remote telnet access is possible because the connection would be not encrypted and unsafe.

Startup.sh initialization script

The startup.sh script must be downloaded into running router at the /etc dir.

See also the documentation inside the script itself.

The script can be executed once and only once and it should be deleted after being run successfully.

It initializes router for package installations, initializing router flash partitions, downloading and installing the essential packages including opkg itself and ancistrus-core .

How to obtain startup.sh script

telnet the router ( login: admin; password: the same set on the web gui interface):

Execute the following console commands:

cd /etc
curl -k -O https://raw.githubusercontent.com/negan07/ancistrus/master/scripts/startup.sh
chmod 755 startup.sh
./startup.sh

Follow the instructions on terminal.

Behaviour

The script acts in this way:

  1. Remove some orphan & duplicate files, static libs and dirs present into the router filesystem to improve free space available for packages.

  2. Download a file called opkg.zip from this repository and extract it on router ram: the opkg.zip archive contains opkg static binary executable and the related config file opkg.conf .

  3. Unmount, erase & mount a router flash partition (one of the unused annex B languages) and initialize it for opkg status & package infos.

  4. Update the repository packages index list.

  5. Install the essential packages including ancistrus-core and opkg itself to flash.

  6. Delete the temporary files from router ram.

  7. The startup.sh script can be deleted after finishing.