|
| 1 | +-- Licensed under the Apache License, Version 2.0 (the "License"); |
| 2 | +-- You may not use this file except in compliance with the License. |
| 3 | +-- You may obtain a copy of the License at |
| 4 | +-- |
| 5 | +-- http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | +-- |
| 7 | +-- Unless required by applicable law or agreed to in writing, software |
| 8 | +-- distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 | +-- See the License for the specific language governing permissions and |
| 11 | +-- limitations under the License. |
| 12 | +-- |
| 13 | +-- Copyright (C) 2023-2023 RT-Thread Development Team |
| 14 | +-- |
| 15 | +-- @author xqyjlj |
| 16 | +-- @file deploy.lua |
| 17 | +-- |
| 18 | +-- Change Logs: |
| 19 | +-- Date Author Notes |
| 20 | +-- ------------ ---------- ----------------------------------------------- |
| 21 | +-- 2023-05-09 xqyjlj initial version |
| 22 | +-- |
| 23 | +import("rt.rt_utils") |
| 24 | + |
| 25 | +function main(rootfs, installdir, version) |
| 26 | + for _, filepath in ipairs(os.files(path.join(installdir, "bin") .. "/*")) do |
| 27 | + local filename = path.filename(filepath) |
| 28 | + rt_utils.cp_with_symlink(filepath, path.join(rootfs, "bin", filename)) |
| 29 | + end |
| 30 | + |
| 31 | + for _, filepath in ipairs(os.files(path.join(installdir, "usr", "bin") .. "/*")) do |
| 32 | + local filename = path.filename(filepath) |
| 33 | + rt_utils.cp_with_symlink(filepath, path.join(rootfs, "usr", "bin", filename)) |
| 34 | + end |
| 35 | + |
| 36 | + for _, filepath in ipairs(os.files(path.join(installdir, "usr", "sbin") .. "/*")) do |
| 37 | + local filename = path.filename(filepath) |
| 38 | + rt_utils.cp_with_symlink(filepath, path.join(rootfs, "usr", "sbin", filename)) |
| 39 | + end |
| 40 | + |
| 41 | + for _, filepath in ipairs(os.files(path.join(installdir, "sbin") .. "/*")) do |
| 42 | + local filename = path.filename(filepath) |
| 43 | + rt_utils.cp_with_symlink(filepath, path.join(rootfs, "sbin", filename)) |
| 44 | + end |
| 45 | + |
| 46 | +end |
0 commit comments