From e531980a14d55ecf437188fb92fc332a82c2d537 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 19 Oct 2016 09:34:54 +0000 Subject: [PATCH] Remove RedHat grub workaround install AFAICT this is no longer necessary. I've tested minimal and image builds and they seem to work. The original problem seems to be with installing the package in the chroot, although it was never quite clear it ever affected the Red Hat path. This code is currently broken (see I884cb1e78ad8c31d985f3fc94a58091b993edd7d). This is proposed as an alternative to I74eed074494134334d5e49042bb5214bd0dd7339. Related-Bug: #1627000 Change-Id: Iafe3611f4eec3c6357587a6cae6a30a261686ead --- .../finalise.d/99-cleanup-tmp-grub | 9 ---- elements/redhat-common/package-installs.yaml | 11 ----- .../pre-install.d/15-remove-grub | 47 ------------------- 3 files changed, 67 deletions(-) delete mode 100755 elements/redhat-common/finalise.d/99-cleanup-tmp-grub delete mode 100755 elements/redhat-common/pre-install.d/15-remove-grub diff --git a/elements/redhat-common/finalise.d/99-cleanup-tmp-grub b/elements/redhat-common/finalise.d/99-cleanup-tmp-grub deleted file mode 100755 index 6a790911..00000000 --- a/elements/redhat-common/finalise.d/99-cleanup-tmp-grub +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then - set -x -fi -set -eu -set -o pipefail - -rm -rf /tmp/grub diff --git a/elements/redhat-common/package-installs.yaml b/elements/redhat-common/package-installs.yaml index 025158f1..81e19aa9 100644 --- a/elements/redhat-common/package-installs.yaml +++ b/elements/redhat-common/package-installs.yaml @@ -6,14 +6,3 @@ traceroute: which: gettext: phase: pre-install.d - -# these are being installed to satisfy the dependencies of grub2. See -# 15-remove-grub for more details -grub2-tools: - phase: pre-install.d -os-prober: - phase: pre-install.d -redhat-lsb-core: - phase: pre-install.d -system-logos: - phase: pre-install.d diff --git a/elements/redhat-common/pre-install.d/15-remove-grub b/elements/redhat-common/pre-install.d/15-remove-grub deleted file mode 100755 index ba1d922a..00000000 --- a/elements/redhat-common/pre-install.d/15-remove-grub +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then - set -x -fi -set -eu -set -o pipefail - -# grub2 isn't available on rhel6/centos6; they are setup to use -# extlinux. skip this -# you would think we could match on $DISTRO or something else; but -# we can't because the rhel/centos elements are a bit mixed up; -# centos-minimal for example sets distro to "centos". so the best -# check is just for the original "grub-install" script -if [ -f /sbin/grub-install ]; then - exit 0 -fi - -# remove grub2 package. As described in -# elements/ubuntu/pre-install.d/00-remove-grub; the grub post-kernel -# install hook will barf if the block device can't be found (as -# happens in a chroot). -# -# XXX : it is not clear this is necessary for fedora/centos7 and it's -# install hooks. Investigation is required. -if rpm -q grub2; then - install-packages -e grub-pc -fi - -# now configure things to re-install grub at the end. We don't want -# to rely on vm/finalise.d/51-bootloader to simply reinstall the -# package via the package-manager, because at that point (during -# finalise) the build-time yum-cache has been unmounted (hence the -# local-cache looks empty) and yum may try to repopulate the -# local-cache with all the grub2 dependencies. This is slow, and -# potentially fills up the disk. -# -# XXX : At this point, keepcache=0 *should* probably be set for -# yum/dnf. We have not standarised/documented that this will be done, -# however. This would *probably* stop dependencies being populated -# into the cache. We could investigate this, and possibly remove this -# all together if we standardise some of these behaviours. - -# So we download the latest grub2 package and setup the install script -# to just install the single-package, which will be called later by -# vm/finalise.d/51-bootloader -install-packages -d /tmp/grub grub-pc -echo "rpm -i /tmp/grub/*.rpm" > /tmp/grub/install