要瞭解QDK包裝的qpkg包含哪些metadata資訊,最簡單的方是就是看設定檔。
|
QNAP App Center: App Summary (Sys preload App has a QNAP Ribbon) |
|
QNAP Preload Apps have huge numbers of downloads. |
由上兩張圖對照以下讀取qpkg (
/etc/config/qpkg.conf) 設定檔,就可以清楚。
- Name: App名稱,常用於做為路徑名稱,所以不可以有空白
- Display_Name: 顯示於App Center的名稱,可以有空白
- Enable: 系統開機後,預設執行或不執行 (TRUE | FALSE | UNKNOWN)
- Date: 安裝日期。
- Shell: daemon service, shell script for start | stop | restart (參考最後原始碼)
- Install_Path: 安裝路徑 (廢話!)
[~] # ls /mnt/HDA_ROOT/update_pkg/DownloadStation/DSv3.tgz qpkg_ds.sh*
- WebUI: 通常QNAP App應該盡量寫成命令執行檔 (can be start | stop via shell scripts),做處理資料之任務 (e.g. DownloadStation應該用到wget吧!)。那輸出和指令輸入,當然最好透過Web。所以DownloadStation所指定的UI就是WebUI的值所代表的CGI程式,在App Center開啟後,就跳一個Web視窗 (或內嵌在QNAP桌面)。所以,會用Qt C++寫console app,和會一些簡單的PHP Web程式,就可以實現在QNAP上的創意應用。
- Author: 開發者
- Sys_App: 是否為系統preload程式 (yes = 1, App Icon會披QNAP彩帶)
- Desktop: 應用程式開啟在桌面 (yes = 1: 通常是QNAP系統App)
- Status: complete | stopped | ...
- Class = null 以下這些以後用到再查!
- ARM_Setting = yes
- RC_Number = 101
後面再往下仔細觀察,參數順序和QNAP官方開發App不同的,應該就不是QNAP的人所開發的Apps,不然就是外圍組織。只要QNAP preload Apps,參數順序都嚴格要求。
[~] # cat /etc/config/qpkg.conf [DownloadStation]Name = DownloadStationDisplay_Name = Download StationVersion = 3.0.1Enable = TRUEQPKG_File = DownloadStation.qpkgDate = 2014-02-25Shell = /mnt/HDA_ROOT/update_pkg/DownloadStation/qpkg_ds.shInstall_Path = /mnt/HDA_ROOT/update_pkg/DownloadStationWebUI = /cgi-bin/Qdownload/qdownloadindex.cgiAuthor = QNAP Systems, Inc.Sys_App = 1Desktop = 1Class = nullStatus = complete
[MultimediaStation]Name = MultimediaStationDisplay_Name = Multimedia StationVersion = 3.0Enable = FALSEQPKG_File = MultimediaStation.qpkgDate = 2013-07-26Shell = /etc/init.d/ImRd.sh mmstationInstall_Path = /mnt/HDA_ROOT/update_pkg/MSV2.tgzWebUI = /MSV2/Author = QNAP Systems, Inc.Sys_App = 1Desktop = 0 --> 開啟後不在QNAP桌面 (i.e. Open in new Tab within the browser)
[MusicStation]Name = MusicStationDisplay_Name = Music StationVersion = 4.1Enable = FALSEQPKG_File = MusicStation.qpkgDate = 2013-07-26Shell = /etc/init.d/ImRd.sh musicstationInstall_Path = /mnt/HDA_ROOT/update_pkg/musicstation.tgzWebUI = /musicstation/Author = QNAP Systems, Inc.Sys_App = 1Desktop = 1
[PhotoStation]Name = PhotoStationDisplay_Name = Photo StationVersion = 3.2Enable = FALSEQPKG_File = PhotoStation.qpkgDate = 2014-02-25Shell = /mnt/HDA_ROOT/update_pkg/PhotoStation/qpkg_photos.shInstall_Path = /mnt/HDA_ROOT/update_pkg/PhotoStationWebUI = /photo/Author = QNAP Systems, Inc.Sys_App = 1Desktop = 1Class = nullStatus = complete
[HappyGet2] --> 參數順序和QNAP官方開發App不同,應該不是QNAP的人,不然就是二次開發Name = HappyGet2Class = nullStatus = completeDisplay_Name = HappyGet 2Sys_App = 0Version = 2.2.99cAuthor = Dogulus KaienQPKG_File = HappyGet2.qpkgDate = 2014-03-03Shell = /share/MD0_DATA/.qpkg/HappyGet2/HappyGet2.shInstall_Path = /share/MD0_DATA/.qpkg/HappyGet2WebUI = /hg2/index.htmlEnable = TRUE
[Optware]Name = OptwareClass = nullStatus = completeVersion = 0.99.163Author = SL1000QPKG_File = Optware.qpkgDate = 2014-02-25Shell = /share/MD0_DATA/.qpkg/Optware/Optware.shInstall_Path = /share/MD0_DATA/.qpkg/OptwareWebUI = /Optware/Enable = FALSE
[nodejs]Name = nodejsClass = nullStatus = completeVersion = 0.8.22-2Author = JustinQPKG_File = nodejs.qpkgDate = 2014-02-25Shell = /share/MD0_DATA/.qpkg/nodejs/nodejs.shInstall_Path = /share/MD0_DATA/.qpkg/nodejsEnable = FALSE
[ruby]Name = rubyClass = nullStatus = completeVersion = 1.9.1.243Author = QNAP Systems, IncQPKG_File = ruby.qpkgDate = 2014-02-25Shell = /share/MD0_DATA/.qpkg/ruby/ruby.shInstall_Path = /share/MD0_DATA/.qpkg/rubyEnable = FALSE
[git]Name = gitClass = nullStatus = completeVersion = 1.8.2.3-1Author = JustinQPKG_File = git.qpkgDate = 2014-02-25Shell = /share/MD0_DATA/.qpkg/git/git.shInstall_Path = /share/MD0_DATA/.qpkg/gitEnable = FALSE
[Python]Name = PythonClass = nullStatus = completeVersion = 2.7Enable = FALSEQPKG_File = Python.qpkgDate = 2014-02-25Shell = /share/MD0_DATA/.qpkg/Python/python.shInstall_Path = /share/MD0_DATA/.qpkg/PythonAuthor = Troy
[aria2] <-- 這個掛QNAP開發,但不是preolad (沒有披QNAP彩帶)Name = aria2Class = nullStatus = completeVersion = 1.15.2aEnable = FALSEQPKG_File = aria2.qpkgDate = 2014-02-25Shell = /share/MD0_DATA/.qpkg/aria2/aria2c.runInstall_Path = /share/MD0_DATA/.qpkg/aria2WebUI = /aria2/Author = QNAP Systems, Inc.
[VideoStation]Name = VideoStationClass = nullStatus = completebuildVer:time = 2013-10-14 20:34:46buildVer:svn = 6726Display_Name = Video StationVersion = 1.0.5Author = QNAP Systems, Inc.QPKG_File = VideoStation.qpkgDate = 2014-02-25Shell = /share/MD0_DATA/.qpkg/VideoStation/VideoStation.shPid_File = /usr/local/VideoStation/var/VideoStation_mysqld.pidInstall_Path = /share/MD0_DATA/.qpkg/VideoStationWebUI = /videostation/index.phpSys_App = 1Enable = FALSEARM_Setting = yes
[SignageStation]Name = SignageStationClass = nullStatus = completeVersion = 1.2.13.1Author = iNDS, Inc.QPKG_File = SignageStation.qpkgDate = 2014-02-25Shell = /share/MD0_DATA/.qpkg/SignageStation/qsign.shInstall_Path = /share/MD0_DATA/.qpkg/SignageStationWebUI = /signagestation/initial.htmlRC_Number = 101Display_Name = Signage StationEnable = FALSE
[SQLBuddy]Name = SQLBuddyClass = nullStatus = completeVersion = 1.3.3Author = CristianQPKG_File = SQLBuddy.qpkgDate = 2014-02-26Shell = /share/MD0_DATA/.qpkg/SQLBuddy/sqlbuddy.shInstall_Path = /share/MD0_DATA/.qpkg/SQLBuddyWebUI = /sqlbuddyEnable = FALSE
[PostgreSQL]Name = PostgreSQLClass = nullStatus = completeVersion = 9.2.1Author = QNAP Systems, Inc. --> PostgreSQL是QNAP將來主推的preload DBMSQPKG_File = PostgreSQL.qpkgDate = 2014-02-28Shell = /share/MD0_DATA/.qpkg/PostgreSQL/PostgreSQL.shInstall_Path = /share/MD0_DATA/.qpkg/PostgreSQLWebUI = /phpPgAdmin/Enable = TRUE
[phpMyAdmin]Name = phpMyAdminClass = nullStatus = completeVersion = 3.3.5Enable = UNKNOWNQPKG_File = phpMyAdmin.qpkgDate = 2014-02-28Install_Path = /share/Web/phpMyAdminConfig_Path = /share/Web/phpMyAdmin/config.inc.phpWeb_Port = 80WebUI = /phpMyAdmin/Author = QNAP Systems, Inc.
[QDK]cfg:/etc/config/qdk.conf = 0Name = QDKVersion = 2.0.1Author = mickeQPKG_File = QDK.qpkgDate = 2014-03-03Shell = /share/MD0_DATA/.qpkg/QDK/qdkInstall_Path = /share/MD0_DATA/.qpkg/QDKEnable = TRUE
以後QNAP啟動或執行有問題,記得檢查看看:
/etc/config/qpkg.conf
[~] # cat /mnt/HDA_ROOT/update_pkg/DownloadStation/qpkg_ds.sh #!/bin/shPATH=/bin:/sbin:/usr/bin:/usr/sbinMNT_POINT="/mnt/ext"ROOT_PART="/mnt/HDA_ROOT"UPDATEPKG_DIR="${ROOT_PART}/update_pkg"QPKG_NAME=DownloadStation_stop(){ /etc/init.d/bt_scheduler.sh stop >/dev/null 2>&1 /etc/init.d/btd.sh stop >/dev/null 2>&1}case "$1" in stop) _stop ;; start) _stop [ -f /mnt/HDA_ROOT/update_pkg/${QPKG_NAME}/DSv3.tgz ] && /bin/cp /mnt/HDA_ROOT/update_pkg/${QPKG_NAME}/DSv3.tgz /mnt/HDA_ROOT/update_pkg/ [ ! -d ${MNT_POINT}/opt/DSv3 ] || /bin/rm -rf ${MNT_POINT}/opt/DSv3 [ ! -f ${UPDATEPKG_DIR}/DSv3.tgz ] || /etc/init.d/installtgz.sh DSv3 ${UPDATEPKG_DIR}/DSv3.tgz /etc/init.d/btd.sh start >/dev/null 2>&1 /etc/init.d/bt_scheduler.sh start >/dev/null 2>&1 ;; restart) $0 start ;; *) echo "Usage: ${0} {start|stop|restart}" exit 1esacexit 0
最後,想要知道你的NAS裝了哪些Apps,只要:
[~] # grep \\[ /etc/config/qpkg.conf [DownloadStation][MultimediaStation][MusicStation][PhotoStation][HappyGet2][Optware][nodejs][ruby][git][Python][aria2][VideoStation][SignageStation][SQLBuddy][PostgreSQL][phpMyAdmin][QDK]
也可以改 .conf 檔:vi
/etc/config/qpkg.conf
|
[Multimedia Station] 改為 Enable = TRUE 的結果 |
No comments :
Post a Comment