summaryrefslogtreecommitdiffstats
path: root/build-initramfs.sh
diff options
context:
space:
mode:
authorJonathan Bauer2020-05-13 14:26:52 +0200
committerJonathan Bauer2020-05-13 14:26:52 +0200
commit02defd436059e43a9c11df8361f4f14fc22d7707 (patch)
tree0f71da11d35103b4896fe7e6dc33ac5dea8cbaea /build-initramfs.sh
parentbuild-initramfs.sh: formatting + minor changes (diff)
downloadsystemd-init-02defd436059e43a9c11df8361f4f14fc22d7707.tar.gz
systemd-init-02defd436059e43a9c11df8361f4f14fc22d7707.tar.xz
systemd-init-02defd436059e43a9c11df8361f4f14fc22d7707.zip
build-initramfs.sh: handle failure to copy dracut modules
Diffstat (limited to 'build-initramfs.sh')
-rwxr-xr-xbuild-initramfs.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/build-initramfs.sh b/build-initramfs.sh
index f910e579..40b6e889 100755
--- a/build-initramfs.sh
+++ b/build-initramfs.sh
@@ -362,11 +362,13 @@ main() {
if ! ln --symbolic --force \
"$_dracut_module_dir" "$_dracut_module_target"; then
echo \
- "Linking \"$_dracut_module_dir\" to \"$_dracut_module_target\" failed." \
- "We will copy them. So we have to recopy it every time to ensure that recompiled things take effect."
- cp --recursive --force --no-target-directory \
- "$_dracut_module_dir" \
- "$_dracut_module_target"
+ "Failed to link: '$_dracut_module_dir' -> '$_dracut_module_target'." \
+ "Trying to copy them directly."
+ if ! cp --recursive --force --no-target-directory \
+ "$_dracut_module_dir" "$_dracut_module_target"; then
+ echo "Failed to copy them either, exiting."
+ exit 1
+ fi
fi
fi
done