Commit Graph

46 Commits

Author SHA1 Message Date
reddevillg 22dd1a8792 Fix: Correct build order and fix private mounting
Move buildMountHome after buildPrivateDir, because it depends on private
directory that are initialized within buildPrivateDir.

Correct private config, cache, state directory mounting.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-17 22:03:23 +08:00
reddevillg 39dcd0b581 fix: add rbind option alongside copy-symlink
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-16 15:48:53 +08:00
reddevillg d9e1e9cd15 fix: treat /etc/localtime as fixed mount node
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-08 14:49:12 +08:00
dengbo 214988c3ac chore: remove unused file
Remove 90_legacy.cpp.
2025-07-04 14:57:11 +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
reddevillg 0149c3cb77 fix: ensure correct localtime and resolv.conf mounting
Mounting may fail if the file types differed between the build layer and
host (e.g., regular file vs. symbolic link).

Implemented solution through two approaches
1. Build phase: Proactively remove /etc/localtime and /etc/resolv.conf
   from base layer during overlayfs preparation to prevent conflicts
   with host.
2. Container configuration: Introduced dedicated buildMountLocalTime
   and buildNetworkConf methods to handle timezone and resolv.conf
   mounts, with enableSelfAdjustingMount properly managing these cases.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-02 10:51:03 +08:00
reddevillg c111b38c69 fix: improve ld.so.cache validation and regeneration
- Add content-based validation for ld.so.conf to detect layer path
  changes
- Include configuration sources hash in ld.so.conf for validation
- In PackageManager GenerateCache always generate cache,
  tryGenerateCache will skip it if cache directory exists
- use memcpy in sha256 to avoid unaligned visit

This ensures that ld.so.cache is properly regenerated when the
underlying layer configuration changes, preventing stale cache issues.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-02 10:51:03 +08:00
ComixHe 2615ac3525 refactor: remove all generators
Signed-off-by: ComixHe <ComixHe1895@outlook.com>
2025-06-11 16:37:05 +08:00
reddevillg d8a3191d2f fix: Preserve host's HOME env in container.
1. Ensure container HOME env matches the host environment exactly, we
   rely on it before support portal well.
2. remove /run/udev bind, udev database path and file across different
   versions are not guaranteed to be compatible.
3. add all_proxy env to defulat forward list.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-06-10 18:15:35 +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 4ed2ad9216 feat: add /etc/hosts to old generators
Bind /etc/hosts to the container to facilitate network debugging.
2025-06-03 09:34:08 +08:00
dengbo 59fbf35dea feat: bind /etc/hosts to container
Bind /etc/hosts to the container to facilitate network debugging.
2025-06-03 09:34:08 +08:00
reddevillg c5f2665f12 feat: Support extension environment variables
1. apply extension environment
2. apply app and extension permission binds
3. run ldconfig with -X option in cache generate phase
4. introduce dummy extension which is enabled by default

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-05-27 17:32:58 +08:00
ComixHe e7814c3cd3 refactor: add getBundlePath
make basePath and bundlePath to be required field

Signed-off-by: ComixHe <ComixHe1895@outlook.com>
2025-05-22 21:01:09 +08:00
ComixHe 3c85b1ef53 refactor: forwardEnv will forward all envs by default
fix typo

Signed-off-by: ComixHe <heyuming@deepin.org>
2025-05-22 20:25:45 +08:00
reddevillg 62a34749ec feat: support build extension
Introduce RunContext to unify runtime layer resolution, requiring
changes across the builder, CLI, and PM.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-05-20 17:18:42 +08:00
dengbo 5249e61543 fix: ll-cli failed to start app
Improve error handling for filesystem existence checks.
2025-05-15 15:48:39 +08:00
ComixHe dbe988add5 style: format whole project
based on clang-format 19.1.7

Signed-off-by: ComixHe <heyuming@deepin.org>
2025-05-14 11:35:50 +08:00
reddevillg 9946fa8d54 fix: make /sys, /proc, /dev and /tmp default
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-05-08 16:07:03 +08:00
reddevillg 2eebc546a7 fix: make the mount adjustment behavior clearer
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-05-07 13:21:17 +08:00
ComixHe d8b25b4b7c fix: remove binding host certs for now
Certificate name resolvtion is very complicated
we shouldn't bind /etc/ssl/certs to container directly

