| |
@@ -54,24 +54,26 @@
|
| |
case "$COMMAND" in
|
| |
add)
|
| |
if [[ "${KERNEL_DIR}" != "/boot" ]]; then
|
| |
+ # rename to match the name used in the pseudo-BLS snippet above
|
| |
+ cp --remove-destination --preserve=timestamps -T "${KERNEL_IMAGE}" "/boot/vmlinuz-${KERNEL_VERSION}"
|
| |
+ command -v restorecon &>/dev/null && \
|
| |
+ restorecon -R "/boot/vmlinuz-${KERNEL_VERSION}"
|
| |
+
|
| |
for i in \
|
| |
- "$KERNEL_IMAGE" \
|
| |
"$KERNEL_DIR"/System.map \
|
| |
"$KERNEL_DIR"/config \
|
| |
"$KERNEL_DIR"/zImage.stub \
|
| |
"$KERNEL_DIR"/dtb
|
| |
do
|
| |
[[ -e "$i" ]] || continue
|
| |
- rm -f "/boot/${i##*/}-${KERNEL_VERSION}"
|
| |
- cp -aT "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
|
| |
+ cp --remove-destination --preserve=timestamps -T "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
|
| |
command -v restorecon &>/dev/null && \
|
| |
restorecon -R "/boot/${i##*/}-${KERNEL_VERSION}"
|
| |
done
|
| |
# hmac is .vmlinuz-<version>.hmac so needs a special treatment
|
| |
i="$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac"
|
| |
if [[ -e "$i" ]]; then
|
| |
- rm -f "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
| |
- cp -a "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
| |
+ cp --remove-destination --preserve=timestamps "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
| |
command -v restorecon &>/dev/null && \
|
| |
restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
| |
fi
|
| |
@@ -79,16 +81,14 @@
|
| |
# symvers is symvers-<version>.gz symlink, needs a special treatment
|
| |
i="$KERNEL_DIR/symvers.gz"
|
| |
if [[ -e "$i" ]]; then
|
| |
- rm -f "/boot/symvers-${KERNEL_VERSION}.gz"
|
| |
- ln -s "$i" "/boot/symvers-${KERNEL_VERSION}.gz"
|
| |
+ ln -fs "$i" "/boot/symvers-${KERNEL_VERSION}.gz"
|
| |
command -v restorecon &>/dev/null && \
|
| |
restorecon "/boot/symvers-${KERNEL_VERSION}.gz"
|
| |
fi
|
| |
# symvers is symvers-<version>.bz symlink, needs a special treatment
|
| |
i="$KERNEL_DIR/symvers.bz"
|
| |
if [[ -e "$i" ]]; then
|
| |
- rm -f "/boot/symvers-${KERNEL_VERSION}.bz"
|
| |
- ln -s "$i" "/boot/symvers-${KERNEL_VERSION}.bz"
|
| |
+ ln -fs "$i" "/boot/symvers-${KERNEL_VERSION}.bz"
|
| |
command -v restorecon &>/dev/null && \
|
| |
restorecon "/boot/symvers-${KERNEL_VERSION}.bz"
|
| |
fi
|
| |
@@ -153,7 +153,7 @@
|
| |
|
| |
if [ "x$GRUB_LINUX_MAKE_DEBUG" = "xtrue" ]; then
|
| |
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
|
| |
- cp -aT "${BLS_TARGET}" "${BLS_DEBUG}"
|
| |
+ cp --preserve=timestamps -T "${BLS_TARGET}" "${BLS_DEBUG}"
|
| |
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
|
| |
OPTIONS="$(echo "${BOOT_OPTIONS[*]} ${GRUB_CMDLINE_LINUX_DEBUG}" | sed -e 's/\//\\\//g')"
|
| |
sed -i -e "s/^title.*/title ${TITLE}${GRUB_LINUX_DEBUG_TITLE_POSTFIX}/" "${BLS_DEBUG}"
|
| |
The mkbls() function would write 'linux /vmlinuz-${kernelver}' into the boot
loader entry. But the code that actually copies the file would use the original
file name with a version suffix ('cp -aT "$i" "/boot/${i##/}-${KERNEL_VERSION}"').
In case of a local kernel build calling /sbin/installkernel this file name was
e.g. 'bzImage', so we would end up with '/bzImage-${KERNEL_VERSION}', which of
course doesn't match '/vmlinuz-'. The script would later call 'grub2-mkrel'
on the name taken from the boot entry which would fail because the file does not
exist. Rename the argument to "vmlinuz", so that both parts match.
Tested by doing a local kernel build with 'sudo make install' at the end.
For F39 too of course.