30 lines
822 B
Bash
Executable File
30 lines
822 B
Bash
Executable File
#!/bin/sh
|
|
scripts=$(./enabled-service-order.sh)
|
|
is_leaf_service(){
|
|
local script=$1
|
|
if grep -q "^# REQUIRE:." "$script" || \
|
|
grep -q "^# BEFORE:." "$script"; then
|
|
return 1
|
|
fi
|
|
return 0
|
|
}
|
|
mkdir -p /etc/dinit.d
|
|
echo "type = internal" >> /etc/dinit.d/boot
|
|
for script in $scripts; do
|
|
# ./transform.sh $script
|
|
if is_leaf_service $script; then
|
|
echo "depends-on = $(basename $script)" >> /etc/dinit.d/boot
|
|
fi
|
|
# name=$(basename "$script")
|
|
# if [ "$name" = "DISKS" ]; then
|
|
# echo "options: starts-rwfs" >> /etc/dinit.d/$name
|
|
# fi
|
|
done
|
|
for script in $(ls -P /etc/rc.d); do
|
|
./transform.sh $script
|
|
name=$(basename "$script")
|
|
if [ "$name" = "DISKS" ]; then
|
|
echo "options: starts-rwfs" >> /etc/dinit.d/$name
|
|
fi
|
|
done
|
|
./postprocess.sh |