Signed-off-by: ComixHe <heyuming@deepin.org>
2025-04-28 15:07:46 +08:00
reddevillg c3d407e004 fix: fix /tmp bind in multiple users envrionment
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-04-27 11:31:34 +08:00
ComixHe 5f78b356e2 fix: remove option 'nosymfollow'
'nosymfollow' doesn't satisfying with our purpose

Signed-off-by: ComixHe <heyuming@deepin.org>
2025-04-25 09:33:14 +08:00
ComixHe be075cc7b0 fix: skip binding XauthFile if it not exists
Signed-off-by: ComixHe <heyuming@deepin.org>
2025-04-24 18:18:42 +08:00
reddevillg 0f76f9f006 feat: Bind host statics to container config builder
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-04-14 15:21:07 +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
reddevillg b67fc5c348 feat: add isolate network option for build
use --isolate-network to build in an isolated network environment
2025-04-08 10:08:43 +08:00
reddevillg 672f23f0d3 refactor: separate build process into several stages
separate build process into several stages
2025-04-08 10:08:43 +08:00
reddevillg 761d44f5ad refactor: make builder and pm use ContainerCfgBuiler
Make builder and pm use ContainerCfgBuiler
2025-04-08 10:08:43 +08:00
reddevillg 4524903d93 refactor: Introduce class ContainerCfgBuiler
Use builder design pattern to generate container config
2025-04-08 10:08:43 +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 534fb1b0f8 fix: dsg config not effective
DSG_APP_ID should be add to environment.
2025-03-18 14:52:14 +08:00
ComixHe 278bbc63e4 fix: correct mount option for distribution.info
Signed-off-by: ComixHe <heyuming@deepin.org>
2025-03-10 10:28:02 +08:00
ComixHe d7cea3443a refactor: optimize starting container
Signed-off-by: ComixHe <heyuming@deepin.org>
2025-02-27 19:42:27 +08:00
dengbo d2b6725953 fix: can not save file to media
/media is symlink(/run/media) in v25, app can not access the dir
so we should mount /media, /run/media to container and keep symlink.
2025-02-21 09:51:50 +08:00
ice909 990b690d93 fix: missing environment variables for uab run
This commit allows uab to run directly without detecting linglong.
2025-02-18 09:16:55 +08:00
ComixHe 3f99cf5657 fix: resolve the real path for some host files
when host use systemd-resolved to manage dns and systemd-resolved
working on stub mode, the file /etc/resolv.conf is a symlink to
/run/systemd/resolve/stub-resolv.conf.

refactoring the process for normalization.

Signed-off-by: ComixHe <heyuming@deepin.org>
2025-02-08 13:46:41 +08:00
dengbo de440dc6bc fix: can not install app in chroot
this is a temporary solution:
1. allow cache generation failure;
2. disable font cache generation.
2025-01-09 14:07:59 +08:00
ComixHe ebb84b48cc feat(gen): add annotations for skipping some oci-cfg-generators
Signed-off-by: ComixHe <heyuming@deepin.org>
2025-01-07 11:54:08 +08:00
ComixHe f655205db9 feat: Temporarily disable directory permission interactions
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-12-26 16:05:33 +08:00
kamiyadm 89bb6f0452 fix: incorrect mount of fonts in 90_legacy
-

Log:
2024-12-23 10:54:01 +08:00
ComixHe 768828bac6 refactor(oci-gen): using outer json file to generate the patch content
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-12-20 13:50:47 +08:00
myml 9c7ec8a352 fix: handling of DBus addresses with options
当DBus环境变量包含选项时, 玲珑没有正确处理
2024-12-20 09:48:12 +08:00
ComixHe bbd5df5c95 fix: skip some generating steps which related to env 'HOME'
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-12-18 17:47:03 +08:00
myml 1792d8df18 fix: abnormal cursor size in wayland
DTK使用XCURSOR_SIZE环境变量设置鼠标尺寸
需要将该环境变量从宿主机传递到容器中
2024-12-18 16:10:56 +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