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 827953 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]
when rootfs is btrfs, use grub2-mkconfig instead of grubby
0002-v3-when-btrfs-is-rootfs-use-grub2-mkconfig.patch (text/plain), 4.69 KB, created by
Gene Czarcinski
on 2013-11-22 18:56:20 UTC
(
hide
)
Description:
when rootfs is btrfs, use grub2-mkconfig instead of grubby
Filename:
MIME Type:
Creator:
Gene Czarcinski
Created:
2013-11-22 18:56:20 UTC
Size:
4.69 KB
patch
obsolete
>From a83b235d4caf13ebfffeecebe03d72ad995705b5 Mon Sep 17 00:00:00 2001 >From: Gene Czarcinski <gene@czarc.net> >Date: Fri, 22 Nov 2013 13:24:12 -0500 >Subject: [PATCH 2/2] v3 when btrfs is rootfs use grub2-mkconfig >Content-Type: text/plain; charset="utf-8" >Content-Transfer-Encoding: 8bit > >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. When grub2-mkconfig is used, suppress messages unless "-v" >and make sure to supporess all the os-prober debug messages. >5. Interesting, new-kernel-pkg --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 | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 75 insertions(+) > >diff --git a/new-kernel-pkg b/new-kernel-pkg >index 7fec1fe..81cb3be 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 >@@ -141,6 +159,12 @@ install() { > 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 > [ -n "$verbose" ] && echo "found $initrdfile and using it with grubby" >@@ -272,6 +296,27 @@ 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 >+ if [ -n "$verbose" ]; then >+ echo "$updateconfig -o /boot/grub2/grub.cfg" >+ $updateconfig -o /boot/grub2/grub.cfg >+ else >+ export OS_PROBER_DISABLE_DEBUG=1 >+ $updateconfig -o /boot/grub2/grub.cfg 2>/dev/null >+ fi >+ [ -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" >@@ -388,6 +433,36 @@ update() { > 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" >+ if [ -n "$verbose" ]; then >+ echo "$updateconfig -o /boot/grub2/grub.cfg" >+ $updateconfig -o /boot/grub2/grub.cfg >+ if [ -e /boot/grub2/grubenv ]; then >+ echo "$updateenv /boot/grub2/grubenv set saved_entry=$title" >+ $updateenv /boot/grub2/grubenv set "saved_entry=$title" >+ fi >+ else >+ export OS_PROBER_DISABLE_DEBUG=1 >+ $updateconfig -o /boot/grub2/grub.cfg 2>/dev/null >+ if [ -e /boot/grub2/grubenv ]; then >+ $updateenv /boot/grub2/grubenv set "saved_entry=$title" >+ fi >+ fi >+ [ -n "$verbose" ] && echo "Fantastic, this might actually work!" >+ return >+ fi >+ > INITRD="" > if [ -f $initrdfile ]; then > [ -n "$verbose" ] && echo "found $initrdfile and using it with grubby" >-- >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