Skip to content

Commit d04268b

Browse files
committed
Exclude initi.rc when installing, move the non-existent rc to the module root
1 parent 3fca9cc commit d04268b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

scripts/util_functions.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,9 +734,16 @@ install_module() {
734734
cp -af $MODPATH/module.prop /data/adb/modules/$MODID/module.prop
735735
fi
736736

737-
rc=$(find "$MODPATH" -mindepth 1 -type f -name "*.rc" -print -quit)
737+
find "$MODPATH" -mindepth 1 -type f -name "init.rc" -exec rm -f {} \;
738+
find "$MODPATH" -mindepth 1 -type f -name "*.rc" | while read -r file; do
739+
local path="${file/$MODPATH/}"
740+
if [ ! -f "$path" ]; then
741+
mv "$file" "$MODPATH"
742+
fi
743+
rc=true
744+
done
738745
# Copy over custom sepolicy rules and rc
739-
if [ -f $MODPATH/sepolicy.rule ] || [ -n "$rc" ]; then
746+
if [ -f $MODPATH/sepolicy.rule ] || "$rc"; then
740747
ui_print "- Installing custom sepolicy rules or rc script"
741748
copy_preinit_files
742749
fi

0 commit comments

Comments
 (0)