uClinux 針對無 MMU CPU 優化,常用 C 庫為 mC-libc/mClibc。內核 make menuconfig 可選 Shell:sash、minix-shell、nwsh、bash、Other (BusyBox 內建)。
| Shell | 大小 | 特性 | 評價 |
|---|---|---|---|
| Lash | ~10KB | 管道/重定向,無 Bourne 語法,不能執行腳本 | 極簡 |
| Hush | ~18KB | 支援 Bourne 語法 if/then/else/fi,無 for/case 循環 | 基礎腳本可用 |
| Msh | ~30KB | 支援 for/do/done、case/esac,幾乎完整 Bourne 功能,用 vfork 創建進程,極適合 uClinux | 推薦 |
| Ash | ~60KB | 最完整但無法在 uClinux 編譯通過 | 不可用 |
make menuconfig:取消 sash,啟用 BusyBox → shell → msh: Minix shell MSH is /bin/shmsh.c 缺 _NSIG 錯誤:添加 #define _NSIG 255uClinux-Samsung/user/busybox/busybox.exe複製 busybox.exe 至 uClinux-Samsung/romfs/home,重新編譯內核 (無需再配置)。下載運行後,建立符號鏈接使用 (romfs 唯讀,僅 /tmp /var 可寫):
ln -s /bin/busybox /tmp/ls
/tmp/ls # 以 ls 命令運行
編輯 uClinux-dist/config/config.in:
# 將
bool 'sh: tab completion' CONFIG_USER_BUSYBOX_TAB_COMPLETION
bool 'sh: username completion' CONFIG_USER_BUSYBOX_USERNAME_COMPLETION
# 改為
bool 'sh: tab completion' CONFIG_USER_BUSYBOX_COMMAND_TAB_COMPLETION
bool 'sh: username completion' CONFIG_USER_BUSYBOX_COMMAND_USERNAME_COMPLETION
重新 make menuconfig 選中 BusyBox Shell 特性 → 編譯 → 下載運行,即獲 Tab 補全功能。
可進一步擴展如 ls 彩色顯示等特性。