Add general purpose script execution

This commit is contained in:
topjohnwu 2017-02-06 00:13:25 +08:00
parent 472255924a
commit 45dbd4464b
2 changed files with 10 additions and 2 deletions

View File

@ -66,6 +66,14 @@ run_scripts() {
fi
fi
done
for SCRIPT in $COREDIR/${1}.d/* ; do
if [ -f "$SCRIPT" ]; then
chmod 755 $SCRIPT
chcon u:object_r:system_file:s0 $SCRIPT
log_print "${1}.d: $SCRIPT"
sh $SCRIPT
fi
done
}
loopsetup() {
@ -441,7 +449,7 @@ case $1 in
done
# Stage 4
log_print "* Stage 4: Execute module scripts"
log_print "* Stage 4: Execute scripts"
run_scripts post-fs-data
# Stage 5

View File

@ -11,7 +11,7 @@ log_print() {
log_print "Moving and linking /sbin binaries"
mount -o rw,remount rootfs /
/dev/busybox/cp -afc /sbin /sbin_orig
cp -af /sbin /sbin_orig
mount -o ro,remount rootfs /
log_print "Exposing su binary"