Skip to content

Latest commit

 

History

History
336 lines (197 loc) · 11.3 KB

How_to_Use_en-US.md

File metadata and controls

336 lines (197 loc) · 11.3 KB

SCRIPTS BOOTLOADER FOR ASUS ROUTER MANUAL

中文 | English

Requisite Firmware

  • Asuswrt: The stock firmware for ASUS Routers.
  • Asuswrt-Merlin: The internationally renowned 3rd-party firmware for ASUS Routers.

CAVEAT: NO COMPLIANCE FOR OTHER FIRMWARE GUARANTEED.

Notice

  1. Make sure your username and password which are used to log into the web GUI contain ONLY characters within the range of underline, numbers and lower-case and upper-case letters.

Installation (Online)

LEGEND

  1. White characters with purple background: notice of stage.
  2. White characters with green background: notice of success.
  3. White characters with red background: notice of failure.
    • The line above the notice of failure will show the name of script which runs into error and relevant details.
  1. Insert a USB flash drive (not less than 4GB; MBR) with no files into a USB port of the Router.

  2. Login the router with ssh client.

  3. Execute the code below.

    cd /tmp && wget -q -O /tmp/install_online --no-check-certificate "https://raw.githubusercontent.com/JACK-THINK/SCRIPTS-BOOTLOADER-FOR-ASUS-ROUTER/master/script_bootloader/bin/install_online" && chmod 777 /tmp/install_online && /tmp/install_online

  4. Read the WARNING, and input YES to continue the installation.

  5. Demonstration of the installation process:

    • Re-partition and format the USB flash drive.

    • Download files for installation.

    • Create log of installation.

    • STAGE 1: Set boot parameters.

    • STAGE 2: Install the requisite components.

      • Input and confirm the size of swap (512M is adopted in this example), and then install and enable component swap.

      • Install and enable component entware.

      • Install and enable component timezone.

      • Install and enable component dependency.

        It's OK even if some caveats show up on the screen.

      • Install and enable component monit.

      • Install and enable component dnsmasq.d.

      • Install component fwd.

      • STAGE 2 is completed.

    • STAGE 3: Install the optional components (the add-ons).

      • Input and confirm your username and password which are used to log into the web GUI. (This is only executed when you first run addons_install)

      • Input the index number of the favored add-on according to the menu.

      • When the previous add-on has been installed successfully, install the next add-on.

      • Input 0 to exit the installation and reboot the router after all the favored add-ons are installed.

Installation (Offline)

  1. Insert a USB flash drive (not less than 4GB; MBR) with no files into a USB port of the Router.

  2. Login the router with ssh client.

  3. Download the latest installation package from here and upload it to /tmp/home/root of the router.

  4. Execute the code below to unzip the installation package.

    cd /tmp/home/root
    tar -xzvf SCRIPTS-BOOTLOADER-FOR-ASUS-ROUTER*.tar.gz
    rm -f SCRIPTS-BOOTLOADER-FOR-ASUS-ROUTER*.tar.gz
  5. Execute the code below to move the files and change their rights.

    mv SCRIPTS-BOOTLOADER-FOR-ASUS-ROUTER*/script_bootloader ./
    rm -rf SCRIPTS-BOOTLOADER-FOR-ASUS-ROUTER*
    chmod -R 777 script_bootloader
    cp script_bootloader/bin/prerequisite_checker /tmp
    cp script_bootloader/bin/drive_modifier /tmp
    cd /tmp
  6. Execute the code below to check the environment. Everything goes well if the output is nothing.

    /tmp/prerequisite_checker
  7. Execute the code below to re-partition and format the USB flash drive.

    /tmp/drive_modifier
  8. Execute the code below to move the files.

    mv /tmp/home/root/script_bootloader /tmp/mnt/ASUS_ROUTER
  9. (Optional) If you need to install specific version of Entware offline or have no plan to update or upgrade packages from it in the future, download the Entware offline repository from here and upload it to /tmp/mnt/ASUS_ROUTER/script_bootloader/usr/entware/usr/ of the router.

  10. Execute the code below to start installation.

