Skip to content

Commit

Permalink
add version info get and add busybox inittab file
Browse files Browse the repository at this point in the history
  • Loading branch information
rcitach committed Nov 11, 2024
1 parent dc504e0 commit 6d04656
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
9 changes: 9 additions & 0 deletions repo/packages/b/busybox/port/1.35.0/inittab
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2006-2024, RT-Thread Development Team
#
# SPDX-License-Identifier: Apache-2.0

# Run getty & login
# console::respawn:/sbin/getty 115200 /dev/console

# or without login, a direct access to shell
console::respawn:-/bin/ash
9 changes: 8 additions & 1 deletion repo/packages/b/busybox/scripts/deploy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
--
import("rt.rt_utils")

function main(rootfs, installdir)
function main(rootfs, installdir, version)
for _, filepath in ipairs(os.files(path.join(installdir, "bin") .. "/*")) do
local filename = path.filename(filepath)
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "bin", filename))
Expand All @@ -42,4 +42,11 @@ function main(rootfs, installdir)
local filename = path.filename(filepath)
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "sbin", filename))
end

for _, filepath in ipairs(os.files(path.join(os.scriptdir():match(".*/"), "port", version) .. "/*")) do
if not filepath:match("%.config$") then
local filename = path.filename(filepath)
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "etc", filename))
end
end
end
6 changes: 4 additions & 2 deletions tools/scripts/tasks/smart-rootfs/on_run.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
-- Date Author Notes
-- ------------ ---------- -----------------------------------------------
-- 2023-05-09 xqyjlj initial version
--
-- 2024-11-11 rcitach add version get

import("core.project.config")
import("core.project.project")
import("core.base.option")
Expand Down Expand Up @@ -69,6 +70,7 @@ function deploy_package(rootfs)
local repo = instance:repo()
local packagename = requireinfo.originstr
local installdir = instance:installdir()
local version = instance:version_str()
local repodir = repo:url()
local reponame = repo:name()
if string.find(packagename, "%s") then
Expand All @@ -78,7 +80,7 @@ function deploy_package(rootfs)
path.join(repodir, "packages", packagename:sub(1, 1), packagename, "scripts", "deploy.lua")
if os.isfile(deploy_script) then
vprint("run script => '%s'", deploy_script)
import("deploy", {rootdir = path.directory(deploy_script)}).main(rootfs, installdir)
import("deploy", {rootdir = path.directory(deploy_script)}).main(rootfs, installdir, version)
end
local package_rootfs = path.join(repodir, "packages", packagename:sub(1, 1), packagename, "rootfs")
if os.isdir(package_rootfs) then
Expand Down

0 comments on commit 6d04656

Please sign in to comment.