anaconda: use kernel-install instead of grubby to regenerate initrd/grub.conf

Since we have own hook there, it properly handles Xen. This means we no
longer need post scripts in kickstart for that.
This commit is contained in:
Marek Marczykowski-Górecki 2015-07-12 01:33:08 +02:00
parent 20ec7c3935
commit 2726c5a9f5
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 3 additions and 9 deletions

View File

@ -1,10 +1,5 @@
%post %post
rpm --import /etc/pki/rpm-gpg/* rpm --import /etc/pki/rpm-gpg/*
for initrd in /boot/initramfs-*.img; do
version=`basename $initrd .img|cut -f 2- -d-`
dracut --force $initrd $version
done
grub2-mkconfig -o /boot/grub2/grub.cfg
%end %end

View File

@ -571,7 +571,7 @@ class Payload(object):
# prevent boot on some systems # prevent boot on some systems
def recreateInitrds(self, force=False): def recreateInitrds(self, force=False):
""" Recreate the initrds by calling new-kernel-pkg """ Recreate the initrds by calling kernel-install
This needs to be done after all configuration files have been This needs to be done after all configuration files have been
written, since dracut depends on some of them. written, since dracut depends on some of them.
@ -585,9 +585,8 @@ class Payload(object):
for kernel in self.kernelVersionList: for kernel in self.kernelVersionList:
log.info("recreating initrd for %s", kernel) log.info("recreating initrd for %s", kernel)
iutil.execWithRedirect("new-kernel-pkg", iutil.execWithRedirect("kernel-install",
["--mkinitrd", "--dracut", ["add", kernel, "/boot/vmlinuz-%s" % kernel],
"--depmod", "--update", kernel],
root=ROOT_PATH) root=ROOT_PATH)
self._createdInitrds = True self._createdInitrds = True