logo
0
0
WeChat Login
支持传入libso直接打包符合3.4/3.5.4格式的增量包

RMS Plugin Zip Builder

Build a standard RMS plugin package zip from an existing incremental zip, deb package, or libso attachment.

The generated package contains:

  • The original input resource file, or an auto-generated libso payload zip for SDK 3.5.4.
  • manifest.json.
  • manifest.json.sha256.

Requirements

The build script checks required commands before doing any work. Missing dependencies stop the build immediately.

Required commands:

  • bash
  • zip
  • sha256sum
  • awk
  • basename
  • dirname
  • mktemp
  • mkdir
  • cp
  • mv
  • rm

Usage

Run the builder with an incremental zip, deb package, or libso attachment:

./build_package.sh ./example-plugin-1.2.3-arm64-hotfix.zip
./build_package.sh ./example-plugin-1.2.3-arm64-hotfix.deb
./build_package.sh /path/to/sdk-3.5.4/arm64/libexample.so
./build_package.sh /path/to/sdk-3.4/arm64/libexample.so

Resource methods are selected automatically:

  • .zip: zip_extract
  • .deb: deb
  • .so: libso

Zip resources ask for targetPath and include lifecycle.beforeAll plus reboot in lifecycle.afterAll. Deb resources do not include targetPath or lifecycle.beforeAll, but they do include reboot in lifecycle.afterAll.

Libso resources are handled by SDK path:

  • SDK 3.5.4: the .so is copied to data/rbk/plugins inside an auto-generated payload zip, then that payload zip is packaged as an RMS incremental package with method zip_extract.
  • SDK 3.4: the .so is copied to SeerRobotics/rbk/plugins and compressed directly as a plain zip package.

SDK version is detected from the absolute input path. The script recognizes path tokens such as 3.5.4, 3_5_4, 3.4, and 3_4. If detection fails, it asks for sdkVersion.

The script tries to extract these fields from the input file name and absolute input path:

  • packageId
  • version
  • arch
  • sdkVersion for .so inputs
  • description

For .so inputs, version can fall back to a version-like parent directory such as 3.5.4.0030, and arch can fall back to a path token such as arm64.

For example, example-plugin-1.2.3-arm64-hotfix.zip will suggest:

  • packageId: example
  • version: 1.2.3
  • arch: arm64
  • description: hotfix

You can press Enter to accept each suggested value, or type a new value.

Supported architectures:

  • arm64
  • amd64
  • all

Aliases such as aarch64, x86_64, linux_x64, and x64 are accepted during input and normalized to the supported values.

The final output name is:

<type>-<packageId>-<version>-<arch>.zip

By default, type is selected from the input file type:

  • .zip: plugin
  • .deb: app

So typical outputs look like:

plugin-example-1.2.3-arm64.zip
app-example-1.2.3-arm64.zip

SDK 3.5.4 libso inputs generate the same RMS package naming format and include a payload resource named:

<packageId>-<version>-<arch>-libso.zip

SDK 3.4 libso inputs generate a plain zip named:

<packageId>-<version>-<arch>-sdk3.4.zip

Install

Install the command alias:

./install.sh

The installer detects your shell startup file and registers this alias:

rms-build-package

After installation, refresh your current terminal:

source ~/.zshrc

or:

source ~/.bashrc

Then you can build from any directory:

rms-build-package /path/to/example-plugin-1.2.3-arm64-hotfix.zip
rms-build-package /path/to/example-plugin-1.2.3-arm64-hotfix.deb

To choose a custom alias name:

./install.sh rmszip

Then use:

rmszip /path/to/input.zip
rmszip /path/to/input.deb

About

打包符合3.5.4(RMS规范)和3.4(Robod规范)的zip文件

Language
Shell100%