2016/06/29(水)Synology DS216j Entware-ng 導入

PC::NAS

Synology DS216j Entware-ng 導入

【追記】Entware-ngとEntware-3xが統合されてEntwareになったようです。詳細はこちら→Synology DS218+ Entware導入 & Subversion導入

Synology DS216j Optware IPKG 導入で、IPKGを入れましたが、今はEntware-ngというパッケージ管理ツールがあるようなので、こちらを導入してみます。

SSHサービス有効化

Synology DS216j Optware IPKG 導入を参照

Entware-ngインストール

Install on Synology NAS · Entware-ng/Entware-ng Wiki · GitHubの内容とほぼ同じです^^;

  1. 適当なSSHクライアントで接続します。
  2. 作業前にroot権限を取っておきます。
    sudo -i
    
  3. 前回導入したIPKGを削除。
    rm /etc/rc.local
    rm /etc/rc.optware
    
    umount /opt
    rm -rf /opt
    rm -rf /volume1/@optware
    
    vi /etc/profile # PATH=/opt/bin:/opt/sbin:$PATH を削除
    
  4. Entware-ng用のディレクトリを作成。
    mkdir -p /volume1/@entware-ng/opt
    
  5. /optディレクトリを削除してシンボリックリンクを作成。
    rm -rf /opt
    ln -sf /volume1/@entware-ng/opt /opt
    
  6. Entware-ngのインストールスクリプトを実行。
    wget -O - http://pkg.entware.net/binaries/armv7/installer/entware_install.sh | /bin/sh
    
    • Marvell ArmadaなのでARMv7版を選択。他のCPUについては前述のリンク先を参照。
  7. /etc/rc.local を(viなどで)開き、以下の記述を追記。
    /bin/ln -sf /volume1/@entware-ng/opt /opt
    /opt/etc/init.d/rc.unslung start
    
    • とあるのですが、さっき削除して存在しないので、新規作成しました。(たぶん、#!/bin/shとchmod 755も必要。)
      echo '#!/bin/sh' >> /etc/rc.local
      echo '/bin/ln -sf /volume1/@entware-ng/opt /opt' >> /etc/rc.local
      echo '/opt/etc/init.d/rc.unslung start' >> /etc/rc.local
      
  8. /root/.profile を(viなどで)開き、以下の記述を追記。
    . /opt/etc/profile
    
  9. NASを再起動。

Entware-ng (opkg) 動作確認

使い方はIPKGとほとんど同じようです。

  1. 作業前にroot権限を取っておきます。
    sudo -i
    
  2. コマンドの存在を確認
    opkg -v
    
    opkg version 0.1.8
    
    • 何もオプションをつけなければコマンドラインヘルプが出てきます。
  3. パッケージリストの更新&パッケージリストの確認
    opkg update
    opkg list
    
    25volt - 1.0.5-1 - 25volt - A lightweight tool for monitoring APC Smart-UPS and Powercom WOW UPSs
    3proxy - 0.8.6-3 - 3proxy is universal proxy server. It can be used to provide internal users with fully controllable access to external resources or to provide external users with access to internal resourc
    以下リストが続く
    
    • Web上にPackages listがあるので、何が含まれているかインストール前に確認したければこちらを。
  4. インストール(試しにgccを)
    opkg install gcc
    
    Installing gcc (5.3.0-3) to root...
    Downloading http://pkg.entware.net/binaries/armv7/gcc_5.3.0-3_armv7soft.ipk.
    Installing binutils (2.25-1) to root...
    Downloading http://pkg.entware.net/binaries/armv7/binutils_2.25-1_armv7soft.ipk.
    Installing objdump (2.25-1) to root...
    Downloading http://pkg.entware.net/binaries/armv7/objdump_2.25-1_armv7soft.ipk.
    Installing libopcodes (2.25-1) to root...
    Downloading http://pkg.entware.net/binaries/armv7/libopcodes_2.25-1_armv7soft.ipk.
    Installing libbfd (2.25-1) to root...
    Downloading http://pkg.entware.net/binaries/armv7/libbfd_2.25-1_armv7soft.ipk.
    Installing zlib (1.2.8-1) to root...
    Downloading http://pkg.entware.net/binaries/armv7/zlib_1.2.8-1_armv7soft.ipk.
    Installing libiconv-full (1.11.1-2) to root...
    Downloading http://pkg.entware.net/binaries/armv7/libiconv-full_1.11.1-2_armv7soft.ipk.
    Installing libintl-full (0.19.6-2) to root...
    Downloading http://pkg.entware.net/binaries/armv7/libintl-full_0.19.6-2_armv7soft.ipk.
    Installing ar (2.25-1) to root...
    Downloading http://pkg.entware.net/binaries/armv7/ar_2.25-1_armv7soft.ipk.
    Configuring zlib.
    Configuring libiconv-full.
    Configuring libintl-full.
    Configuring libbfd.
    Configuring libopcodes.
    Configuring objdump.
    Configuring ar.
    Configuring binutils.
    Configuring gcc.
    
  5. gccがインストールされたことを確認
    gcc -v
    
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/volume1/@entware-ng/opt/bin/../lib/gcc/arm-openwrt-linux-gnueabi/5.3.0/lto-wrapper
    Target: arm-openwrt-linux-gnueabi
    Configured with: /media/ware2/Entware-ng.2016.04/build_dir/target-arm_cortex-a9_glibc-2.23_eabi/gcc-5.3.0/configure --target=arm-openwrt-linux --host=arm-openwrt-linux --build=x86_64-linux-gnu --program-prefix= --program-suffix= --prefix=/opt --exec-prefix=/opt --bindir=/opt/bin --sbindir=/opt/sbin --libexecdir=/opt/lib --sysconfdir=/opt/etc --datadir=/opt/share --localstatedir=/opt/var --mandir=/opt/man --infodir=/opt/info --disable-nls --build=x86_64-linux-gnu --host=arm-openwrt-linux-gnueabi --target=arm-openwrt-linux-gnueabi --enable-languages=c,c++ --with-bugurl=https://dev.openwrt.org/ --with-pkgversion='OpenWrt GCC 5.3.0' --enable-shared --enable-__cxa_atexit --with-default-libstdcxx-abi=gcc4-compatible --enable-target-optspace --with-gnu-ld --with-stage1-ldflags='-Wl,-rpath=/opt/lib -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3' --with-boot-ldflags='static-libstdc++ -static-libgcc -Wl,-rpath=/opt/lib -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3' --disable-nls --disable-libsanitizer --disable-libvtv --disable-libcilkrts --disable-libmudflap --disable-multilib --disable-libgomp --disable-libquadmath --disable-libssp --disable-decimal-float --disable-libstdcxx-pch --with-host-libstdcxx=-lstdc++ --prefix=/opt --libexecdir=/opt/lib --with-local-prefix=/opt --with-float=soft --with-default-libstdcxx-abi=gcc4-compatible
    Thread model: posix
    gcc version 5.3.0 (OpenWrt GCC 5.3.0)
    
  6. インストール済みのパッケージを更新
    opkg upgrade
    

GCCもありましたし、含まれているツールのバージョンも新しめ(例えばPerlは5.22でした)なので、Entware-ng (opkg)の方が良さそうですね。

OK キャンセル 確認 その他