I have 49 rpm packages that I need to install from a local directory. One of which is kernel-4.9.135 Therefore, I want to use yum so all dependencies are managed for me (instead of passing rpm a list of rpm files).
I also have a very customized grub.cfg file that I do not want touched during this process.
I examined the scripts that are run when the kernel package is installed:
# rpm -qp --scripts ./kernel-4.9.135-1.x86_64.rpm
postinstall scriptlet (using /bin/sh):
if [ -x /sbin/installkernel -a -r /boot/vmlinuz-4.9.135 -a -r /boot/System.map-4.9.135 ]; then
cp /boot/vmlinuz-4.9.135 /boot/.vmlinuz-4.9.135-rpm
cp /boot/System.map-4.9.135 /boot/.System.map-4.9.135-rpm
rm -f /boot/vmlinuz-4.9.135 /boot/System.map-4.9.135
/sbin/installkernel 4.9.135 /boot/.vmlinuz-4.9.135-rpm /boot/.System.map-4.9.135-rpm
rm -f /boot/.vmlinuz-4.9.135-rpm /boot/.System.map-4.9.135-rpm
fi
...
installkernel contains the following:
if [ -n "$cfgLoader" ] && [ -x /sbin/new-kernel-pkg ]; then
if [ -n "$(which dracut 2>/dev/null)" ]; then
new-kernel-pkg --mkinitrd --dracut --host-only --depmod --install --kernel-name $KERNEL_NAME $KERNEL_VERSION
else
new-kernel-pkg --mkinitrd --depmod --install --kernel-name $KERNEL_NAME $KERNEL_VERSION
fi
new-kernel-pkg --rpmposttrans --kernel-name $KERNEL_NAME $KERNEL_VERSION
fi
And new-kernel-pkg uses grubby to update my grub.cfg file.
Is there some way to tell yum, and therefore the kernel rpm, to not do anything to alter grub.cfg, while using yum install to install all of my packages in one fell swoop?
The workaround is to copy my currentgrub.cfg to the side and copy it back after yum is finished but I thought I'd ask the question nonetheless.
grub.cfg. That activity is in progress and will happen eventually. The immediate goal here is to satisfy my curiosity about being able to alter the default "workflow" of ayum installin this particular instance. I do have a work-around that I'm okay using for now. Thanks for the feedback. FYI, in CentOS, most of the customization files are in/etc/grub.d/and/etc/default/grubas @yurij mentions below.