Skip to content

Commit

Permalink
scripts/halium: deal with (broken) symlink in sync_dirs (#39)
Browse files Browse the repository at this point in the history
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] canonical/core-build@843b8c7

Co-authored-by: Ratchanan Srirattanamet <[email protected]>
  • Loading branch information
JamiKettunen and peat-psuwit authored Jan 26, 2023
1 parent b5a24f0 commit cc14887
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/halium
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ sync_dirs() {

for file in $source/*; do
# Skip empty directories
[ ! -e "$base/$file" ] && continue
[ ! -e "$base/$file" -a ! -L "$base/$file" ] && continue

# If the target already exists as a file or link, there's nothing we can do
[ -e "$target/$file" -o -L "$target/$file" ] && [ ! -d "$target/$file" ] && continue
Expand Down

0 comments on commit cc14887

Please sign in to comment.