summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-07-01 12:50:17 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-07-06 16:33:11 +0200
commit2bbf6c35906caeedd15579cad1d19bb78d40f7b8 (patch)
treed0753c6aa364ac30b6649cb5056042bdb3aaa5e1
parentkernel-install: allow overriding the path to config files (diff)
downloadsystemd-2bbf6c35906caeedd15579cad1d19bb78d40f7b8.tar.xz
systemd-2bbf6c35906caeedd15579cad1d19bb78d40f7b8.zip
kernel-install/90-loaderentry: make ownership change optional
This can be useful when running as non-root, e.g. for tests or when installing to a chroot.
-rw-r--r--src/kernel-install/90-loaderentry.install6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/kernel-install/90-loaderentry.install b/src/kernel-install/90-loaderentry.install
index b700a7b2a6..d6b90a7b1d 100644
--- a/src/kernel-install/90-loaderentry.install
+++ b/src/kernel-install/90-loaderentry.install
@@ -105,10 +105,11 @@ if ! [ -d "$ENTRY_DIR_ABS" ]; then
exit 1
fi
-install -g root -o root -m 0644 "$KERNEL_IMAGE" "$ENTRY_DIR_ABS/linux" || {
+install -m 0644 "$KERNEL_IMAGE" "$ENTRY_DIR_ABS/linux" || {
echo "Error: could not copy '$KERNEL_IMAGE' to '$ENTRY_DIR_ABS/linux'." >&2
exit 1
}
+chown root.root "$ENTRY_DIR_ABS/linux" || :
shift "$INITRD_OPTIONS_SHIFT"
# All files listed as arguments, and staged files starting with "initrd" are installed as initrds.
@@ -121,10 +122,11 @@ for initrd in "$@" "${KERNEL_INSTALL_STAGING_AREA}"/initrd*; do
initrd_basename="${initrd##*/}"
[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Installing $ENTRY_DIR_ABS/$initrd_basename"
- install -g root -o root -m 0644 "$initrd" "$ENTRY_DIR_ABS/$initrd_basename" || {
+ install -m 0644 "$initrd" "$ENTRY_DIR_ABS/$initrd_basename" || {
echo "Error: could not copy '$initrd' to '$ENTRY_DIR_ABS/$initrd_basename'." >&2
exit 1
}
+ chown root.root "$ENTRY_DIR_ABS/$initrd_basename" || :
done
mkdir -p "${LOADER_ENTRY%/*}" || {