| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
busybox: rename applets module to busybox After renaming src/applets to src/busybox, update all code references: - Module path: crate::applets:: -> crate::busybox:: - Macro name: register_applets! -> register_busybox_applets! - Build script: generate_applets_modules() -> generate_busybox_modules() - Generated file: applets_modules.rs -> busybox_modules.rs - .gitignore: /src/applets/_modules_gen.rs -> /src/busybox/_modules_gen.rs - Test directory: tests/applets/rpm -> tests/busybox/rpm - Docs: consolidate tests/applets and tests/busybox descriptions The "applet" term is retained in comments and user-facing strings as it is the standard busybox terminology for subcommands. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: add -u/--uid option to adduser command Root Cause Analysis: - Alpine packages like man-db use 'adduser -u 13 man' in post-install scripts - epkg's adduser implementation was missing the -u/--uid option - This caused parse failure: "error: unexpected argument '-u' found" - UserAddOptions struct already has uid field, just missing CLI arg definition Solution: - Add -u/--uid argument to adduser command() definition - Parse uid value in parse_options() and pass to UserAddOptions Fixes: Failed to parse command line: adduser -S -D -H -h /var/cache/man -s /sbin/nologin -G man -g man -u 13 man error: unexpected argument '-u' found libkrun: downgrade session done failure log to debug Problem: - After VM shutdown, socket file no longer exists - send_session_done_unix() fails with "No such file or directory" - This is expected behavior, not a real error Solution: - Change log level from WARN to DEBUG since this is normal VM shutdown behavior - The code comment already says "ignore errors if VM already shut down" Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
busybox: support common upstream CLI options in apt/apk/dnf shims Problem: - Busybox shims only supported the most basic options - Setting config flags required 5 individual set_xxx() functions, each acquiring the config RwLock separately Solution: - Replace 5 individual setters with ConfigFlags struct + apply_config_flags() for atomic config application (single lock acquisition) - Extend PmParams with dry_run/download_only/ignore_missing + add Default derive - apt: add -s/--dry-run, -d/--download-only, -m/--ignore-missing, -f/--fix-broken, -t/--target-release, --no-install-recommends, --reinstall - apk: add --no-cache, -U/--update-cache, -q/--quiet, -t/--virtual - dnf: add --nogpgcheck, -q/--quiet - Wire supportable flags to epkg backend; accept and ignore unsupported ones Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
busybox: support common upstream CLI options in apt/apk/dnf shims Problem: - Busybox shims only supported the most basic options - Setting config flags required 5 individual set_xxx() functions, each acquiring the config RwLock separately Solution: - Replace 5 individual setters with ConfigFlags struct + apply_config_flags() for atomic config application (single lock acquisition) - Extend PmParams with dry_run/download_only/ignore_missing + add Default derive - apt: add -s/--dry-run, -d/--download-only, -m/--ignore-missing, -f/--fix-broken, -t/--target-release, --no-install-recommends, --reinstall - apk: add --no-cache, -U/--update-cache, -q/--quiet, -t/--virtual - dnf: add --nogpgcheck, -q/--quiet - Wire supportable flags to epkg backend; accept and ignore unsupported ones Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
busybox: add apk/apt/apt-get/dnf/yum package manager compatibility shims Add Linux-only busybox applets that mimic common package manager command interfaces, reusing epkg's existing backend functions: - apk: Alpine apk compatibility (add, del, info, list, search, update, upgrade) - apt/apt-get: Debian/Ubuntu apt compatibility (install, remove, purge, update, upgrade, show, list, search) - dnf/yum: Fedora/RHEL dnf compatibility (install, remove, info, list, search, update, upgrade, provides) Commands are implemented as clap subcommands matching real package manager CLI. Backend calls epkg functions directly: - install_packages() / remove_packages() / upgrade_packages() - search::search_repo_cache() with SearchOptions - info::show_package_info() / list::list_packages_with_scope() show_package_info() and other backend functions handle their own initialization (sync_channel_metadata, load_installed_packages), simplifying all callers. All applets are LINUX_ONLY since they target Linux distribution package workflows. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: rename applets module to busybox After renaming src/applets to src/busybox, update all code references: - Module path: crate::applets:: -> crate::busybox:: - Macro name: register_applets! -> register_busybox_applets! - Build script: generate_applets_modules() -> generate_busybox_modules() - Generated file: applets_modules.rs -> busybox_modules.rs - .gitignore: /src/applets/_modules_gen.rs -> /src/busybox/_modules_gen.rs - Test directory: tests/applets/rpm -> tests/busybox/rpm - Docs: consolidate tests/applets and tests/busybox descriptions The "applet" term is retained in comments and user-facing strings as it is the standard busybox terminology for subcommands. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: rename applets module to busybox After renaming src/applets to src/busybox, update all code references: - Module path: crate::applets:: -> crate::busybox:: - Macro name: register_applets! -> register_busybox_applets! - Build script: generate_applets_modules() -> generate_busybox_modules() - Generated file: applets_modules.rs -> busybox_modules.rs - .gitignore: /src/applets/_modules_gen.rs -> /src/busybox/_modules_gen.rs - Test directory: tests/applets/rpm -> tests/busybox/rpm - Docs: consolidate tests/applets and tests/busybox descriptions The "applet" term is retained in comments and user-facing strings as it is the standard busybox terminology for subcommands. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: rename applets module to busybox After renaming src/applets to src/busybox, update all code references: - Module path: crate::applets:: -> crate::busybox:: - Macro name: register_applets! -> register_busybox_applets! - Build script: generate_applets_modules() -> generate_busybox_modules() - Generated file: applets_modules.rs -> busybox_modules.rs - .gitignore: /src/applets/_modules_gen.rs -> /src/busybox/_modules_gen.rs - Test directory: tests/applets/rpm -> tests/busybox/rpm - Docs: consolidate tests/applets and tests/busybox descriptions The "applet" term is retained in comments and user-facing strings as it is the standard busybox terminology for subcommands. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: use symlink_for_native() for host CLI tools Problem: Busybox applets like cp, ln, tar run on the host system. On Windows, cp.exe/ln.exe should create native Windows symlinks, not virtiofs symlinks (which are only meaningful inside VM). Solution: Change all busybox applets to use symlink_for_native(): - cp.rs: cp -s creates symbolic links - ln.rs: ln -s creates symbolic links - tar.rs: tar extraction creates symlinks - update_alternatives.rs: manages alternative symlinks - systemd_tmpfiles.rs: creates tmpfiles symlinks - deb_systemd_helper.rs: manages systemd unit symlinks - lua/lposix.rs: posix.symlink() Lua binding On Unix, symlink_for_native() is equivalent to symlink(). On Windows, it creates native Windows symlinks (or hardlink/copy fallback). Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: use symlink_for_native() for host CLI tools Problem: Busybox applets like cp, ln, tar run on the host system. On Windows, cp.exe/ln.exe should create native Windows symlinks, not virtiofs symlinks (which are only meaningful inside VM). Solution: Change all busybox applets to use symlink_for_native(): - cp.rs: cp -s creates symbolic links - ln.rs: ln -s creates symbolic links - tar.rs: tar extraction creates symlinks - update_alternatives.rs: manages alternative symlinks - systemd_tmpfiles.rs: creates tmpfiles symlinks - deb_systemd_helper.rs: manages systemd unit symlinks - lua/lposix.rs: posix.symlink() Lua binding On Unix, symlink_for_native() is equivalent to symlink(). On Windows, it creates native Windows symlinks (or hardlink/copy fallback). Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: rename applets module to busybox After renaming src/applets to src/busybox, update all code references: - Module path: crate::applets:: -> crate::busybox:: - Macro name: register_applets! -> register_busybox_applets! - Build script: generate_applets_modules() -> generate_busybox_modules() - Generated file: applets_modules.rs -> busybox_modules.rs - .gitignore: /src/applets/_modules_gen.rs -> /src/busybox/_modules_gen.rs - Test directory: tests/applets/rpm -> tests/busybox/rpm - Docs: consolidate tests/applets and tests/busybox descriptions The "applet" term is retained in comments and user-facing strings as it is the standard busybox terminology for subcommands. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: rename applets module to busybox After renaming src/applets to src/busybox, update all code references: - Module path: crate::applets:: -> crate::busybox:: - Macro name: register_applets! -> register_busybox_applets! - Build script: generate_applets_modules() -> generate_busybox_modules() - Generated file: applets_modules.rs -> busybox_modules.rs - .gitignore: /src/applets/_modules_gen.rs -> /src/busybox/_modules_gen.rs - Test directory: tests/applets/rpm -> tests/busybox/rpm - Docs: consolidate tests/applets and tests/busybox descriptions The "applet" term is retained in comments and user-facing strings as it is the standard busybox terminology for subcommands. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: fix df to check path existence before matching mount point Problem: When user specifies a non-existent path like '/aaa', df incorrectly matched it to '/' mount point (since any path starts with '/'). Expected behavior (busybox df): df /aaa -> "df: /aaa: can't find mount point" Actual behavior (epkg df): df /aaa -> shows '/' mount point info Root Cause Analysis: - The condition path.starts_with(mount_point) matches any path to '/' - busybox df checks path existence before matching mount point - Non-existent paths should error out, not fallback to parent mount Solution: - Split matching logic into two parts: 1. Exact match on device name or mount point (no existence check) 2. Path existence check before prefix matching mount point - Update error message to match busybox format Fixes: epkg busybox df /aaa Before: shows '/' mount point info After: /aaa: can't find mount point Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: support common upstream CLI options in apt/apk/dnf shims Problem: - Busybox shims only supported the most basic options - Setting config flags required 5 individual set_xxx() functions, each acquiring the config RwLock separately Solution: - Replace 5 individual setters with ConfigFlags struct + apply_config_flags() for atomic config application (single lock acquisition) - Extend PmParams with dry_run/download_only/ignore_missing + add Default derive - apt: add -s/--dry-run, -d/--download-only, -m/--ignore-missing, -f/--fix-broken, -t/--target-release, --no-install-recommends, --reinstall - apk: add --no-cache, -U/--update-cache, -q/--quiet, -t/--virtual - dnf: add --nogpgcheck, -q/--quiet - Wire supportable flags to epkg backend; accept and ignore unsupported ones Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
busybox: rename applets module to busybox After renaming src/applets to src/busybox, update all code references: - Module path: crate::applets:: -> crate::busybox:: - Macro name: register_applets! -> register_busybox_applets! - Build script: generate_applets_modules() -> generate_busybox_modules() - Generated file: applets_modules.rs -> busybox_modules.rs - .gitignore: /src/applets/_modules_gen.rs -> /src/busybox/_modules_gen.rs - Test directory: tests/applets/rpm -> tests/busybox/rpm - Docs: consolidate tests/applets and tests/busybox descriptions The "applet" term is retained in comments and user-facing strings as it is the standard busybox terminology for subcommands. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
dpkg_divert: fix is_dir() following symlinks on merged-usr systems Root Cause Analysis: - The check Path::new(&path).is_dir() calls metadata() which follows symlinks - On merged-usr systems, /bin is a symlink to /usr/bin - is_dir() returns true because it checks the target /usr/bin (a directory) - This incorrectly rejects diverting /bin with error: "dpkg-divert: error: cannot divert directory: '/bin' -> '/bin.usr-is-merged'" Solution: - Use symlink_metadata() instead to check the symlink itself - This only rejects real directories, not symlinks pointing to directories Fixes: epkg dpkg-divert --add --no-rename /bin Error: dpkg-divert: error: cannot divert directory: '/bin' -> '/bin.usr-is-merged' Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
lfs: rename vague symlink_to_file/directory() to explicit symlink_file/dir_for_virtiofs() Problem: The function names symlink_to_file() and symlink_to_directory() are vague - they don't clearly indicate whether they create native Windows symlinks or virtiofs/Linux guest symlinks. Solution: - Rename symlink_to_file() -> symlink_file_for_virtiofs() - Rename symlink_to_directory() -> symlink_dir_for_virtiofs() - Add symlink_file_for_native() / symlink_dir_for_native() for Windows host access - Add symlink_for_virtiofs() for generic symlinks (type detected at runtime) - Add symlink_for_native() for generic native symlinks - Update all callers to use explicit function names based on use case: Virtiofs callers (env symlinks for VM): - environment.rs: env symlinks (bin->usr/bin, lib->usr/lib, etc.) - link.rs: package symlinks - tar_extract.rs: extracted symlinks - expose.rs: node_modules, libexec, interpreter symlinks - dpkg_db.rs: dpkg info symlinks - rpm_pkg.rs: RPM extraction symlinks - repo.rs: filelists symlinks - qemu.rs: log symlinks - mount.rs: device symlinks - utils.rs: scriptlet symlinks - xdesktop.rs: desktop file symlinks - busybox/*: applet, alternative, tar, cp, ln, tmpfiles symlinks Native callers (Windows host access): - init.rs: self-install symlinks (epkg binary, kernel, lib64) - tool_wrapper.rs: config symlinks for mirrors - busybox/mod.rs: Windows target applet symlinks The explicit naming makes it clear at each call site whether the symlink is intended for native Windows access or virtiofs/Linux guest visibility. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
rpm: load repo metadata and prioritize repo data for installed packages Problem: - rpm -qa and dpkg-query -l showed packages as "not installed" or missing even though they were installed in the environment - Root cause: similar to list command, query applets didn't call sync_channel_metadata() to load repo data - Additionally, resolve_from_pkgline() and pkgline_to_package_and_installed_info() only tried local store lookup, failing when package.txt didn't exist Solution: - Call sync_channel_metadata() in for_each_package() and select_pkglines() to ensure repo data is loaded - In resolve_from_pkgline(), resolve_from_pkgkey(), and pkgline_to_package_and_installed_info(): prioritize repo lookup (map_pkgkey2package) over local store (map_pkgline2package) - Repo data provides complete info (summary, size, repo name) - Fallback to local store only when repo lookup fails Fixes: rpm -qa and dpkg-query -l now correctly show all installed packages e.g. cmake-4.2.3-h8f6b806_0.x86_64 instead of "not installed" Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
busybox: rename applets module to busybox After renaming src/applets to src/busybox, update all code references: - Module path: crate::applets:: -> crate::busybox:: - Macro name: register_applets! -> register_busybox_applets! - Build script: generate_applets_modules() -> generate_busybox_modules() - Generated file: applets_modules.rs -> busybox_modules.rs - .gitignore: /src/applets/_modules_gen.rs -> /src/busybox/_modules_gen.rs - Test directory: tests/applets/rpm -> tests/busybox/rpm - Docs: consolidate tests/applets and tests/busybox descriptions The "applet" term is retained in comments and user-facing strings as it is the standard busybox terminology for subcommands. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
build: fix macOS cross-compile (unix helpers, sync) - Move validate_user_group_name() to userdb so groupadd and systemd-sysusers do not depend on the Linux-only systemd_sysusers module. - Compile remove_user_from_group() on all targets; implementation is file-based and needed by deluser on macOS. - Expose resolve_vm_cpus() and resolve_vm_memory_mib() for libkrun on Darwin (logic is not Linux-specific). - sync --data: use libc::fsync() on non-Linux where fdatasync is absent. Fixes: make cross-macos failed with unresolved import systemd_sysusers, missing resolve_vm_cpus()/resolve_vm_memory_mib(), missing remove_user_from_group(), and libc::fdatasync on aarch64-apple-darwin. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
vm: fix QEMU guest networking for network isolation tests Problem: QEMU VM guest's eth0 network interface was not configured properly: - TSI (Transparent Socket Impersonation) was incorrectly assumed enabled by default when epkg.tsi kernel parameter was not present Root Cause Analysis: init.rs line 388: tsi_enabled default is true when epkg.tsi is absent - TSI only works with libkrun, not QEMU - QEMU needs traditional virtio-net networking Solution: 1. Add epkg.tsi=0 to QEMU kernel command line - Disables TSI, enabling traditional network setup 2. Update test VM-18 to use --installed flag - Avoids network dependency for local package listing Fixes: Test VM-18 timeout issue where epkg list requires network Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
busybox: rename applets module to busybox After renaming src/applets to src/busybox, update all code references: - Module path: crate::applets:: -> crate::busybox:: - Macro name: register_applets! -> register_busybox_applets! - Build script: generate_applets_modules() -> generate_busybox_modules() - Generated file: applets_modules.rs -> busybox_modules.rs - .gitignore: /src/applets/_modules_gen.rs -> /src/busybox/_modules_gen.rs - Test directory: tests/applets/rpm -> tests/busybox/rpm - Docs: consolidate tests/applets and tests/busybox descriptions The "applet" term is retained in comments and user-facing strings as it is the standard busybox terminology for subcommands. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: use symlink_for_native() for host CLI tools Problem: Busybox applets like cp, ln, tar run on the host system. On Windows, cp.exe/ln.exe should create native Windows symlinks, not virtiofs symlinks (which are only meaningful inside VM). Solution: Change all busybox applets to use symlink_for_native(): - cp.rs: cp -s creates symbolic links - ln.rs: ln -s creates symbolic links - tar.rs: tar extraction creates symlinks - update_alternatives.rs: manages alternative symlinks - systemd_tmpfiles.rs: creates tmpfiles symlinks - deb_systemd_helper.rs: manages systemd unit symlinks - lua/lposix.rs: posix.symlink() Lua binding On Unix, symlink_for_native() is equivalent to symlink(). On Windows, it creates native Windows symlinks (or hardlink/copy fallback). Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: add get_uid_name/get_gid_name helpers to avoid nscd query Problem: When /etc/passwd lacks root user, musl's getpwuid(0) falls back to querying nscd daemon via Unix socket /var/run/nscd/socket. TSI intercepts this Unix socket connect() and forwards via vsock, causing indefinite block when host doesn't respond. Root Cause Analysis: - musl getpwuid() reads /etc/passwd first - If user not found, calls __nscd_query() to connect nscd daemon - nscd_query.c: socket(PF_UNIX) + connect("/var/run/nscd/socket") - TSI hijacks Unix socket connect() with HIJACK_UNIX flag - vsock request hangs waiting for host response Solution: Add get_uid_name(uid) and get_gid_name(gid) helpers that: - Return "root" directly for UID/GID 0, avoiding getpwuid/getgrgid - Otherwise call users crate's get_user_by_uid/get_group_by_gid Affected applets: - whoami: use get_uid_name(get_current_uid()) - logname: use get_uid_name(get_current_uid()) - stat: use helpers for %U/%G format and compute_user_names() This is cleaner than modifying /etc/passwd file on disk. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
ls: fix handling of special files (fifo, socket, device) Root Cause Analysis: - metadata.is_file() returns true only for regular files - For special files (fifo, socket, block/char device), it returns false - The old logic: if is_file() { ... } else if is_dir() { ... } else { error } - When path 'a' is a named pipe (fifo), neither condition matched, causing "Not a directory" error Solution: - Change condition to !metadata.is_dir() instead of is_file() - For any non-directory file type, list it as a single entry - Simplifies logic: 2 branches instead of 3, removes unreachable error case Fixes: $ epkg busybox ls a Error: ls: a: Not a directory $ ls -la a prw-rw-r-- 1 wfg wfg 0 May 1 09:04 a (named pipe) Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
build: enable busybox applets on Windows by relaxing UNIX_ONLY Previously, several core applets (cp, mkdir, mktemp, test, touch, uname) were restricted to Unix platforms via UNIX_ONLY in build.rs, causing compilation failures on Windows. Relax UNIX_ONLY by moving these applets out of the list, allowing them to be built on all targets. Implement Windows-specific paths: - cp: hardlink deduplication uses device/inode on Unix; returns None on Windows (no stable file id in std), skipping hardlink optimization - mkdir: octal mode (-m) applied only on Unix; ignored on Windows - mktemp: use TMP/TEMP/temp_dir for temp directory, getrandom for random suffix, retry loops for create_new/create_dir - test: cfg-gate PermissionsExt for -r/-w/-x permission checks - touch: posix_utime on Unix, filetime::set_file_times on Windows - uname: Windows output from COMPUTERNAME, OS env, std::env::consts Also fix install.rs: call crate::plan::pkgkey2new_pkg_info in #[cfg(not(unix))] block to resolve E0425 compilation error on Windows. This enables successful 'cargo check --target x86_64-pc-windows-gnu' for the busybox applet suite. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
build: fix warnings in cross-macos and cross-windows builds Problem: - cross-macos and cross-windows builds had many warnings due to conditional compilation (#[cfg(unix)], #[cfg(target_os = "linux")]) - Unused imports, variables, and unreachable code warnings appeared when compiling for non-Unix targets Solution: - Add #[cfg(unix)] or #[cfg(target_os = "linux")] attributes to imports that are only used in Unix-specific code blocks - Use underscore prefix (_var) for variables that are conditionally used - Add #[allow(unused)] and #[allow(unreachable_code)] where appropriate - Fix unreachable code patterns in conditional compilation blocks Modified files: - src/risks.rs: OsStrExt import conditionally compiled for Linux only - src/run.rs: Multiple Unix-specific imports and function parameters - src/main.rs: Unix-specific imports and command functions - src/dirs.rs, src/download/aur.rs, src/download/orchestration.rs - src/install.rs, src/io.rs, src/repo.rs, src/utils.rs - src/busybox/{mkfifo,rmdir,mod,update_alternatives,deb_systemd_helper}.rs - src/depends.rs, src/expose.rs, src/shebang.rs, src/store.rs - src/conda_link.rs Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
msys2: add cross-platform tests and enable Windows hash Problem/Purpose: - epkg on Windows used "unknown" as package hash prefix - No tests existed for MSYS2 channel on Windows Solution: 1. Enable cross-platform content-addressable hash calculation: - hash.rs: make Unix-specific imports and file type checks conditional - main.rs: remove #[cfg(unix)] gates from hash module and command - store.rs: call epkg_store_hash() on all platforms 2. Fix MSYS2 channel URL structure: - msys repo: $mirror/msys/$arch/$repo.files.tar.zst - mingw repos: $mirror/mingw/$repo/$repo.files.tar.zst - mingw repos don't have $arch subdirectory 3. Add MSYS2 test suite: - tests/cross-platform/channels/msys2.sh - Skip nodejs (mingw packages install to mingw64/bin/) - Skip go (not available in MSYS2 repos) - Skip numpy/scipy/scikit-learn (not available in MSYS2 repos) 4. Fix build warnings in mktemp.rs: - Prefix unused variable with underscore: Err(_e) if quiet Usage: ENV_NAME=test-msys2 EPKG_BIN=/path/to/epkg ./tests/cross-platform/channels/msys2.sh Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
main: fix VM session routing for install/upgrade commands Problem: - When epkg run --isolate=vm sleep 10 is running - epkg upgrade returns exit code 127 with no output - Expected: "No changes planned" with exit code 0 Root causes: 1. Routing used host's epkg path (macOS binary) inside Linux VM 2. Guest epkg expected ~/.cache/epkg but host uses ~/Library/Caches/epkg 3. is_inside_vm() failed to detect libkrun VM (no DMI info) Solution: 1. Use /usr/bin/epkg (guest's Linux binary) for VM routing 2. Set EPKG_CACHE env var to host's cache path for guest 3. Add libkrun detection: check for "-sandbox" in kernel version Verification: - epkg run --isolate=vm sleep 10 (running) - epkg upgrade returns exit code 0 correctly - Parallel execution still works (0s return for second command) Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
modprobe: skip expensive glob searches when modules dir missing Problem: - modprobe spent ~10s doing repeated glob searches for modules that don't exist when /lib/modules/\$(uname -r) is missing - init.rs manually loaded failover/net_failover before virtio_net, but modprobe already handles dependencies via modules.dep Solution: 1. modprobe.rs: Add early exit in find_module_file() when base_path doesn't exist, skipping expensive glob searches 2. init.rs: Remove manual failover/net_failover loading - let modprobe handle dependencies via modules.dep Result: VM boot time reduced from ~10s to ~0.4s for modprobe phase Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: pass mount data as string options Fix busybox mount to pass source/fstype/data using string references expected by nix::mount, avoiding invalid mount data encoding that triggered EINVAL for tmpfs mounts. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
utils: replace unsafe libc::isatty() with std::io::is_terminal() Problem: Using unsafe libc::isatty() for TTY detection is unnecessarily dangerous when Rust's std::io::IsTerminal trait provides the same functionality safely. Solution: Replace all unsafe libc::isatty() calls with the safe and modern std::io::stdin/stdout/stderr().is_terminal() method. Files changed: - busybox/nohup.rs: stdout/stderr TTY check - busybox/rpmlua.rs: stdin/stdout TTY check for interactive mode - utils.rs: stdin TTY check for auto-confirm Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
printf: remove unused functions and fix warning Remove dead code: - format_printf() - old implementation replaced by run_printf() - parse_numeric_arg() - only used by format_printf() - parse_numeric_arg_float() - only used by format_printf() - format_integer() - only used by format_printf() - apply_width() - only used by format_printf() Fix warning: stopped_by_c assignment was never read because the function returns immediately after \c is encountered. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
cross-platform: mark Linux-only functions and fields with #[cfg] Problem: - macOS build showed warnings about unused functions and fields - These are Linux-only features that should not compile on macOS Solution: - Add #[cfg(target_os = "linux")] to Linux-only items: - posix.rs: call_libc_path_mode, posix_mkfifo, PosixPasswd, posix_getpasswd, PosixGroup, posix_getgroup - io.rs: update_system_channel_configs, load_pending_packages, load_installed_packages_with_pending, load_system_repositories - utils.rs: normalize_file_path, list_package_file_paths_normalized, truncate_display, safe_mkdir_p, write_scriptlet_content - package.rs: pkgkey2arch, PackageNVRA - epkg.rs: unpack_package - packages_stream.rs: new_with_hash_type, on_essential, handle_chunk, partial_line, process_line fields - plan.rs: deb_*_triggers_by_* fields - hooks.rs: run_in_env - userdb.rs: remove_user_from_group - scriptlets.rs: setup_apk_env_vars - repo.rs: components field in RepoRevise - busybox/realpath.rs: root, admindir fields in RealpathOptions - Fix unused imports on non-Linux platforms: - packages_stream.rs: Sha512 - hooks.rs: RunOptions, fork_and_execute Key insight: These functions/fields are only used by Linux-only package formats (DEB, RPM, APK) or Linux-only applets (dpkg-*, rpm). Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
build: fix warnings in cross-macos and cross-windows builds Problem: - cross-macos and cross-windows builds had many warnings due to conditional compilation (#[cfg(unix)], #[cfg(target_os = "linux")]) - Unused imports, variables, and unreachable code warnings appeared when compiling for non-Unix targets Solution: - Add #[cfg(unix)] or #[cfg(target_os = "linux")] attributes to imports that are only used in Unix-specific code blocks - Use underscore prefix (_var) for variables that are conditionally used - Add #[allow(unused)] and #[allow(unreachable_code)] where appropriate - Fix unreachable code patterns in conditional compilation blocks Modified files: - src/risks.rs: OsStrExt import conditionally compiled for Linux only - src/run.rs: Multiple Unix-specific imports and function parameters - src/main.rs: Unix-specific imports and command functions - src/dirs.rs, src/download/aur.rs, src/download/orchestration.rs - src/install.rs, src/io.rs, src/repo.rs, src/utils.rs - src/busybox/{mkfifo,rmdir,mod,update_alternatives,deb_systemd_helper}.rs - src/depends.rs, src/expose.rs, src/shebang.rs, src/store.rs - src/conda_link.rs Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
rpm: implement --whatprovides using provide2pkgnames index Problem: - rpm -q --whatprovides bash returned "No package provides this capability" - The provides field contains versioned strings like "bash = 5.2.37-7.oe2509" - Exact match against capability name "bash" failed Solution: Add select_packages_by_whatprovides() function: - Uses provide2pkgnames.rkyv index for efficient lookup - Falls back to scanning installed packages' provides field - Uses extract_provide_name() to parse capability names from versioned strings Usage: epkg -e openeuler busybox rpm -q --whatprovides bash epkg -e openeuler busybox rpm -q --whatprovides 'libc.so.6()(64bit)' epkg -e openeuler busybox rpm -q --whatprovides '/bin/sh' Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
utils: replace unsafe libc::isatty() with std::io::is_terminal() Problem: Using unsafe libc::isatty() for TTY detection is unnecessarily dangerous when Rust's std::io::IsTerminal trait provides the same functionality safely. Solution: Replace all unsafe libc::isatty() calls with the safe and modern std::io::stdin/stdout/stderr().is_terminal() method. Files changed: - busybox/nohup.rs: stdout/stderr TTY check - busybox/rpmlua.rs: stdin/stdout TTY check for interactive mode - utils.rs: stdin TTY check for auto-confirm Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
sed: split process_input() into focused helpers process_input_read_first_line(), process_input_peek_next_line(), process_input_line_from_buffer(), process_input_make_apply_input(), process_input_refill_after_n_append(), process_input_swap_peek_to_current() Loop body unchanged in behavior; helpers isolate I/O peek/refill/swap and ApplyCommandsInput build. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: fix printf and seq to pass busybox testsuite printf fixes: - Repeat format string for each argument (e.g., printf '%s\n' foo bar -> foo\nbar\n) - Support z, L, j, t length modifiers (treated as d/i/u) - Handle negative width/precision from * arguments (left-align when width is negative) - Support single-quote character arguments for %d/%i (e.g., '"x' -> 120) - Report error and abort for invalid formats (bare %, %r) - Handle \c in format string to stop output after processing format specifiers - Output error messages immediately for invalid numbers, continue processing seq fixes: - Add trailing newline when separator is newline - Handle zero increment case (output repeated values, limited by head) - Fix -w option: use input string width (003 -> width 3) not computed width - Fix precision: use increment's precision for three-argument form - Fix two-argument form: when first > last, output empty (default increment is 1) Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: add get_uid_name/get_gid_name helpers to avoid nscd query Problem: When /etc/passwd lacks root user, musl's getpwuid(0) falls back to querying nscd daemon via Unix socket /var/run/nscd/socket. TSI intercepts this Unix socket connect() and forwards via vsock, causing indefinite block when host doesn't respond. Root Cause Analysis: - musl getpwuid() reads /etc/passwd first - If user not found, calls __nscd_query() to connect nscd daemon - nscd_query.c: socket(PF_UNIX) + connect("/var/run/nscd/socket") - TSI hijacks Unix socket connect() with HIJACK_UNIX flag - vsock request hangs waiting for host response Solution: Add get_uid_name(uid) and get_gid_name(gid) helpers that: - Return "root" directly for UID/GID 0, avoiding getpwuid/getgrgid - Otherwise call users crate's get_user_by_uid/get_group_by_gid Affected applets: - whoami: use get_uid_name(get_current_uid()) - logname: use get_uid_name(get_current_uid()) - stat: use helpers for %U/%G format and compute_user_names() This is cleaner than modifying /etc/passwd file on disk. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
build: fix macOS cross-compile (unix helpers, sync) - Move validate_user_group_name() to userdb so groupadd and systemd-sysusers do not depend on the Linux-only systemd_sysusers module. - Compile remove_user_from_group() on all targets; implementation is file-based and needed by deluser on macOS. - Expose resolve_vm_cpus() and resolve_vm_memory_mib() for libkrun on Darwin (logic is not Linux-specific). - sync --data: use libc::fsync() on non-Linux where fdatasync is absent. Fixes: make cross-macos failed with unresolved import systemd_sysusers, missing resolve_vm_cpus()/resolve_vm_memory_mib(), missing remove_user_from_group(), and libc::fdatasync on aarch64-apple-darwin. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
build: fix macOS cross-compile (unix helpers, sync) - Move validate_user_group_name() to userdb so groupadd and systemd-sysusers do not depend on the Linux-only systemd_sysusers module. - Compile remove_user_from_group() on all targets; implementation is file-based and needed by deluser on macOS. - Expose resolve_vm_cpus() and resolve_vm_memory_mib() for libkrun on Darwin (logic is not Linux-specific). - sync --data: use libc::fsync() on non-Linux where fdatasync is absent. Fixes: make cross-macos failed with unresolved import systemd_sysusers, missing resolve_vm_cpus()/resolve_vm_memory_mib(), missing remove_user_from_group(), and libc::fdatasync on aarch64-apple-darwin. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
systemd_tmpfiles: skip chown when target UID/GID not mapped in user namespace Root Cause: - In user namespace, only UID/GID 0 is mapped to host values - chown to unmapped GID (e.g., 997) returns EINVAL - systemd_tmpfiles was only handling PermissionDenied, not InvalidInput Error example: Failed to change ownership of /etc/polkit-1/rules.d to uid=Some(0), gid=Some(997): Invalid argument (os error 22) Solution: - Handle ErrorKind::InvalidInput like PermissionDenied - Log warning and skip instead of failing - Installation continues without the ownership change Fixes: systemd_tmpfiles chown fails in user namespace with "Invalid argument (os error 22)" for unmapped GIDs Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: rename applets module to busybox After renaming src/applets to src/busybox, update all code references: - Module path: crate::applets:: -> crate::busybox:: - Macro name: register_applets! -> register_busybox_applets! - Build script: generate_applets_modules() -> generate_busybox_modules() - Generated file: applets_modules.rs -> busybox_modules.rs - .gitignore: /src/applets/_modules_gen.rs -> /src/busybox/_modules_gen.rs - Test directory: tests/applets/rpm -> tests/busybox/rpm - Docs: consolidate tests/applets and tests/busybox descriptions The "applet" term is retained in comments and user-facing strings as it is the standard busybox terminology for subcommands. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: use symlink_for_native() for host CLI tools Problem: Busybox applets like cp, ln, tar run on the host system. On Windows, cp.exe/ln.exe should create native Windows symlinks, not virtiofs symlinks (which are only meaningful inside VM). Solution: Change all busybox applets to use symlink_for_native(): - cp.rs: cp -s creates symbolic links - ln.rs: ln -s creates symbolic links - tar.rs: tar extraction creates symlinks - update_alternatives.rs: manages alternative symlinks - systemd_tmpfiles.rs: creates tmpfiles symlinks - deb_systemd_helper.rs: manages systemd unit symlinks - lua/lposix.rs: posix.symlink() Lua binding On Unix, symlink_for_native() is equivalent to symlink(). On Windows, it creates native Windows symlinks (or hardlink/copy fallback). Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
build: enable busybox applets on Windows by relaxing UNIX_ONLY Previously, several core applets (cp, mkdir, mktemp, test, touch, uname) were restricted to Unix platforms via UNIX_ONLY in build.rs, causing compilation failures on Windows. Relax UNIX_ONLY by moving these applets out of the list, allowing them to be built on all targets. Implement Windows-specific paths: - cp: hardlink deduplication uses device/inode on Unix; returns None on Windows (no stable file id in std), skipping hardlink optimization - mkdir: octal mode (-m) applied only on Unix; ignored on Windows - mktemp: use TMP/TEMP/temp_dir for temp directory, getrandom for random suffix, retry loops for create_new/create_dir - test: cfg-gate PermissionsExt for -r/-w/-x permission checks - touch: posix_utime on Unix, filetime::set_file_times on Windows - uname: Windows output from COMPUTERNAME, OS env, std::env::consts Also fix install.rs: call crate::plan::pkgkey2new_pkg_info in #[cfg(not(unix))] block to resolve E0425 compilation error on Windows. This enables successful 'cargo check --target x86_64-pc-windows-gnu' for the busybox applet suite. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
build: enable busybox applets on Windows by relaxing UNIX_ONLY Previously, several core applets (cp, mkdir, mktemp, test, touch, uname) were restricted to Unix platforms via UNIX_ONLY in build.rs, causing compilation failures on Windows. Relax UNIX_ONLY by moving these applets out of the list, allowing them to be built on all targets. Implement Windows-specific paths: - cp: hardlink deduplication uses device/inode on Unix; returns None on Windows (no stable file id in std), skipping hardlink optimization - mkdir: octal mode (-m) applied only on Unix; ignored on Windows - mktemp: use TMP/TEMP/temp_dir for temp directory, getrandom for random suffix, retry loops for create_new/create_dir - test: cfg-gate PermissionsExt for -r/-w/-x permission checks - touch: posix_utime on Unix, filetime::set_file_times on Windows - uname: Windows output from COMPUTERNAME, OS env, std::env::consts Also fix install.rs: call crate::plan::pkgkey2new_pkg_info in #[cfg(not(unix))] block to resolve E0425 compilation error on Windows. This enables successful 'cargo check --target x86_64-pc-windows-gnu' for the busybox applet suite. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
build: enable busybox applets on Windows by relaxing UNIX_ONLY Previously, several core applets (cp, mkdir, mktemp, test, touch, uname) were restricted to Unix platforms via UNIX_ONLY in build.rs, causing compilation failures on Windows. Relax UNIX_ONLY by moving these applets out of the list, allowing them to be built on all targets. Implement Windows-specific paths: - cp: hardlink deduplication uses device/inode on Unix; returns None on Windows (no stable file id in std), skipping hardlink optimization - mkdir: octal mode (-m) applied only on Unix; ignored on Windows - mktemp: use TMP/TEMP/temp_dir for temp directory, getrandom for random suffix, retry loops for create_new/create_dir - test: cfg-gate PermissionsExt for -r/-w/-x permission checks - touch: posix_utime on Unix, filetime::set_file_times on Windows - uname: Windows output from COMPUTERNAME, OS env, std::env::consts Also fix install.rs: call crate::plan::pkgkey2new_pkg_info in #[cfg(not(unix))] block to resolve E0425 compilation error on Windows. This enables successful 'cargo check --target x86_64-pc-windows-gnu' for the busybox applet suite. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: rename applets module to busybox After renaming src/applets to src/busybox, update all code references: - Module path: crate::applets:: -> crate::busybox:: - Macro name: register_applets! -> register_busybox_applets! - Build script: generate_applets_modules() -> generate_busybox_modules() - Generated file: applets_modules.rs -> busybox_modules.rs - .gitignore: /src/applets/_modules_gen.rs -> /src/busybox/_modules_gen.rs - Test directory: tests/applets/rpm -> tests/busybox/rpm - Docs: consolidate tests/applets and tests/busybox descriptions The "applet" term is retained in comments and user-facing strings as it is the standard busybox terminology for subcommands. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: add --family option to update-alternatives Problem: - Java post-install scripts use update-alternatives --install ... --family - The --family option was not supported, causing package installation failures Solution: - Add --family option to update-alternatives command - Accept but ignore the family parameter (grouping alternatives by family is not implemented, but accepting the option allows scripts to run) Testing: - elixir test on openeuler now passes - java-1.8.0-openjdk post-install script no longer fails Also: - Filter 'useradd: Warning:' in test common.sh to avoid false test failures from shadow package post-install warnings about missing nologin shell Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
download, repo, wget: use symlink_file_for_native() for host cache symlinks Problem: Cache symlinks are created on the host filesystem for package downloads and repo metadata. They should be native Windows symlinks for host access, not virtiofs symlinks which are only meaningful inside VM. Files fixed: - download/file_ops.rs: cache symlinks (global->local path) - repo.rs: filelists symlinks in channel cache - busybox/wget.rs: download output symlink to cached file Note: xdesktop.rs correctly uses virtiofs because its target is in env_root (Linux packages accessed via VM), while the files fixed here have targets in the host cache directory. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: add get_uid_name/get_gid_name helpers to avoid nscd query Problem: When /etc/passwd lacks root user, musl's getpwuid(0) falls back to querying nscd daemon via Unix socket /var/run/nscd/socket. TSI intercepts this Unix socket connect() and forwards via vsock, causing indefinite block when host doesn't respond. Root Cause Analysis: - musl getpwuid() reads /etc/passwd first - If user not found, calls __nscd_query() to connect nscd daemon - nscd_query.c: socket(PF_UNIX) + connect("/var/run/nscd/socket") - TSI hijacks Unix socket connect() with HIJACK_UNIX flag - vsock request hangs waiting for host response Solution: Add get_uid_name(uid) and get_gid_name(gid) helpers that: - Return "root" directly for UID/GID 0, avoiding getpwuid/getgrgid - Otherwise call users crate's get_user_by_uid/get_group_by_gid Affected applets: - whoami: use get_uid_name(get_current_uid()) - logname: use get_uid_name(get_current_uid()) - stat: use helpers for %U/%G format and compute_user_names() This is cleaner than modifying /etc/passwd file on disk. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 | |
busybox: add apk/apt/apt-get/dnf/yum package manager compatibility shims Add Linux-only busybox applets that mimic common package manager command interfaces, reusing epkg's existing backend functions: - apk: Alpine apk compatibility (add, del, info, list, search, update, upgrade) - apt/apt-get: Debian/Ubuntu apt compatibility (install, remove, purge, update, upgrade, show, list, search) - dnf/yum: Fedora/RHEL dnf compatibility (install, remove, info, list, search, update, upgrade, provides) Commands are implemented as clap subcommands matching real package manager CLI. Backend calls epkg functions directly: - install_packages() / remove_packages() / upgrade_packages() - search::search_repo_cache() with SearchOptions - info::show_package_info() / list::list_packages_with_scope() show_package_info() and other backend functions handle their own initialization (sync_channel_metadata, load_installed_packages), simplifying all callers. All applets are LINUX_ONLY since they target Linux distribution package workflows. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
applets: rename dir to busybox busybox 目录名的优势 ┌──────────┬───────────────────────────────────────────────────────┐ │ 方面 │ 说明 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 语义明确 │ 熟悉 Linux 的开发者立即理解:单二进制、符号链接多入口 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 行业标准 │ busybox 模式是业界通用术语,便于沟通 │ ├──────────┼───────────────────────────────────────────────────────┤ │ 自描述 │ 名字本身就说明了实现方式和用途 │ └──────────┴───────────────────────────────────────────────────────┘ Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 4 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 4 个月前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 3 个月前 | ||
| 4 个月前 |