dimanche 14 juin 2020

Réseau: installer des packages en ligne de commande sur NAS QNAP TS-219

J'ai eu besoin d'installer en SSH des binaires supplémentaires sur mon NAS QNAP TS-219

1) il faut télécharger ce logiciel "Entware-ng": http://pkg.entware.net/binaries/other/Entware-ng_0.97.qpkg

2) Puis l'installer manuellement à partir de l'APP Center du NAS en allant selectionner le fichier téléchargé :


Et en suivant les différentes étapes :





3) Sur le NAS, j'ai activé le SSH et j'ai vérifié que le compte "admin" est bien activé (regarder les screenshots pour trouver les bons menus si besoin)




4) Dans mon cas, après connexion en SSH au NAS ne tant qu "admin", j'ai lancé opkg pour vérifier que l'application est bien installé :

[~] # opkg
opkg must have one sub-command argument
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           Install package(s)
        configure         Configure unpacked package(s)
        remove     Remove package(s)
        flag        Flag package(s)
         =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              List files belonging to 
        search     List package providing 
        find            List packages whose name or description matches 
        info [pkg|regexp]       Display all info for 
        status [pkg|regexp]     Display all status for 
        download           Download  to current directory
        compare-versions   
                            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[]             Set verbosity level to .
        --verbosity[=]   Verbosity levels:
                                        0 errors only
                                        1 normal messages (default)
                                        2 informative messages
                                        3 debug
                                        4 debug level 2
        -f           Use  as the opkg configuration file
        --conf 
        --cache      Use a package cache
        -d           Use  as the the root directory for
        --dest       package installation, removal, upgrading.
                                 should be a defined dest name from
                                the configuration file, (but can also be a
                                directory name in a pinch).
        -o                 Use  as the root directory for
        --offline-root     offline installation of packages.
        --add-arch :        Register architecture with given priority
        --add-dest :        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*'


5) Et pour finir, voici ce que j'ai pu installer/tester pour mes besoins (git, make, gcc, etc...):

[~] # opkg install make
Installing make (4.2.1-2) to root...
Downloading http://pkg.entware.net/binaries/armv5/make_4.2.1-2_armv5soft.ipk
Configuring make.
[~] # make
make: *** No targets specified and no makefile found.  Stop.


[~] # opkg install git
Installing git (2.15.1-1) to root...
Downloading http://pkg.entware.net/binaries/armv5/git_2.15.1-1_armv5soft.ipk
Installing libopenssl (1.0.2n-1) to root...
Downloading http://pkg.entware.net/binaries/armv5/libopenssl_1.0.2n-1_armv5soft.ipk
Installing zlib (1.2.11-1) to root...
Downloading http://pkg.entware.net/binaries/armv5/zlib_1.2.11-1_armv5soft.ipk
Configuring zlib.
Configuring libopenssl.
configuring git.
[~] # git
usage: git [--version] [--help] [-C ] [-c name=value]
           [--exec-path[=]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=] [--work-tree=] [--namespace=]
            []

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add        Add file contents to the index
   mv         Move or rename a file, a directory, or a symlink
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect     Use binary search to find the commit that introduced a bug
   grep       Print lines matching a pattern
   log        Show commit logs
   show       Show various types of objects
   status     Show the working tree status

grow, mark and tweak your common history
   branch     List, create, or delete branches
   checkout   Switch branches or restore working tree files
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   merge      Join two or more development histories together
   rebase     Reapply commits on top of another base tip
   tag        Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch      Download objects and refs from another repository
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help ' or 'git help '
to read about a specific subcommand or concept.
[~] #

[~] # opkg install gcc
Installing gcc (6.3.0-1a) to root...
Downloading http://pkg.entware.net/binaries/armv5/gcc_6.3.0-1a_armv5soft.ipk
Installing binutils (2.27-1) to root...
Downloading http://pkg.entware.net/binaries/armv5/binutils_2.27-1_armv5soft.ipk
Installing objdump (2.27-1) to root...
Downloading http://pkg.entware.net/binaries/armv5/objdump_2.27-1_armv5soft.ipk
Installing libopcodes (2.27-1) to root...
Downloading http://pkg.entware.net/binaries/armv5/libopcodes_2.27-1_armv5soft.ipk
Installing libbfd (2.27-1) to root...
Downloading http://pkg.entware.net/binaries/armv5/libbfd_2.27-1_armv5soft.ipk
Installing libiconv-full (1.11.1-3) to root...
Downloading http://pkg.entware.net/binaries/armv5/libiconv-full_1.11.1-3_armv5soft.ipk
Installing libintl-full (0.19.8.1-1) to root...
Downloading http://pkg.entware.net/binaries/armv5/libintl-full_0.19.8.1-1_armv5soft.ipk
Installing ar (2.27-1) to root...
Downloading http://pkg.entware.net/binaries/armv5/ar_2.27-1_armv5soft.ipk
Configuring libiconv-full.
Configuring libintl-full.
Configuring libbfd.
Configuring libopcodes.
Configuring objdump.
Configuring ar.
Configuring binutils.
Configuring gcc.
[~] # gcc
/share/MD0_DATA/.qpkg/Entware-ng/bin/../lib/gcc/arm-openwrt-linux-gnueabi/6.3.0/crt1.o: In function `_start':
(.text+0x34): undefined reference to `main'
collect2: error: ld returned 1 exit status

Super !!! maintenant mon OS BusyBox de mon NAS QNAP va pouvoir faire pleins de choses en plus ;-)

Enjoy !


Aucun commentaire :

Enregistrer un commentaire