The log of mksh adapting
- mksh development/adapting
-
- log
mksh development/adapting
Since the ubuntu is not support Chinese, there comes the English.The article is maily about the development log of mksh adapting.
log
- no controlling tty , kernel do not have a /dev/tty;To avoid some internal error or the runtime err log “no controlling tty”, I using
when build mksh.So it is not recommanded to do tty_init_fd in runtime mksh.-DMKSH_DISABLE_TTY_WARNING
./sh.h:2751:extern int tty_init_fd(void); /* initialise tty_fd, tty_devtty */
./jobs.c:1910: switch (tty_init_fd()) {
./main.c:1189:tty_init_fd(void)
./var.c:1690: if (tty_init_fd() < 2) {
and, tty_devtty is false, the infect is not clear!, see as below
2.“turn job control on or off according to Flag(FMONITOR)”
[2021/06/02]
mkshrc的作用和openharmony适配
由于openharmony打算使用mksh+toybox作為shell和指令集,衆所周知,toybox的指令執行格式為
toybox ls
toybox ifconfig
toybox ping
...
上述輸入一定會逼瘋使用者。那麼有常見的兩種方式,來減少上述困擾。
- 建立bin/ls軟連接配接,指向toybox。
- 建立alias别名指令,如
alias ll='toybox ls -l --color'
但是,不幸的是,liteos_a目前并不支援軟連接配接。那麼alias還是可以繼續解決問題,對于liteos來說,mksh已經被閹割掉腳本能力或者說liteos無法完美支援mksh的腳本能力。那麼批量的alias将由誰來執行,需要将alias指令儲存在哪裡呢?
對比linux,bash每次啟動都會執行一個檔案,叫bashrc。mksh有沒有類似的操作呢。通過源碼閱讀,發現了類似的檔案dot.mkshrc。
今天就來研究,這個檔案是否能滿足我們的訴求,進而給liteos提供更加簡潔易用的shell。