Asus RT-AC68U: Instalación de Entware en firmware Merlin

Introducción

Entware es un repositorio de software que nos va a permitir la instalación de diferentes programas en nuestro router. Puede echar un vistazo a sus repositorio en el siguiente enlace

La instalación la realizare sobre un router con firmware Merlin, ya que este proporciona un script de instalación para Entware que facilita mucho la labor, en caso de que no tengas instalado Merlin puedes seguir las instrucciones que facilitan en el siguiente enlace https://github.com/Entware/Entware/wiki/Install-on-Asus-stock-firmware

Requisitos

  • Es necesario tener conectado un disco USB en el router formateado con ext2 o ext3
  • Si has instalado Download Manager, debes de desinstalarlo y reiniciar el router

Instalación

Deberemos acceder mediante SSH al router, la instalación es muy sencilla, basta con ejecutar el sccript entware-setup.sh

user@RT-AC68U-E358:/tmp/home/root# entware-setup.sh

 Info:  This script will guide you through the Entware installation.

 Info:  Script modifies "entware" folder only on the chosen drive,

 Info:  no other data will be changed. Existing installation will be

 Info:  replaced with this one. Also some start scripts will be installed,

 Info:  the old ones will be saved on Entware partition with name

 Info:  like /tmp/mnt/sda1/jffs_scripts_backup.tgz

En el caso de tener varios dispositivos discos USB conectados al router, nos preguntara en cual de los dos vamos a realizar la instalación de Enteware

​ Info:  Looking for available partitions...

    [1] --> /tmp/mnt/8GB

    [2] --> /tmp/mnt/NAS01

     =>  Please enter partition number or 0 to exit

    [0-2]: 1

     Info:  /tmp/mnt/8GB selected.

Después de seleccionar el disco comenzará la instalación y descarga de los paquetes necesarios

     * Warning:  Found previous installation, saving...

     Info:  Creating /tmp/mnt/8GB/entware folder...

     * Warning:  Deleting old /tmp/opt symlink...

     Info:  Creating /tmp/opt symlink...

     Info:  Creating /jffs scripts backup...

    tar: removing leading '/' from member names

     Info:  Modifying start scripts...

    Info: Checking for prerequisites and creating folders...

    Warning: Folder /opt exists!

    Info: Opkg package manager deployment...

    --2018-10-06 19:31:45--  http://bin.entware.net/armv7sf-k2.6/installer/opkg

    Resolving bin.entware.net... 81.4.123.217

    Connecting to bin.entware.net|81.4.123.217|:80... connected.

    HTTP request sent, awaiting response... 200 OK

    Length: 130968 (128K) [application/octet-stream]

    Saving to: '/opt/bin/opkg'

​/opt/bin/opkg                100%[=============================================>] 127.90K  --.-KB/s    in 0.1s



    2018-10-06 19:31:45 (1.06 MB/s) - '/opt/bin/opkg' saved [130968/130968]

​...........

    Installing libstdcpp (7.3.0-8) to root...

    Downloading http://bin.entware.net/armv7sf-k2.6/libstdcpp_7.3.0-8_armv7-2.6.ipk

    Installing entware-release (1.0-2) to root...

    ......
    ......

    Configuring libgcc.

    Configuring libc.

    Configuring libssp.

    ......
    ......

    Configuring entware-opt.

    Info: Congratulations!

    Info: If there are no errors above then Entware was successfully initialized.

    Info: Add /opt/bin & /opt/sbin to your PATH variable

    Info: Add '/opt/etc/init.d/rc.unslung start' to startup script for Entware services to start

    Info: Found a Bug? Please report at https://github.com/Entware/Entware/issues

    user@RT-AC68U-E358:/tmp/home/root#

Con esto ya hemos terminado, veamos como empezar a utilizar Entware.

Uso

La herramienta para manejar los paquetes en Entware es opkg. Te dejo unos ejemplos de su uso:

  • opkg list lista todos los paquetes disponibles para instalar
  • opkg install nombre_software instala el paquete nombre_software
  • opkg remove software_name borra el paquete nombre_software

También te dejo todas sus opciones de uso

usage: opkg [options...] sub-command [arguments...]
where sub-command is one of:

Package Manipulation:
        update                  Update list of available packages
        upgrade                 Upgrade installed packages
        install <pkgs>          Install package(s)
        configure <pkgs>        Configure unpacked package(s)
        remove <pkgs|regexp>    Remove package(s)
        flag <flag> <pkgs>      Flag package(s)
         <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation)

Informational Commands:
        list                    List available packages
        list-installed          List installed packages
        list-upgradable         List installed and upgradable packages
        list-changed-conffiles  List user modified configuration files
        files <pkg>             List files belonging to <pkg>
        search <file|regexp>    List package providing <file>
        find <regexp>           List packages whose name or description matches <regexp>
        info [pkg|regexp]       Display all info for <pkg>
        status [pkg|regexp]     Display all status for <pkg>
        download <pkg>          Download <pkg> to current directory
        compare-versions <v1> <op> <v2>
                            compare versions using <= < > >= = << >>
        print-architecture      List installable package architectures
        depends [-A] [pkgname|pat]+
        whatdepends [-A] [pkgname|pat]+
        whatdependsrec [-A] [pkgname|pat]+
        whatrecommends[-A] [pkgname|pat]+
        whatsuggests[-A] [pkgname|pat]+
        whatprovides [-A] [pkgname|pat]+
        whatconflicts [-A] [pkgname|pat]+
        whatreplaces [-A] [pkgname|pat]+

Options:
        -A                      Query all packages not just those installed
        -V[<level>]             Set verbosity level to <level>.
        --verbosity[=<level>]   Verbosity levels:
                                        0 errors only
                                        1 normal messages (default)
                                        2 informative messages
                                        3 debug
                                        4 debug level 2
        -f <conf_file>          Use <conf_file> as the opkg configuration file
        --conf <conf_file>
        --cache <directory>     Use a package cache
        -d <dest_name>          Use <dest_name> as the the root directory for
        --dest <dest_name>      package installation, removal, upgrading.
                                <dest_name> should be a defined dest name from
                                the configuration file, (but can also be a
                                directory name in a pinch).
        -o <dir>                Use <dir> as the root directory for
        --offline-root <dir>    offline installation of packages.
        --add-arch <arch>:<prio>        Register architecture with given priority
        --add-dest <name>:<path>        Register destination with given path

Force Options:
        --force-depends         Install/remove despite failed dependencies
        --force-maintainer      Overwrite preexisting config files
        --force-reinstall       Reinstall package(s)
        --force-overwrite       Overwrite files from other package(s)
        --force-downgrade       Allow opkg to downgrade packages
        --force-space           Disable free space checks
        --force-postinstall     Run postinstall scripts even in offline mode
        --force-remove  Remove package even if prerm script fails
        --force-checksum        Don't fail on checksum mismatches
        --noaction              No action -- test only
        --download-only No action -- download only
        --nodeps                Do not follow dependencies
        --nocase                Perform case insensitive pattern matching
        --size                  Print package size when listing available packages
        --force-removal-of-dependent-packages
                                Remove package and all dependencies
        --autoremove            Remove packages that were installed
                                automatically to satisfy dependencies
        -t                      Specify tmp-dir.
        --tmp-dir               Specify tmp-dir.
        -l                      Specify lists-dir.
        --lists-dir             Specify lists-dir.

 regexp could be something like 'pkgname*' '*file*' or similar
 e.g. opkg info 'libstd*' or opkg search '*libop*' or opkg remove 'libncur*'

Referencia: