顯示具有 busybox 標籤的文章。 顯示所有文章
顯示具有 busybox 標籤的文章。 顯示所有文章

2011年6月30日 星期四

busybox make menuconfig fail

 切到busybox目錄下
make menuconfig
居然無法啟動menu 視窗

message

  HOSTCC  scripts/kconfig/lxdialog/checklist.o
In file included from scripts/kconfig/lxdialog/checklist.c:24:
scripts/kconfig/lxdialog/dialog.h:31:20: error: curses.h: 沒有此一檔案或目錄
In file included from scripts/kconfig/lxdialog/checklist.c:24:
scripts/kconfig/lxdialog/dialog.h:128: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘use_colors’
scripts/kconfig/lxdialog/dialog.h:129: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘use_shadow’
scripts/kconfig/lxdialog/dialog.h:131: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attributes’
scripts/kconfig/lxdialog/dialog.h:143: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:146: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:147: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:148: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:149: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:151: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/checklist.c:31: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/checklist.c:59: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/checklist.c:95: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/checklist.c: In function ‘dialog_checklist’:
scripts/kconfig/lxdialog/checklist.c:117: error: ‘WINDOW’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:117: error: (Each undeclared identifier is reported only once
scripts/kconfig/lxdialog/checklist.c:117: error: for each function it appears in.)
scripts/kconfig/lxdialog/checklist.c:117: error: ‘dialog’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:117: error: ‘list’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:117: warning: left-hand operand of comma expression has no effect
scripts/kconfig/lxdialog/checklist.c:121: warning: implicit declaration of function ‘endwin’
scripts/kconfig/lxdialog/checklist.c:122: warning: implicit declaration of function ‘fprintf’
scripts/kconfig/lxdialog/checklist.c:122: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/kconfig/lxdialog/checklist.c:122: error: ‘stderr’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:140: error: ‘COLS’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:141: error: ‘LINES’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:143: warning: implicit declaration of function ‘draw_shadow’
scripts/kconfig/lxdialog/checklist.c:143: error: ‘stdscr’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:145: warning: implicit declaration of function ‘newwin’
scripts/kconfig/lxdialog/checklist.c:146: warning: implicit declaration of function ‘keypad’
scripts/kconfig/lxdialog/checklist.c:146: error: ‘TRUE’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:148: warning: implicit declaration of function ‘draw_box’
scripts/kconfig/lxdialog/checklist.c:148: error: ‘attributes’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:149: warning: implicit declaration of function ‘wattrset’
scripts/kconfig/lxdialog/checklist.c:150: warning: implicit declaration of function ‘mvwaddch’
scripts/kconfig/lxdialog/checklist.c:152: warning: implicit declaration of function ‘waddch’
scripts/kconfig/lxdialog/checklist.c:156: warning: implicit declaration of function ‘print_title’
scripts/kconfig/lxdialog/checklist.c:159: warning: implicit declaration of function ‘print_autowrap’
scripts/kconfig/lxdialog/checklist.c:166: warning: implicit declaration of function ‘subwin’
scripts/kconfig/lxdialog/checklist.c:190: warning: implicit declaration of function ‘print_item’
scripts/kconfig/lxdialog/checklist.c:194: warning: implicit declaration of function ‘print_arrows’
scripts/kconfig/lxdialog/checklist.c:197: warning: implicit declaration of function ‘print_buttons’
scripts/kconfig/lxdialog/checklist.c:199: warning: implicit declaration of function ‘wnoutrefresh’
scripts/kconfig/lxdialog/checklist.c:201: warning: implicit declaration of function ‘doupdate’
scripts/kconfig/lxdialog/checklist.c:204: warning: implicit declaration of function ‘wgetch’
scripts/kconfig/lxdialog/checklist.c:211: error: ‘KEY_UP’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:211: error: ‘KEY_DOWN’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:221: error: ‘FALSE’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:222: warning: implicit declaration of function ‘scrollok’
scripts/kconfig/lxdialog/checklist.c:223: warning: implicit declaration of function ‘wscrl’
scripts/kconfig/lxdialog/checklist.c:232: warning: implicit declaration of function ‘wrefresh’
scripts/kconfig/lxdialog/checklist.c:282: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/kconfig/lxdialog/checklist.c:283: warning: implicit declaration of function ‘delwin’
scripts/kconfig/lxdialog/checklist.c:287: error: ‘KEY_LEFT’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:288: error: ‘KEY_RIGHT’ undeclared (first use in this function)
make[2]: *** [scripts/kconfig/lxdialog/checklist.o] Error 1
make[1]: *** [menuconfig] Error 2
make: *** [menuconfig] Error 2

需要安裝此套件

sudo apt-get install libncurses5-dev

就ok


透過Facebook分享

2011年6月3日 星期五

busybox教學 - 如何enable/disable vi 使用menuconfig


busybox教學 - 如何enable/disable vi


原來可以使用make menuconfig

進入busybox folder
make menuconfig
選擇Editors->vi
Exit後存檔

在make就可以嚕

透過Facebook分享

2011年5月11日 星期三

busybox教學 - 如何enable/disable vi

下載busybox (目前使用1.18.4)

解壓縮後

cd busybox-1.18.4.
vim .config


搜尋字串CONFIG_VI=y
拿掉#

重新build一次就ok


./busybox 就可以看到目前支援的功能

Currently defined functions:
        [, [[, arp, arping, ash, awk, basename, bunzip2, bzcat, cat, chmod, chroot, cksum, clear, cmp, cp, crond, crontab, cut, date, dd, df, dhcprelay,
        dirname, dmesg, du, echo, egrep, env, expr, false, fgrep, free, ftpget, ftpput, getopt, getty, grep, gunzip, gzip, halt, head, hostid, hostname,
        id, ifconfig, ifdown, ifup, init, insmod, ip, ipaddr, ipcalc, ipcs, iplink, iproute, kill, killall, killall5, klogd, linuxrc, ln, login, logread,
        ls, lsmod, md5sum, mkdir, mkfifo, mknod, mktemp, modprobe, mount, mv, nameif, nc, netstat, nice, nslookup, pidof, ping, poweroff, printf, ps,
        pwd, reboot, rm, rmmod, route, run-parts, sed, seq, setconsole, setsid, sh, sleep, sort, split, start-stop-daemon, stat, stty, sum, swapoff,
        swapon, switch_root, sync, syslogd, tail, tar, tee, telnetd, test, tftp, top, touch, tr, traceroute, true, tty, udhcpc, udhcpd, umount, uname,
        uniq, usleep, vconfig, vi, wc, which, whoami, yes, zcat

透過Facebook分享

2011年5月10日 星期二

busybox 1.6 沒有vi

沒有vi
我沒有辦法透過busybox vi在機器上寫一些shellscript

但是有wget


所以我可以在pc端 install ftp server.

然後用telnet登入機器後
使用wget來抓

chmod +x sipclient.sh

./sipclient.sh

我覺得更值得學習的方法

應該是將新版busybox的vi功能加到現有的busybox上

busybox 1.6



busybox 1.18

透過Facebook分享

2010年12月9日 星期四

將busybox加入android中

  • 設定環境



============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.2
TARGET_PRODUCT=imx51_bbg
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=FRF85B
============================================



  • add busybox to /out/target/product/dependonyourplatform/system/bin


> make snod

將system內容打包成system.img (內容大小從原本的108863488變成110743552)

這樣子的方式可以讓你不用在重新build android就加入你已經build的程式


將產生出來的system.img mount起來

> mkdir system-another

> mount -o loop system.img system-another

> ls system-another


alsa_amixer        busybox       dhcpcd        getprop    iptables      mke2fs       pand          renice     servicemanager  surfaceflinger  vold
alsa_aplay         cat           dispd         gzip       keystore      monkey       ping          resize2fs  setconsole      svc             watchprops
alsa_ctl           check_prereq  dmesg         hciattach  keystore_cli  mount        pm            rild       setprop         sync            wipe
am                 chmod         dnsmasq       hd         kill          mtpd         pppd          rm         sh              system_server   wpa_cli
applypatch         chown         dumpstate     id         linker        mv           printenv      rmdir      showlease       tc              wpa_supplicant
applypatch_static  cmp           dumpsys       ifconfig   ln            nandread     ps            rmmod      skia_test       testid3
app_process        dalvikvm      dvz           iftop      log           ndc          qemud         route      sleep           toolbox
audioloop          date          e2fsck        ime        logcat        netcfg       qemu-props    run-as     smd             top
bash               dbus-daemon   flash_image   input      logwrapper    netd         racoon        schedtest  stagefright     tune2fs
bluetoothd         dd            fsck_msdos    insmod     ls            netstat      radiooptions  schedtop   stapio          umount
bmgr               debuggerd     gdbjithelper  installd   lsmod         newfs_msdos  reboot        sdptool    staprun         updater
bootanimation      dexopt        gdbserver     ioctl      mediaserver   notify       record        sendevent  start           vdc
bugreport          df            getevent      ionice     mkdir         omx_tests    recovery      service    stop            vmstat

果然看到busybox

將system.img放到sd卡上

開機執行  可以直接run 

busybox

以前是放到data folder下要執行需要

cd data
./busybox ls .....

現在
busybox ls....

透過Facebook分享

2010年12月6日 星期一

busybox: tar package缺少-append選項

Tomasz問tar套件缺少 -append該怎麼辦呢

Mikhail說

很簡單, 只需要implement他並將patch教出來

看來

給自己一個目標

訂個時間點

將發現缺少又需要的東西交個patch

lsusb有少嗎?

透過Facebook分享

2010年11月18日 星期四

Run busybox on android under imx51

今天auron問
我怎麼把busybox上到板子上又不用usb

我說我放到sd卡上
android有個data目錄
直接將build好的busybox放上去

插卡開機

需要修改一下權限
不然會出現Permission denied

bash-3.2# ./busybox pwd
bash: ./busybox: Permission denied

bash-3.2# chmod 755 busybox

執行./busybox ls -al

透過Facebook分享

2010年11月12日 星期五

build busybox for imx51

1. 官網下載
version 1.17.3

2. 解壓縮
tar jxvf busybox-1.17.3.tar.bz2.tar

3. 設定環境變數

export CROSS_COMPILE=/opt/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-

cross compile工具跟你系統會有關係
所以通常需要修改此部份

FAQ網頁有說明如果要使用cross_compile要設定CROSS_COMPILE參數

4. build busybox
make defconfig
/*
To enable all features, use "make defconfig", which produces the largest
general-purpose configuration.
*/
make menuconfig
  # select Busybox Settings
  #   then General Configuration
  #     then exec prefers applets
  #   exit back to top level menu
  #   select Shells
  #     then Standalone shell
  #   exit back to top level menu
  # exit and save new configuration
make

檢查一下busybox檔案屬性
file busybox

busybox: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped

如果想要build出static
此篇文章有教學

再看一次
nelsonchung@gps1004:~/busybox-1.17.3$ file busybox
busybox: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.14, stripped

最後感謝checko告知要使用stty在嵌入式系統上  可以利用busybox
感謝auron告知busybox相關information, 他真的很專業

Reference:

透過Facebook分享