summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-02-26 08:47:18 +0100
committerHarald Hoyer <harald@redhat.com>2013-02-26 08:52:17 +0100
commit6557484fb169f4fad7e9e877c7c553288aa67b20 (patch)
treed6ccfcd49f5a7d9a1ac8fef1fe263266eba9c476
parent1ef04f0b14a5e48a822683a9e3a19233b42aecb2 (diff)
kernel-install: fixed paths in boot loader entry
For the loader entry a relative path has to be used.
-rw-r--r--src/kernel-install/kernel-install28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install
index 1a694578a1..769c609606 100644
--- a/src/kernel-install/kernel-install
+++ b/src/kernel-install/kernel-install
@@ -67,7 +67,9 @@ if ! ( [[ $COMMAND ]] && [[ $KERNEL_VERSION ]] && [[ $KERNEL_IMAGE ]] ); then
exit 1
fi
-BOOT_DIR="/boot/$MACHINE_ID/$KERNEL_VERSION"
+BOOT_DIR="$MACHINE_ID/$KERNEL_VERSION"
+BOOT_DIR_ABS="/boot/$BOOT_DIR"
+LOADER_ENTRY="/boot/loader/entries/${ID}-${KERNEL_VERSION}-${MACHINE_ID}.conf"
ret=0
dropindirs_sort()
@@ -99,15 +101,15 @@ readarray -t PLUGINS < <(
case "$COMMAND" in
add)
- mkdir -p "$BOOT_DIR" || exit 1
+ mkdir -p "$BOOT_DIR_ABS" || exit 1
for f in "${PLUGINS[@]}"; do
- [[ -x $f ]] && "$f" add "$KERNEL_VERSION" "$BOOT_DIR"
+ [[ -x $f ]] && "$f" add "$KERNEL_VERSION" "$BOOT_DIR_ABS"
((ret+=$?))
done
- if ! cp --preserve "$KERNEL_IMAGE" "$BOOT_DIR"/linux; then
- echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR/linux'!" >&2
+ if ! cp --preserve "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
+ echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'!" >&2
fi
[[ -d /boot/loader/entries ]] || mkdir -p /boot/loader/entries
@@ -116,28 +118,28 @@ case "$COMMAND" in
echo "title $PRETTY_NAME"
echo "version $KERNEL_VERSION"
echo "machine-id $MACHINE_ID"
- echo "options $BOOT_OPTIONS"
+ echo "options ${BOOT_OPTIONS[@]}"
echo "linux $BOOT_DIR/linux"
- [[ -f "${BOOT_DIR}"/initrd ]] && \
+ [[ -f "${BOOT_DIR_ABS}"/initrd ]] && \
echo "initrd $BOOT_DIR/initrd"
:
- } > "/boot/loader/entries/${ID}-${KERNEL_VERSION}-${MACHINE_ID}.conf"
+ } > $LOADER_ENTRY
((ret+=$?))
- if ! [[ -f "/boot/loader/entries/${ID}-${KERNEL_VERSION}-${MACHINE_ID}.conf" ]]; then
- echo "Could not create '/boot/loader/entries/${ID}-${KERNEL_VERSION}-${MACHINE_ID}.conf'!" >&2
+ if ! [[ -f $LOADER_ENTRY ]]; then
+ echo "Could not create '$LOADER_ENTRY'!" >&2
fi
;;
remove)
for f in "${PLUGINS[@]}"; do
- [[ -x $f ]] && "$f" remove "$KERNEL_VERSION" "$BOOT_DIR"
+ [[ -x $f ]] && "$f" remove "$KERNEL_VERSION" "$BOOT_DIR_ABS"
((ret+=$?))
done
- rm -fr "$BOOT_DIR"
- rm -f "/boot/loader/entries/${ID}-${KERNEL_VERSION}-${MACHINE_ID}.conf"
+ rm -fr "$BOOT_DIR_ABS"
+ rm -f "$LOADER_ENTRY"
;;
*)