Commit Graph

193 Commits

Author SHA1 Message Date
myml 1f25cfc3b0 refactor: simplify environment variable handling in systemd generator
1. Removed debug logging code that was checking for script readability
2. Changed from direct export to echo output for systemd environment
handling
3. Simplified the logic by removing redundant checks since systemd
generators expect echo output
4. The change aligns better with systemd's environment generator
expectations where variables should be echoed rather than exported
directly

refactor: 简化 systemd 生成器中的环境变量处理

1. 移除了检查脚本可读性的调试日志代码
2. 将直接导出改为 echo 输出以适配 systemd 环境处理
3. 通过移除冗余检查简化了逻辑,因为 systemd 生成器期望 echo 输出
4. 此变更更符合 systemd 环境生成器的预期,变量应该通过 echo 输出而非直接
导出
2025-07-08 14:49:12 +08:00
reddevillg 2b1dc8879c fix: Isolate app-specific patches in dedicated directories
Previously, app-specific patches were identified by matching the patch
filename (without the extension) against the application ID. This
approach was flawed as it caused patch conflicts between different
applications. For example, a patch named `com.app.A.json`, intended
only for `com.app.A`, would be incorrectly applied as a global patch
to `com.app.B`.

This commit introduces a directory-based mechanism to correctly isolate
application-specific patches. All patches for a specific app must now
reside within a subdirectory named after the app ID.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-02 10:51:03 +08:00
ComixHe c431ac0602 refactor: some scripts that export env 'XDG_DATA_DIRS'
Signed-off-by: ComixHe <ComixHe1895@outlook.com>
2025-07-02 10:51:03 +08:00
Felix Yan ac960854e8 fix: don't hardcode libexec dir
Use `CMAKE_INSTALL_FULL_LIBEXECDIR` so that setting `CMAKE_INSTALL_LIBEXECDIR` changes `LIBEXEC_LINGLONG_DIR` accordingly.
2025-07-02 10:51:03 +08:00
reddevillg af9af89c85 fix: fix build failure caused by removed file
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-06-20 14:54:51 +08:00
reddevillg 5203e92111 fix: remove unused old config
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-06-20 14:54:51 +08:00
dengbo 98165a3912 fix: failed to export XDG_DATA_DIRS enviroment
Path "/usr/local/share:/usr/share" must be set when XDG_DATA_DIRS is
empty.
2025-06-16 15:23:00 +08:00
dengbo b54fd561aa feat: add hooks features
Add hooks features for app install.
2025-06-06 17:33:22 +08:00
reddevillg c6386bdfe5 feat: modify the way container patches work
1. provide application level patches
2. application level patches will apply after global patches

move configure.h.in to src root, becasue lib utils depends on QT,
we don't want to introduce QT in certain scenarios.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-06-04 14:45:07 +08:00
dengbo 286d413070 fix: export desktop to a invalid export path
1. The custom desktop exported directory(CUSTOM_DATA_DIR) should only be in the share dir, not in the subdirectory;
2. LINGLONG_DATA_DIR should be exported;
3. need to update LINGLONG_EXPORT_VERSION to fix export.
2025-06-04 14:10:12 +08:00
ice909 db3a9dc4ce feat: improve shell completions to show only apps when appropriate
This change enhances both bash and zsh completions for the ll-cli tool
by:
1. Adding a new function to specifically list installed applications
2. Updating the run, uninstall, and content commands to show only apps
   in their tab completion suggestions instead of all installed
components
3. Making the completion more contextually relevant for these commands
2025-05-13 11:34:59 +08:00
ice909 d9d0a802c6 feat: support specifying the desktop installation directory
Specify 'LINGLONG_DESKTOP_EXPORT_PATH' during compilation.

Signed-off-by: ice909 <gaochang1@uniontech.com>
2025-04-27 14:21:10 +08:00
ice909 63263e8a29 fix: zsh completion failed
"_values:compvalues:11: not enough arguments"

Signed-off-by: ice909 <gaochang1@uniontech.com>
2025-04-25 13:03:58 +08:00
ice909 605b8eff45 fix: add the --no-same-owner parameter to avoid tar unpack errors
Signed-off-by: ice909 <gaochang1@uniontech.com>
2025-04-24 17:59:53 +08:00
ice909 72f9be6bdb chore: update completion script
Install with ./ prefix will only list local files and won't search online.

