meta-overlayfs: avoid moving skip-mount modules

This commit is contained in:
weishu
2025-11-19 21:22:12 +08:00
committed by ShirkNeko
parent d7878ddd45
commit 9c2924de78

View File

@@ -22,6 +22,22 @@ ensure_image_mounted() {
fi fi
} }
# Determine whether this module should be moved into the ext4 image.
# We only relocate payloads that expose system/ overlays and do not opt out via skip_mount.
module_requires_overlay_move() {
if [ -f "$MODPATH/skip_mount" ]; then
ui_print "- skip_mount flag detected; keeping files under /data/adb/modules"
return 1
fi
if [ ! -d "$MODPATH/system" ]; then
ui_print "- No system/ directory detected; keeping files under /data/adb/modules"
return 1
fi
return 0
}
# Post-installation: move partition directories to ext4 image # Post-installation: move partition directories to ext4 image
post_install_to_image() { post_install_to_image() {
ui_print "- Moving module content to image" ui_print "- Moving module content to image"
@@ -55,7 +71,11 @@ ensure_image_mounted
# 2. Call standard install_module function (defined in installer.sh) # 2. Call standard install_module function (defined in installer.sh)
install_module install_module
# 3. Post-process: move content to image # 3. Post-process: move content to image when overlay data exists
post_install_to_image if module_requires_overlay_move; then
post_install_to_image
else
ui_print "- Skipping move to modules image"
fi
ui_print "- Installation complete" ui_print "- Installation complete"