Skip to contentSkip to conversation

install.sh: Preserve symlinks in destination file system

PATCH In review Thierry Escande 3 participants 3 messages Mar 19 – Apr 23

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 install.sh: Preserve symlinks in destination file system

In various distros (i.e. Debian), /lib is a symbolic link. The tar command in install.sh replaces the /lib symlink with a directory and results in a non-functioning system. This has been introduced by the installation of the systemd watchdog sleep script in /lib/systemd.

This patch adds the tar option --dereference (-h for short) to preserve symlinks when extracting the dist archive.

Fixes e54a6cd6a1f3 ("systemd: Add hooks to stop/start xen-watchdog on suspend/resume")

---
Changes in v2:
* Use more standard -h option instead of --keep-directory-symlink
* Update commit message

 install.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
install.sh +1 -1
index 3e11c4d46f..1d74541320 100644
@@ -27,7 +27,7 @@ tmp="`mktemp -d`"
 echo "Installing Xen from '$src' to '$dst'..."
 (cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
 
-(cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xf -
+(cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xhf -
 rm -rf "$tmp"
 
 echo "All done."
Signature · 10 lines
2.51.0



--
Thierry Escande | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech
Reviewed-by Tested-by on v2 1/1
#1 lore raw
Quoted 10 lines · Thierry Escande

In various distros (i.e. Debian), /lib is a symbolic link. The tar command in install.sh replaces the /lib symlink with a directory and results in a non-functioning system. This has been introduced by the installation of the systemd watchdog sleep script in /lib/systemd.

This patch adds the tar option --dereference (-h for short) to preserve symlinks when extracting the dist archive.

Fixes e54a6cd6a1f3 ("systemd: Add hooks to stop/start xen-watchdog on suspend/resume")

Thanks,
Jason

#2 lore raw
Quoted 6 lines · Jason Andryuk
Quoted 5 lines · Thierry Escande

In various distros (i.e. Debian), /lib is a symbolic link. The tar command in install.sh replaces the /lib symlink with a directory and results in a non-functioning system. This has been introduced by the installation of the systemd watchdog sleep script in /lib/systemd.

Quoted 8 lines
Quoted 5 lines

This patch adds the tar option --dereference (-h for short) to preserve symlinks when extracting the dist archive.

Fixes e54a6cd6a1f3 ("systemd: Add hooks to stop/start xen-watchdog on suspend/resume")

Thanks,

--
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech