Skip to content

Commit 599e67e

Browse files
Howard20181topjohnwu
authored andcommitted
Exclude init.rc when installing, move the non-existent rc to the root
1 parent 95bb256 commit 599e67e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

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)