搭建运行环境
使用 armory install
命令可以将设备制品包
直接部署到您的目标设备中,一键完成运行时环境的搭建,同时 Armory
能够自动解析当前的设备架构,避免人工部署时的错误情况。
Armory 环境准备
armory install
命令依赖 uname
和 tar
命令的特定版本,所以在使用 armory install
安装软件包前应当正确手动安装 libarchive
和 uname
。
当未正确安装 libarchive
时,可能出现如下提示。
Connecting to 192.168.7.91...
Connected
Installation failed.
Armory Error: Error: The remote machine does not support to install command because no available tar command is detected. You can manually install the libarchive latest version and try again. Please refer to: http://*.*.*.*/package/sylixos-middleware/libarchive
A complete log of this run can be found in:
C:\Users\acoinfo\.armory\logs\armory-cli-temp.log
当未正确安装 uname
时,可能出现如下提示。
Connecting to 192.168.7.91...
Connected
Installation failed.
Armory Error: Error: The remote machine does not support to install because no available uname command is detected. You can manually install the uname latest version and try again. Please refer to: http://*.*.*.*/package/sylixos-middleware/uname
A complete log of this run can be found in:
C:\Users\acoinfo\.armory\logs\armory-cli-temp.log
如果出现上述问题。以 x86-64 架构为例,请按照以下顺序解决。
安装 libarchive
- 执行
armory get @sylixos-middleware/libarchive -A x86-64
下载libarchive
。 - 使用任意 FTP 工具将下载的
libarchive
上传到设备。 - 执行
untar libarchive-***.tar.gz /
安装libarchive
安装 uname
- 执行
armory get @sylixos-middleware/uname -A x86-64
下载uname
。 - 使用任意 FTP 工具将下载的
uname
上传到设备。 - 执行
tar zxvfPo uname-***.tar.gz -C /
安装uname
示例
将 zlib
安装到一个 x86-64 架构的设备中。
启动设备,将其添加到 Armory
远程设备列表中,并激活远端设备。
D:\armory>armory remote set x64=ftp://root:****@192.168.7.91:21
D:\armory>armory remote use
Please use the ↑↓ arrow keys to navigate and press Enter to confirm.
default
x64
The remote x64 is active now
D:\armory>armory remote ls
┌──────────┬───────────────────────────────────────┬──────────┐
│ Alias │ Remote Address │ Status │
├──────────┼───────────────────────────────────────┼──────────┤
│ default │ │ │
├──────────┼───────────────────────────────────────┼──────────┤
│ x64 │ ftp://root:cm9vdA%3D%3D@192.168.7.91/ │ active │
└──────────┴───────────────────────────────────────┴──────────┘
为设备部署 zlib
库。
D:\armory>armory install @sylixos-middleware/zlib
Connecting to 192.168.7.91...
Connected
Installing: @sylixos-middleware/zlib@latest
[ PRE_CHECK ] stage: pre_check
[ PRE_CHECK ] Remote environment: SylixOS@x86-64@3.6.5
[ PRE_CHECK ] Tar version: 3.7.7
[ PRE_CHECK ] Tag: latest ==> 1.2.11-20241108
[ CONFIRMATION ] stage: confirmation
[ LOCKING ] stage: locking
[ LOCKING ] Trying to lock(1 time): @sylixos-middleware@zlib
[ LOCKED ] stage: locked
[ COLLECTING ] stage: collecting
Downloading package @sylixos-middleware/zlib@1.2.11-20241108@SylixOS@x86-64...
Package folder: C:\Users\acoinfo\AppData\Local\Temp\.armory\@sylixos-middleware_zlib_1.2.11-20241108_1735027163452\@sylixos-middleware\zlib@1.2.11-20241108
zlib-sylixos-x86-64-v1.2.11-20241108-dev.tar.gz (47.45 KB) 100%[======================>] done
README.md (613 B) 100%[======================>] done
Download is completed!
[ COLLECTED ] stage: collected
[FILES_CHECKING ] stage: files_checking
[FILES_CHECKING ] =================@sylixos-middleware/zlib@1.2.11-20241108================
[FILES_CHECKING ] ~ /lib/libz.so
[FILES_CHECKING ] =============================================================================
[FILES_CHECKING ] Please review and confirm the behavior of all package files: Green + indicates new files, white ~ shows files that overwrite old ones, yellow - indicates files removed compared to the installed version, and red ~ marks files that overwrite existing files of unknown origin. [Y/n]
[ FILES_CHECKED ] stage: files_checked
[ PACKING ] stage: packing
[ PACKING ] Repackaging integrated package...
[ PACKED ] stage: packed
[ UPLOADING ] stage: uploading
[ UPLOADING ] Uploading integrated package and pre install scripts to remote server...
mkd /tmp/.amr/@sylixos-middleware_zlib_1.2.11-20241108_1735027163452
put C:\Users\acoinfo\AppData\Local\Temp\.armory\@sylixos-middleware_zlib_1.2.11-20241108_1735027163452\@sylixos-middleware_zlib_SylixOS_x86-64_1.2.11-20241108.tar.gz /tmp/.amr/@sylixos-middleware_zlib_1.2.11-20241108_1735027163452/@sylixos-middleware_zlib_SylixOS_x86-64_1.2.11-20241108.tar.gz
[ UPLOADED ] stage: uploaded
[PRE_INSTALLING ] stage: pre_installing
[ PRE_INSTALLED ] stage: pre_installed
[ UNPACKING ] stage: unpacking
[ UNPACKING ] Unpacking the package...
[ UNPACKING ] > tar zxvfoP /tmp/.amr/@sylixos-middleware_zlib_1.2.11-20241108_1735027163452/@sylixos-middleware_zlib_SylixOS_x86-64_1.2.11-20241108.tar.gz -C /
[ UNPACKING ] ********************Remote output********************
[ UNPACKING ] x lib/
[ UNPACKING ] x lib/libz.so
[ UNPACKING ] x var/lib/amr/@sylixos-middleware/zlib@1.2.11-20241108.installing/amr.json
[ UNPACKING ] x var/lib/amr/@sylixos-middleware/zlib@1.2.11-20241108.installing/uninst.sh
[ UNPACKING ] flg: f0000 value: -2
[ UNPACKING ] *****************************************************
[ UNPACKED ] stage: unpacked
[POST_INSTALLING] stage: post_installing
[POST_INSTALLED ] stage: post_installed
[ RENAMING ] stage: renaming
[ RENAMING ] Renaming /var/lib/amr/@sylixos-middleware/zlib@1.2.11-20241108.installing to /var/lib/amr/@sylixos-middleware/zlib@1.2.11-20241108
[ RENAMING ] > mv /var/lib/amr/@sylixos-middleware/zlib@1.2.11-20241108.installing /var/lib/amr/@sylixos-middleware/zlib@1.2.11-20241108
[ RENAMED ] stage: renamed
[REMOVING_OLDER ] stage: removing_older
[ REMOVED ] stage: removed
[ CLEANING ] stage: cleaning
[ CLEANING ] Cleaning remote tmp directory: /tmp/.amr/@sylixos-middleware_zlib_1.2.11-20241108_1735027163452
rm \tmp\.amr\@sylixos-middleware_zlib_1.2.11-20241108_1735027163452\@sylixos-middleware_zlib_SylixOS_x86-64_1.2.11-20241108.tar.gz
rmd \tmp\.amr\@sylixos-middleware_zlib_1.2.11-20241108_1735027163452\@sylixos-middleware_zlib_SylixOS_x86-64_1.2.11-20241108.tar.gz
rm /tmp/.amr/@sylixos-middleware_zlib_1.2.11-20241108_1735027163452/
rmd /tmp/.amr/@sylixos-middleware_zlib_1.2.11-20241108_1735027163452/
[ CLEANING ] Cleaning local tmp directory: C:\Users\acoinfo\AppData\Local\Temp\.armory\@sylixos-middleware_zlib_1.2.11-20241108_1735027163452
[ CLEANED ] stage: cleaned
[ UNLOCKING ] stage: unlocking
[ UNLOCKING ] Releasing lock: /tmp/.amr/locks/@sylixos-middleware@zlib.lock
rm /tmp/.amr/locks/@sylixos-middleware@zlib.lock/
rmd /tmp/.amr/locks/@sylixos-middleware@zlib.lock/
[ UNLOCKING ] Lock released.
[ UNLOCKED ] stage: unlocked
[ DONE ] stage: done
Package @sylixos-middleware/zlib@1.2.11-20241108 was successfully installed on remote server(192.168.7.91).
Installation completed.
D:\armory>
至此,可以在设备中查看到相关的库已经安装就绪。
[root@sylixos:/root]# ll /lib/libz.so
-rwxrwxr-x root root Fri Nov 08 20:13:09 2024 88KB, libz.so
total items: 1
[root@sylixos:/root]#