Skip to content

Commit

Permalink
custom-persist: init.d compatibility
Browse files Browse the repository at this point in the history
if the current VM is not under systemD we need to mount /home and /usr/local
explicitly
  • Loading branch information
Guiiix committed Feb 16, 2025
1 parent e5209c8 commit e47e285
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions vm-systemd/mount-dirs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ fi

if $mount_home; then
initialize_home "/rw/home" ifneeded
under_systemd || mount -o noauto,bind,defaults,nosuid,nodev /rw/home /home
else
disable_persistent_home
under_systemd && disable_persistent_home
initialize_home "/home" unconditionally
fi

if ! $mount_usr_local; then
disable_persistent_usrlocal
if $mount_usr_local; then
under_systemd || mount -o noauto,bind,defaults /rw/usrlocal /usr/local
else
under_systemd && disable_persistent_usrlocal
fi

systemctl daemon-reload

under_systemd && systemctl daemon-reload || exit 0

0 comments on commit e47e285

Please sign in to comment.