Skip to content

Commit 6d04656

Browse files
author
rcitach
committed
add version info get and add busybox inittab file
1 parent dc504e0 commit 6d04656

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2006-2024, RT-Thread Development Team
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Run getty & login
6+
# console::respawn:/sbin/getty 115200 /dev/console
7+
8+
# or without login, a direct access to shell
9+
console::respawn:-/bin/ash

repo/packages/b/busybox/scripts/deploy.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
--
2323
import("rt.rt_utils")
2424

25-
function main(rootfs, installdir)
25+
function main(rootfs, installdir, version)
2626
for _, filepath in ipairs(os.files(path.join(installdir, "bin") .. "/*")) do
2727
local filename = path.filename(filepath)
2828
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "bin", filename))
@@ -42,4 +42,11 @@ function main(rootfs, installdir)
4242
local filename = path.filename(filepath)
4343
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "sbin", filename))
4444
end
45+
46+
for _, filepath in ipairs(os.files(path.join(os.scriptdir():match(".*/"), "port", version) .. "/*")) do
47+
if not filepath:match("%.config$") then
48+
local filename = path.filename(filepath)
49+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "etc", filename))
50+
end
51+
end
4552
end

tools/scripts/tasks/smart-rootfs/on_run.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
-- Date Author Notes
2020
-- ------------ ---------- -----------------------------------------------
2121
-- 2023-05-09 xqyjlj initial version
22-
--
22+
-- 2024-11-11 rcitach add version get
23+
2324
import("core.project.config")
2425
import("core.project.project")
2526
import("core.base.option")
@@ -69,6 +70,7 @@ function deploy_package(rootfs)
6970
local repo = instance:repo()
7071
local packagename = requireinfo.originstr
7172
local installdir = instance:installdir()
73+
local version = instance:version_str()
7274
local repodir = repo:url()
7375
local reponame = repo:name()
7476
if string.find(packagename, "%s") then
@@ -78,7 +80,7 @@ function deploy_package(rootfs)
7880
path.join(repodir, "packages", packagename:sub(1, 1), packagename, "scripts", "deploy.lua")
7981
if os.isfile(deploy_script) then
8082
vprint("run script => '%s'", deploy_script)
81-
import("deploy", {rootdir = path.directory(deploy_script)}).main(rootfs, installdir)
83+
import("deploy", {rootdir = path.directory(deploy_script)}).main(rootfs, installdir, version)
8284
end
8385
local package_rootfs = path.join(repodir, "packages", packagename:sub(1, 1), packagename, "rootfs")
8486
if os.isdir(package_rootfs) then

0 commit comments

Comments
 (0)