Tag Archive: Shell Script

Embedded Linux: How to run a shell script at startup on Hisilicon’s Hi3518?

I am now developing on a Hisilicon’s chip, Hi3518E. The Linux kernal is built and compiled from the code of the SDK provided by Hisilicon. Thus, I think what I am going to say is also valid for other chips from Hisilicon.

I have studied Hi3518 for a few months. I now want to load some drives and programs at startup automatically so I spent some time to figure out how to do it on this chip. First of all, since I needed to run a set of commands, I wrote a Shell Script to organize all the commands together. Thus,I can run them all when I run the script once. Then, put the script into startup. I am not going to talk about how to write a Shell script as I don’t really know much about it.

0. Basic Knowledge

/etc/init.d/ : init.d is a folder for containing Unix/Linux Shell Scripts. If you enabled init.d in your kernal, the system will load and run the scripts placing here when it turns on. In common, all the init scripts of the services needed in a system are placed in this folder. So, you should find it on almost every Linux.
(more…)

Embedded Linux: 如何讓海思Hi3518開機後自動執行Shell Script?

我目前正於海思平台上進行開發,芯片是Hi3518E,Linux的內核是使用海思SDK所提供的代碼去編譯,所以我想以下所說的,大概跟其他海思芯片是差不多的吧(既然是同一家公司的,工程師做的東西應該都差不多才對吧),不過還是以Hi3518為準~

已經了解了Hi3518一段時間,目前需要它於開機啟動時自動插入一些驅動和程序,所以小小研究了一下要怎麼做。首先,因為有一系列的指令要做,所以就給它寫了個Shell Script(腳本),讓它可以一次過運行我所有的指令,之後再放入Startup。至於Shell Script要怎麼寫,我暫時就不多說了,因為我知的也不多~ 哈哈~

0. 基礎知識

/etc/init.d/ : init.d 是一個用來存放Unix/Linux Shell Script的文件夾,如果你的內核有開啟 init.d 的話,系統啟動時,會在登入前自行執行存放在這裡的腳本。一般系統上所有服務的啟動腳本都會放在這裡,一般是Linux系統的話,應該都會看到它的蹤影。
(more…)