mirror of
https://abf.rosa.ru/djam/kernel-5.15.git
synced 2025-02-24 02:52:55 +00:00
Always regenerate initrd
Even if it already exists. This may happen if kernel-<...>-devel is installed first, triggers rebuild of DKMS modules and some of these request remaking of initrd. The initrd that is created then will be non-functional. But when the user installs kernel-<...> package, that defunct initrd will be replaced with a working one here.
This commit is contained in:
parent
3f8c750033
commit
7cc486719f
1 changed files with 7 additions and 5 deletions
12
kernel.spec
12
kernel.spec
|
@ -1487,14 +1487,16 @@ EOF
|
|||
%endif
|
||||
|
||||
### Create kernel Post script
|
||||
# We always regenerate initrd here, even if it already exists. This may
|
||||
# happen if kernel-<...>-devel is installed first, triggers rebuild of
|
||||
# DKMS modules and some of these request remaking of initrd. The initrd
|
||||
# that is created then will be non-functional. But when the user installs
|
||||
# kernel-<...> package, that defunct initrd will be replaced with a working
|
||||
# one here.
|
||||
cat > $kernel_files-post <<EOF
|
||||
INITRD=/boot/initrd-$KernelVer.img
|
||||
/sbin/dracut -f \${INITRD} $KernelVer
|
||||
|
||||
if [ ! -e \${INITRD} ]; then
|
||||
/sbin/dracut \${INITRD} $KernelVer
|
||||
else
|
||||
printf "WARNING: Initrd image \${INITRD} already exists and will not be replaced.\n"
|
||||
fi
|
||||
/usr/sbin/update-grub2
|
||||
|
||||
pushd /boot > /dev/null
|
||||
|
|
Loading…
Add table
Reference in a new issue