LoginSignup
2
0

More than 5 years have passed since last update.

OpenWrt/LEDEのbusyboxでdiffが無効になってる件

Last updated at Posted at 2017-08-25

表題の通りですが、OpenWrt/LEDEではインストール直後の状態でdiffコマンドがありません。

  • ディスクスペース節約のためOpenWrt/LEDEのbusyboxではdiffが無効になっている
  • busyboxでcmpコマンドが有効なので、システム用のスクリプトではこちらを使ってね
  • diffコマンドが欲しい人はdiffutilsを入れてね

だそうで。

cmpコマンドというのは下記のようなもの。

# cmp /tmp/resolve.conf.*
/tmp/resolv.conf.auto /tmp/resolv.conf.ppp differ: char 1, line 1

確かに、シェルスクリプトで分岐させるだけならこれでいけそう。でもsshログインして作業するときには不便。

というわけでdiffutilsをインストール。

# opkg install diffutils
(snip)
# ls -la $(which diff)
-rwxr-xr-x    1 root     root        102549 Feb  2  2017 /usr/bin/diff

なるほど100KB増加。diffが絶対必要だけど100KBが惜しい人は自分でbusyboxリビルドしてねってことですかね。

参考URL

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0