/tmp/mnt/ASUS_ROUTER/script_bootloader/bin/install
  1. (Optional) If command tee doesn't exist in the firmware, installation will come to an end after outputing ***** STAGE 3: INSTALL ADDONS *****. Execute the code below to install add-ons. (After installation of SCRIPTS BOOTLOADER FOR ASUS ROUTER, you can still execute this code to install other add-ons.)
/tmp/mnt/ASUS_ROUTER/script_bootloader/bin/addons_install
  1. Execute the code below to reboot the router after all the favored add-ons are installed.
/tmp/sbl_restart_router

Modification to source files

Modify the source files of the target add-on according to the README_en-US.md in its own directory in /opt/script_bootloader/usr/.

NOTICE

  • LF needs to be set in Windows before you edit the source files. Otherwise the files will be damaged.
  • NO extra setting is required in Linux before you edit the source files.

Enable/Disable add-ons

Add-on Management system is composed of 2 parts below.

Add-on Management system Type of add-ons Instruction
list_of_user_custom_scripts Add-ons which run at startup with no surveillance required Read the instruction below.
Monit All add-ons except the type listed above Click to read
  1. Login the router with ssh client.

  2. Execute the code below to edit list_of_user_custom_scripts.

    vim /opt/script_bootloader/bin/list_of_user_custom_scripts

  3. Enable/Disable the target add-ons.

    • Enable add-ons: Remove the # at the start of the path to target add-ons.
    • Disableadd-ons: Insert a # at the start of the path to target add-ons.

  4. Save and exit.

    <ESC>→<:>→<w>→<q>→<Enter>

  5. Execute the code below to reboot the router and all the favored add-ons will boot along with the router.

    cd /tmp && /tmp/sbl_restart_router

Update (Online)

  1. Login the router with ssh client.

  2. Execute the code below to update the system.

    cd /tmp && /tmp/mnt/ASUS_ROUTER/script_bootloader/bin/update

Upgrade (Online)

When new version of Entware is released, execute upgrade, which could preserve all the files in directory /tmp/mnt/ASUS_ROUTER/home and reinstall the system.

  1. Login the router with ssh client.

  2. Execute the code below to upgrade the system.

    cd /tmp && /tmp/sbl_upgrade

  3. Execute the code below after restart.

    cp -f "/tmp/mnt/ASUS_ROUTER/script_bootloader/bin/upgrade" "/tmp/sbl_upgrade" && cd "/tmp" && "/tmp/sbl_upgrade"

  4. Following steps are same with those in section Installation (Online).

Upgrade (Offline)

When new version of Entware is released, execute upgrade, which could preserve all the files in directory /tmp/mnt/ASUS_ROUTER/home and reinstall the system.

  1. Login the router with ssh client.

  2. Download the latest upgrade package from here and upload it to /tmp/mnt/ASUS_ROUTER/home/root of the router.

  3. Following steps are same with those in section Upgrade (Online).

Uninstallation

  1. Login the router with ssh client.

  2. Execute the code below to uninstall the system.

    cd /tmp && /tmp/sbl_uninstall

Restoration

  1. Login the router with ssh client.

  2. Execute the code below to restore the system.

    cp -f /tmp/mnt/ASUS_ROUTER/script_bootloader/bin/restore /tmp && cd /tmp && /tmp/restore

Reinstallation or Upgradation

  1. Uninstall the system.

  2. Installation (Online) the system again.

Upgrade firmware/restore to factory default

  1. Uninstall the system.

  2. Remove all the USB devices from the router after restart.

  3. Upgrade firmware/restore to factory default.

  4. Re-configure the router.

  5. Re-plug ONLY the USB flash drive containing the system to a USB port of the Router.

  6. Restore the system.

  7. Re-plug other USB devices to the router after restart.