Skip to content

scripts/halium: deal with (broken) symlink in sync_dirs

Jami Kettunen requested to merge initrd-sync-dirs-handle-symlinks into master

This is our version of [1] from Snap's initramfs. The original commit read:

The sync_dirs() has a test -e that fails to take broken symlinks into account. This means that symlinks that are broken when sync_dir runs (which is a very special environment) are not copied. This breaks e.g. the symlink snapd.snap-repair.timer in /etc/systemd/system/timer-target.wants.

In our case, we want this so that having /etc/systemd on writable-paths' synced mode works properly.

[1] https://github.com/snapcore/core-build/commit/843b8c7bb147a58cefb605487de39c5e14892099

Link: https://github.com/Halium/initramfs-tools-halium/commit/cc14887bcddd39d290dd0c4b258b0411f66a8227

Merge request reports