Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 827181 Details for
Bug 864198
grubby fatal error updating grub.cfg when /boot is btrfs
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
if grub2 and btrfs, use grub2-mkconfig
0002-a-hack-so-that-a-good-grub2-cfg-file-when-btrfs-is-r.patch (text/plain), 4.30 KB, created by
Gene Czarcinski
on 2013-11-21 13:25:05 UTC
(
hide
)
Description:
if grub2 and btrfs, use grub2-mkconfig
Filename:
MIME Type:
Creator:
Gene Czarcinski
Created:
2013-11-21 13:25:05 UTC
Size:
4.30 KB
patch
obsolete
>From eb0b06f499c6c687e10ac5cca35d4e13b7f68dd5 Mon Sep 17 00:00:00 2001 >From: Gene Czarcinski <gene@czarc.net> >Date: Thu, 21 Nov 2013 07:04:37 -0500 >Subject: [PATCH 2/2] a hack so that a good grub2 cfg file when btrfs is root >Content-Type: text/plain; charset="utf-8" >Content-Transfer-Encoding: 8bit > >This is purely a hack which cuts grubby out of the picture and >puts the the problem of creating a valid grub2 grub.cfg file >on grub2-mkconfig. > >1. new-kernel-pkg --install is turned into a no-op because >we need a valid initrd file. >2. new-kernel-pkg --update is where all the work is done. Since >this is also where the initrd file, etc. are created as currently >set in the /bin/kernel-install script. >3. new-kernel-pkg --remove temporarily renames the kernel before >running grub2-mkconfig so that the menuentry will be removed and >then renames it back so that it can be removed by rpm. >4. Interesting, new-kernel-pgk --rminitrd does not work FOR ANYONE >because it is attempting to remove initrd insted of initramfs. But, >that is OK becuase rpm cleans up /boot of all files associated with >that kernel even when it is run with "--noscripts". >--- > new-kernel-pkg | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 62 insertions(+) > >diff --git a/new-kernel-pkg b/new-kernel-pkg >index 7fec1fe..5c1762c 100755 >--- a/new-kernel-pkg >+++ b/new-kernel-pkg >@@ -120,6 +120,24 @@ mbargs="$HYPERVISOR_ARGS" > adddracutargs="" > addplymouthinitrd="" > >+btrfs="n" >+mpoint=$(grep " btrfs " /proc/self/mountinfo | grep " / " | cut -d ' ' -f 5) >+if [ "$mpoint" = "/" ]; then >+ btrfs="y" >+fi >+ >+if [ -x /usr/sbin/grub2-mkconfig ]; then >+ updateconfig=/usr/sbin/grub2-mkconfig >+else >+ btrfs="n" >+fi >+ >+if [ -x /usr/bin/grub2-editenv ]; then >+ updateenv=/usr/bin/grub2-editenv >+else >+ btrfs="n" >+fi >+ > usage() { > echo "Usage: `basename $0` [-v] [--mkinitrd] [--rminitrd] [--dracut]" >&2 > echo " [--initrdfile=<initrd-image>] [--depmod] [--rmmoddep]" >&2 >@@ -140,6 +158,12 @@ install() { > [ -n "$verbose" ] && echo "kernel for $version does not exist, not running grubby" > return > fi >+ >+ # if this is btrfs root, then nothing is done by install; everything is in update >+ if [ "$btrfs" = "y" -a -e /boot/grub2/grub.cfg ]; then >+ [ -n "$verbose" ] && echo "this is btrfs, bail out of --install" >+ return >+ fi > > INITRD="" > if [ -f $initrdfile ]; then >@@ -272,6 +296,22 @@ rpmposttrans() > } > > remove() { >+ ### BTRFS handled here ### >+ ### This is going to be more than a bit of a hack. >+ ### Get rid of the kernel so that grub.cfg is cleaned up, >+ ### then put it back so the rpm can get rid of it. >+ if [ "$btrfs" = "y" -a -e /boot/grub2/grub.cfg ]; then >+ name1=/boot/vmlinuz-$version >+ name2=/boot/xxvmlinuz-$version >+ [ -n "$verbose" ] && echo "mv $name1 $name2" >+ mv $name1 $name2 >+ [ -n "$verbose" ] && echo "$updateconfig -o /boot/grub2/grub.cfg" >+ $updateconfig -o /boot/grub2/grub.cfg >+ [ -n "$verbose" ] && echo "mv $name2 $name1" >+ mv $name2 $name1 >+ return >+ fi >+ > # FIXME: is this a good heuristic to find out if we're on iSeries? > if [ -d /proc/iSeries ]; then > [ -n "$verbose" ] && echo "On an iSeries, remove img file" >@@ -387,6 +427,28 @@ update() { > [ -n "$verbose" ] && echo "kernel for $version does not exist, not running grubby" > return > fi >+ >+ ### BTRFS handled here ### >+ if [ "$btrfs" = "y" -a -e /boot/grub2/grub.cfg ]; then >+ if [ -f /etc/os-release ]; then >+ . /etc/os-release >+ title="$NAME ($version) $VERSION" >+ elif [ -f /etc/redhat-release ]; then >+ title="$(sed 's/ release.*$//' < /etc/redhat-release) ($version)" >+ else >+ title="Fedora ($version)" >+ fi >+ # do it! >+ [ -n "$verbose" ] && echo "$title" >+ [ -n "$verbose" ] && echo "$updateconfig -o /boot/grub2/grub.cfg" >+ $updateconfig -o /boot/grub2/grub.cfg >+ if [ -e /boot/grub2/grubenv ]; then >+ [ -n "$verbose" ] && echo "$updateenv /boot/grub2/grubenv set saved_entry=$title" >+ $updateenv /boot/grub2/grubenv set "saved_entry=$title" >+ fi >+ [ -n "$verbose" ] && echo "Fantastic, this might actually work!" >+ return >+ fi > > INITRD="" > if [ -f $initrdfile ]; then >-- >1.8.4.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 864198
:
632180
|
632183
|
632845
|
827180
|
827181
|
827953
|
1013654