Signed-off-by: ice909 <gaochang1@uniontech.com>
2025-04-21 14:33:52 +08:00
ComixHe 306ff229f5 fix: failed to generate ldcache
remove 'RootfsPropagation' which cause to container failed to start

Signed-off-by: ComixHe <heyuming@deepin.org>
2025-04-11 17:14:58 +08:00
ice909 33f5913209 feat: extract the export paths as a config file
Signed-off-by: ice909 <gaochang1@uniontech.com>
2025-04-07 17:14:27 +08:00
ComixHe 468466df1f chore: suppress error while executing systemd-generator
file or directory may not exist

Signed-off-by: ComixHe <heyuming@deepin.org>
2025-04-07 13:03:20 +08:00
myml 17276ba01d fix: adjust container mount items
在之前的提交中, 本应删除/tmp挂载, 却误删了/dev的挂载
2025-03-26 09:34:49 +08:00
myml a11b66d9e3 fix: no free space when installing dependencies
tmp目录被挂载成tmpfs并且设置了64M大小, 导致安装deb依赖时报错
现在会在宿主机的tmp目录创建新的临时文件夹做为容器的tmp目录
2025-03-18 20:09:59 +08:00
dengbo 845089d652 fix: app cannot be started immediately after exiting
Mount /tmp to tmpfs to prevent some files sharing.
2025-03-12 09:46:18 +08:00
ice909 c6f4126e54 chore: update bash-completion
Now repo should use alias.

Signed-off-by: ice909 <gaochang1@uniontech.com>
2025-03-11 21:22:32 +08:00
dengbo bc206df5be feat: add linglong desktop
Add linglong desktop file to support install uab.
2025-03-11 20:57:55 +08:00
reddevillg 60c5ba8740 feat: Introduce export UAB option --loader
Option --loader=<app_loader> can be used to run app without container
involved. With custom loader, only app's layer will be exported. When
custom loader get started, environment variable LINGLONG_UAB_APPROOT
is the app directory.
2025-02-27 14:28:19 +08:00
ice909 c8d3330c9c feat: add priority to the repo config
The default priority for the stable repository is 0.
When adding a new repository, its priority will be set to the current minimum priority minus 100.
If the new repository is set as the default repository, its priority will be set to the current maximum priority plus 100.
Added the set-priority subcommand to allow manual specification of priorities (duplicates are not allowed).
2025-02-25 14:23:22 +08:00
dengbo fae28f069a fix: uab icon display abnormality
Update generic-icon to universal-application-bundle.
2025-02-24 20:31:35 +08:00
reddevillg f26e6e5046 feat: ll-builder support install package via apt
Provide "build depends" and "depends" for apt build extension, build
phase seperate into build phase and prepare phase. "build depends"
to be installed in build environment before build phase starting, and
preserve in overlayfs. "depends" to be installed in prepare phase, and
will be merged to apps output.
2025-02-24 20:28:37 +08:00
ice909 02f64f65b2 feat: add command automatic completion for zsh
ll-cli in zsh supports automatic completion.
2025-02-24 14:28:40 +08:00
myml 0615abd96c fix: debug symbols not stripped from build artifacts
之前在剥离调试符号的脚本中尝试跳过被剥离的调试符号文件,
但因判断条件错误, 导致未剥离调试符号的二进制文件也被跳过
2025-02-18 10:16:37 +08:00
ice909 4b3fed1f00 feat: add --alias option for repo add
Add the --alias option to set aliases for the 'll-cli repo add' and 'll-builder repo add' commands.

