diff --git a/init/setup-rw.sh b/init/setup-rw.sh index 0596cd37..8593b0a1 100755 --- a/init/setup-rw.sh +++ b/init/setup-rw.sh @@ -31,7 +31,12 @@ if mountpoint -q /rw ; then # This script will be executed at every VM startup, you can place your own # custom commands here. This includes overriding some configuration in /etc, # starting services etc. - +# +# Executable scripts located in /rw/config/rc.local.d with the extension +# '.rc' are executed immediately before this rc.local. +# Example: +# /rw/config/rc.local.d/custom.rc +# # Example for overriding the whole CUPS configuration: # rm -rf /etc/cups # ln -s /rw/config/cups /etc/cups @@ -49,7 +54,7 @@ EOF # # It is a good place for custom rules and actions that should occur when the # firewall service is started. -# +# # Executable scripts located in /rw/config/qubes-firewall.d are executed # immediately before this qubes-firewall-user-script. EOF diff --git a/vm-systemd/misc-post.sh b/vm-systemd/misc-post.sh index 1ffaae09..8439bb54 100755 --- a/vm-systemd/misc-post.sh +++ b/vm-systemd/misc-post.sh @@ -11,6 +11,9 @@ if [ -n "$(ls -A /usr/local/lib 2>/dev/null)" ] || \ ldconfig fi -if [ -x /rw/config/rc.local ] ; then - /rw/config/rc.local -fi +for rc in /rw/config/rc.local.d/*.rc /rw/config/rc.local; do + [ -f "${rc}" ] || continue + [ -x "${rc}" ] || continue + "${rc}" +done +unset rc