wiki:TipAndDoc/Linux/OpenWRT

Version 26 (modified by mitty, 12 years ago) (diff)

--

  • 注意: 非純正ファームウェアで無線を使うと(日本では)電波法違反になる可能性がある。
  • see also Hardware/WZR-HP-AG300H

OpenWRT

pppd

  • linkup時に /lib/netifd/ppp-up が実行される
    • /etc/ppp/ip-up と同じような使い方が可能?
    • Debian ppp-2.4.5/pppd/ipcp.c
          /*
           * Execute the ip-up script, like this:
           *  /etc/ppp/ip-up interface tty speed local-IP remote-IP
           */
      
    • 引数の具体例
      pppoe-wan eth1 0 114.159.68.126 118.23.8.36 wan
      
  • ONUの再起動(下記)などでpppdが終了してしまった場合、「/etc/init.d/network start」により全てのインタフェースがリセットされ再接続される
    Jun 12 15:57:35 starseed kern.info kernel: [   93.040000] eth1: link down
    Jun 12 15:57:39 starseed daemon.info pppd[1232]: No response to 5 echo-requests
    Jun 12 15:57:39 starseed daemon.notice pppd[1232]: Serial link appears to be disconnected.
    Jun 12 15:57:39 starseed daemon.info pppd[1232]: Connect time 1.1 minutes.
    Jun 12 15:57:39 starseed daemon.info pppd[1232]: Sent 27281 bytes, received 19359 bytes.
    Jun 12 15:57:40 starseed daemon.notice netifd: Interface 'wan' has lost the connection
    Jun 12 15:57:40 starseed daemon.notice pppd[1232]: Modem hangup
    Jun 12 15:57:40 starseed daemon.notice pppd[1232]: Connection terminated.
    
    (snip)
    
    Jun 12 15:58:30 starseed daemon.info pppd[4014]: CHAP authentication failed: permission denied
    Jun 12 15:58:30 starseed daemon.err pppd[4014]: CHAP authentication failed
    Jun 12 15:58:30 starseed daemon.notice pppd[4014]: Connection terminated.
    Jun 12 15:58:30 starseed daemon.info pppd[4014]: Exit.
    Jun 12 15:58:30 starseed daemon.notice netifd: Interface 'wan' is now down
    Jun 12 15:58:30 starseed kern.info kernel: [  148.030000] eth1: link down
    
    • 停電などに備えるには、cronなどでpppoeインタフェースの存在を監視するのが良いかも知れない

multiple PPPoE

subversion

  • 2012/05/20現在、リポジトリからsubversionが消えている
  • backfire 10.03.1からパッケージを持ってこようとしたが、結局SEGVで動かなかった
  • root@OpenWrt:~# opkg update
  • root@OpenWrt:~# opkg install zlib libneon libaprutil
     * opkg_install_cmd: Cannot install package libaprutil.
    
  • root@OpenWrt:~# opkg install diffutils
    Installing diffutils (3.0-1) to root...
    Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/diffutils_3.0-1_ar71xx.ipk.
    Collected errors:
     * check_data_file_clashes: Package diffutils wants to install file /usr/bin/cmp
            But that file is already provided by package  * busybox
     * opkg_install_cmd: Cannot install package diffutils.
    
  • root@OpenWrt:~# opkg install diffutils --force-overwrite
    Installing diffutils (3.0-1) to root...
    Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/diffutils_3.0-1_ar71xx.ipk.
    Configuring diffutils.
    
  • root@OpenWrt:~# cp -a /etc/opkg.conf /etc/opkg.conf.orig-20120520
  • root@OpenWrt:~# vim /etc/opkg.conf
    • /etc/opkg.conf

      old new  
      1 src/gz attitude_adjustment http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages 
       1src/gz attitude_adjustment http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages/ 
      22dest root / 
      33dest ram /tmp 
      44lists_dir ext /var/opkg-lists 
  • root@OpenWrt:~# opkg update
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//Packages.gz.
    Inflating http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//Packages.gz.
    Updated list of available packages in /var/opkg-lists/attitude_adjustment.
    
  • root@OpenWrt:~# opkg install subversion-client
    Installing subversion-client (1.6.17-2) to root...
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//subversion-client_1.6.17-2_ar71xx.ipk.
    Installing libaprutil (1.3.12-2) to root...
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//libaprutil_1.3.12-2_ar71xx.ipk.
    Installing libapr (1.4.5-2) to root...
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//libapr_1.4.5-2_ar71xx.ipk.
    Installing libpthread (0.9.30.1-43.32) to root...
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//libpthread_0.9.30.1-43.32_ar71xx.ipk.
    Installing librt (0.9.30.1-43.32) to root...
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//librt_0.9.30.1-43.32_ar71xx.ipk.
    Installing libsqlite3 (3070701-1) to root...
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//libsqlite3_3070701-1_ar71xx.ipk.
    Installing libuuid (1.41.11-1) to root...
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//libuuid_1.41.11-1_ar71xx.ipk.
    Installing subversion-libs (1.6.17-2) to root...
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//subversion-libs_1.6.17-2_ar71xx.ipk.
    Configuring librt.
    Configuring libpthread.
    Configuring libapr.
    Configuring libsqlite3.
    Configuring libuuid.
    Configuring libaprutil.
    Configuring subversion-libs.
    Configuring subversion-client.
    
  • root@OpenWrt:~# svn
    svn: can't load library 'libssl.so.0.9.8'
    
  • root@OpenWrt:~# opkg remove libopenssl
    No packages removed.
    Collected errors:
     * print_dependents_warning: Package libopenssl is depended upon by packages:
     * print_dependents_warning:    libneon
     * print_dependents_warning: These might cease to work if package libopenssl is removed.
    
     * print_dependents_warning: Force removal of this package with --force-depends.
     * print_dependents_warning: Force removal of this package and its dependents
     * print_dependents_warning: with --force-removal-of-dependent-packages.
    
  • root@OpenWrt:~# opkg remove libopenssl --force-removal-of-dependent-packages
    Removing package subversion-client from root...
    Removing package subversion-libs from root...
    Removing package subversion-client from root...
    You can force removal of packages with failed prerm scripts with the option:
            --force-remove
    No packages removed.
    Collected errors:
     * pkg_run_script: Internal error: subversion-client has a NULL tmp_unpack_dir.
     * opkg_remove_pkg: not removing package "subversion-client", prerm script failed
    
  • root@OpenWrt:~# opkg remove libopenssl --force-removal-of-dependent-packages --f
    orce-remove
    Removing package libneon from root...
    Removing package libopenssl from root...
    
  • root@OpenWrt:~# opkg install libneon
    Installing libneon (0.29.6-2) to root...
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//libneon_0.29.6-2_ar71xx.ipk.
    Installing libopenssl (0.9.8r-1) to root...
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//libopenssl_0.9.8r-1_ar71xx.ipk.
    Configuring libopenssl.
    Configuring libneon.
    
  • root@OpenWrt:~# opkg install subversion-client
    Installing subversion-client (1.6.17-2) to root...
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//subversion-client_1.6.17-2_ar71xx.ipk.
    Installing subversion-libs (1.6.17-2) to root...
    Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages//subversion-libs_1.6.17-2_ar71xx.ipk.
    Configuring subversion-libs.
    Configuring subversion-client.
    
  • root@OpenWrt:~# svn
    Segmentation fault
    

cross complie

DD-WRT