So update, remove, and set-default also need to pass alias instead of name.
2025-02-13 20:29:24 +08:00
reddevillg 21131d055e fix: Fix incorrect path when build prefix is /usr/local
Fix incorrect path when build prefix is /usr/local
2025-02-11 16:39:59 +08:00
ComixHe 715d3a6fb6 chore: ldd-check ignores some libs which under /opt
Signed-off-by: ComixHe <heyuming@deepin.org>
2025-01-09 15:29:34 +08:00
ComixHe d51b9b5b8c chore(uab): add exporting blacklist
Signed-off-by: ComixHe <heyuming@deepin.org>
2025-01-07 11:54:08 +08:00
myml 8544c5a0d6 feat: adjust systemd/user priority
XDG_DATA_DIRS下面的systemd优先级很高, 会影响系统systemd服务
将应用的systemd导出到其他地方, 再使用user-generator复制到优先级最低的generator.late目录
2024-12-25 17:31:40 +08:00
myml 3ac393ad57 feat: cache generation failed when installing modules
安装modules时, 因为缓存文件已存在, 创建目录会失败
2024-12-23 10:45:40 +08:00
ComixHe bb25607b91 refactor(gen): change the way of uising generators
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-12-19 18:21:01 +08:00
ComixHe a39015081c refactor(gen): make all generator as a static library
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-12-18 15:28:04 +08:00
kamiyadm 42263b7072 fix: cannot run application after upgrade cli
* Add dbus method GenerateCache, signal GenerateCacheFinished. (PM)
* Add an exclusive write lock to the application cache in
  ensureCache to ensure that the container runs after the cache
  is generated. (cli)

Log:
2024-12-12 17:26:10 +08:00
kamiyadm 429bd1cc7c refactor: adjust some cache generation and usage behaviors
The caches that have been processed are ld.so.cache and font cache.

Code:
 * Add a new member ContainerBuilder to PackageManager. (package_manager)
 * Add a new scripts to gererate cache in container. (ld-cache-generator/font-cache-generator)
 * Add new func generateCache() to execute app-cache-generator. (pacakge_manager)
 * Add new func removeCache() to remove cache. (package_manager)
 * Mount the cache during running application. (cli)

Mount:(host->container)
 * Remove /var/cache/fontconfig -> /var/cache/fontconfig
 * Add /usr/local/share/fonts -> /usr/local/share/fonts
 * Add /var/lib/linglong/cache/[hash] -> /run/linglong/cache
 * Add /var/lib/linglong/cache/[hash]/fontconfig -> /var/cache/fontconfig

Config: (config.json)
 * Remove the hooks part.
 * Change env LINGLONG_LD_SO_CACHE to /run/linglong/cache/ld.so.cache.

Log:
2024-12-12 17:26:10 +08:00
kamiyadm 5682152a1d feat: add new dialog to show cache generation
-

Log:
2024-12-11 15:05:26 +08:00
ComixHe d2e37dc5cf feat: add permission dialog
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-12-10 18:13:49 +08:00
myml f7a824138f feat: skip debug files when stripping symbols
剥离调试符号时应跳过已存在的debug文件, 这些文件可能是跟随deb导入的
2024-11-25 09:20:56 +08:00
kamiyadm ee9c5dee99 fix: admin user skips authentication during call PM
Default rules is enough. The extra rule allow the admin user
to skip authentication. Just remove it.

Log:
2024-11-20 10:13:31 +08:00
ComixHe ca4f8bc7c7 refactor: re-implement migrate
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-11-19 17:46:22 +08:00
myml 172a51aa5d fix: ldd-check should run ldconfig first
ldd-check在检查之前应该刷新ldconfig缓存,
否则无法找到应用构建生成的so文件
2024-11-15 10:53:05 +08:00
dengbo11 5f416426be fix(builder): example can not build in loong64 arch
Base and runtime do not have loong64 arch, so use org.deepin.base.

Bug: https://pms.uniontech.com/bug-view-284713.html
2024-11-11 17:35:04 +08:00
kamiyadm 09dccbcecc fix: bash-completion error in 'll-cli search'
-

Log:
2024-11-08 17:55:15 +08:00
kamiyadm 21ce364aea fix: no permission to migrate
* Not doing interact before migration, only notification.
* Allow anyone to call WaitForAvailable() by dbus.

Log:
2024-11-05 15:33:04 +08:00
kamiyadm 84e3ec6244 fix: broken bash completions
Both of ll-cli and ll-builder.

Log:
2024-11-05 15:16:17 +08:00
kamiyadm 5c3623d663 fix: check dbus error after read/write the Property of PM
Configuration() and setConfiguration() could be failed. Due to
the limit of dbus permission policy, we should call runningAsRoot()
before setConfiguration().

Log:
2024-11-05 14:34:22 +08:00