1
0
mirror of https://github.com/systemd/systemd synced 2026-03-16 10:04:47 +01:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Yu Watanabe
5709c7fe4e
Merge pull request #19713 from nabijaczleweli/bootctlpsko-liter
The "obviously good stuff" from #19006 again
2021-05-25 08:31:38 +09:00
наб
44230fa2b0
kernel-install: don't erase previous errors if a hook returns 77
The manpage says that exiting 77 is the same as exiting 0,
then skipping all other hooks, but the behaviour heretofor
was to exit 0, skip all, and behave as if all hooks exited 0
2021-05-24 21:56:35 +02:00
наб
0ad401dc5d
kernel-install/90-loaderentry: use install(1) instead of cp/chown/chmod chains
Also fix typo in error message
2021-05-24 21:35:12 +02:00
2 changed files with 8 additions and 14 deletions

View File

@ -92,12 +92,10 @@ else
LOADER_ENTRY="$BOOT_ROOT/loader/entries/$MACHINE_ID-$KERNEL_VERSION.conf" LOADER_ENTRY="$BOOT_ROOT/loader/entries/$MACHINE_ID-$KERNEL_VERSION.conf"
fi fi
cp "$KERNEL_IMAGE" "$ENTRY_DIR_ABS/linux" && install -g root -o root -m 0644 "$KERNEL_IMAGE" "$ENTRY_DIR_ABS/linux" || {
chown root:root "$ENTRY_DIR_ABS/linux" && echo "Could not copy '$KERNEL_IMAGE' to '$ENTRY_DIR_ABS/linux'." >&2
chmod 0644 "$ENTRY_DIR_ABS/linux" || { exit 1
echo "Could not copy '$KERNEL_IMAGE to '$ENTRY_DIR_ABS/linux'." >&2 }
exit 1
}
INITRD_OPTIONS=( "${@:${INITRD_OPTIONS_START}}" ) INITRD_OPTIONS=( "${@:${INITRD_OPTIONS_START}}" )
@ -106,12 +104,10 @@ for initrd in "${INITRD_OPTIONS[@]}"; do
initrd_basename="$(basename ${initrd})" initrd_basename="$(basename ${initrd})"
[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \ [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
echo "Installing $ENTRY_DIR_ABS/${initrd_basename}" echo "Installing $ENTRY_DIR_ABS/${initrd_basename}"
cp "${initrd}" "$ENTRY_DIR_ABS/${initrd_basename}" && install -g root -o root -m 0644 "${initrd}" "$ENTRY_DIR_ABS/${initrd_basename}" || {
chown root:root "$ENTRY_DIR_ABS/${initrd_basename}" && echo "Could not copy '${initrd}' to '$ENTRY_DIR_ABS/${initrd_basename}'." >&2
chmod 0644 "$ENTRY_DIR_ABS/${initrd_basename}" || { exit 1
echo "Could not copy '${initrd}' to '$ENTRY_DIR_ABS/${initrd_basename}'." >&2 }
exit 1
}
fi fi
done done

View File

@ -142,7 +142,6 @@ case $COMMAND in
"$f" add "$KERNEL_VERSION" "$ENTRY_DIR_ABS" "$KERNEL_IMAGE" "${INITRD_OPTIONS[@]}" "$f" add "$KERNEL_VERSION" "$ENTRY_DIR_ABS" "$KERNEL_IMAGE" "${INITRD_OPTIONS[@]}"
x=$? x=$?
if [[ $x == $SKIP_REMAINING ]]; then if [[ $x == $SKIP_REMAINING ]]; then
ret=0
break break
fi fi
((ret+=$x)) ((ret+=$x))
@ -158,7 +157,6 @@ case $COMMAND in
"$f" remove "$KERNEL_VERSION" "$ENTRY_DIR_ABS" "$f" remove "$KERNEL_VERSION" "$ENTRY_DIR_ABS"
x=$? x=$?
if [[ $x == $SKIP_REMAINING ]]; then if [[ $x == $SKIP_REMAINING ]]; then
ret=0
break break
fi fi
((ret+=$x)) ((ret+=$x))