Bug 1312541

Summary: Error message during update of a mock rawhide chroot
Product: [Fedora] Fedora Reporter: Mattias Ellert <mattias.ellert>
Component: fedora-releaseAssignee: Stephen Gallagher <sgallagh>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dennis, jdisnard, kevin, pbrobinson, sgallagh, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fedora-release-24-0.16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-29 12:13:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mattias Ellert 2016-02-27 06:41:49 UTC
Description of problem:

mock --root fedora-rawhide-x86_64 --update

  Cleanup     : glibc-2.22.90-36.fc24.x86_64                              59/59 
/usr/sbin/convert-to-edition: line 163: grub2-mkconfig: command not found
This system has been converted to non-edition
  Verifying   : system-python-libs-3.5.1-6.fc25.x86_64                     1/59 

There is no grub in a mock chroot.

Version-Release number of selected component (if applicable):

  Upgrading   : fedora-release-25-0.1.noarch                              20/59 


The /usr/sbin/convert-to-edition also uses the $RPM_BUILD_ROOT environment variable twice:

$ grep RPM /usr/sbin/convert-to-edition
# part of an RPM scriptlet.
    ln -sf ./os.release.d/issue-fedora $RPM_BUILD_ROOT/usr/lib/issue
    ln -sf ./os.release.d/issue-fedora $RPM_BUILD_ROOT/usr/lib/issue

This doesn't make sense.

Comment 1 Stephen Gallagher 2016-02-29 13:42:18 UTC
(In reply to Mattias Ellert from comment #0)
> Description of problem:
> 
> mock --root fedora-rawhide-x86_64 --update
> 
>   Cleanup     : glibc-2.22.90-36.fc24.x86_64                             
> 59/59 
> /usr/sbin/convert-to-edition: line 163: grub2-mkconfig: command not found
> This system has been converted to non-edition
>   Verifying   : system-python-libs-3.5.1-6.fc25.x86_64                    
> 1/59 
> 
> There is no grub in a mock chroot.

Right, that's not surprising in the mock chroot, but it's needed in real installs in order to make sure that the boot loader shows the correct edition.


> 
> Version-Release number of selected component (if applicable):
> 
>   Upgrading   : fedora-release-25-0.1.noarch                             
> 20/59 
> 
> 
> The /usr/sbin/convert-to-edition also uses the $RPM_BUILD_ROOT environment
> variable twice:
> 
> $ grep RPM /usr/sbin/convert-to-edition
> # part of an RPM scriptlet.
>     ln -sf ./os.release.d/issue-fedora $RPM_BUILD_ROOT/usr/lib/issue
>     ln -sf ./os.release.d/issue-fedora $RPM_BUILD_ROOT/usr/lib/issue
> 
> This doesn't make sense.

You're right. I'm not sure what happened there. Probably a copy-and-paste error and I forgot to change those spots.

Previously, this stuff was handled in the %post script directly, but I moved it all to a script at Dennis's request and must have missed converting that variable in a couple places (and not tested that path...)

Comment 2 Stephen Gallagher 2016-02-29 14:11:13 UTC
(In reply to Stephen Gallagher from comment #1)
> (In reply to Mattias Ellert from comment #0)
> > Description of problem:
> > 
> > mock --root fedora-rawhide-x86_64 --update
> > 
> >   Cleanup     : glibc-2.22.90-36.fc24.x86_64                             
> > 59/59 
> > /usr/sbin/convert-to-edition: line 163: grub2-mkconfig: command not found
> > This system has been converted to non-edition
> >   Verifying   : system-python-libs-3.5.1-6.fc25.x86_64                    
> > 1/59 
> > 
> > There is no grub in a mock chroot.
> 
> Right, that's not surprising in the mock chroot, but it's needed in real
> installs in order to make sure that the boot loader shows the correct
> edition.
> 
> 

For mock and ARMv7 systems, however, this won't be available. Peter Robinson suggested replacing this with grubby, which I'm now looking into. I'll also conditionalize it for mock to avoid the warning.


> > 
> > Version-Release number of selected component (if applicable):
> > 
> >   Upgrading   : fedora-release-25-0.1.noarch                             
> > 20/59 
> > 
> > 
> > The /usr/sbin/convert-to-edition also uses the $RPM_BUILD_ROOT environment
> > variable twice:
> > 
> > $ grep RPM /usr/sbin/convert-to-edition
> > # part of an RPM scriptlet.
> >     ln -sf ./os.release.d/issue-fedora $RPM_BUILD_ROOT/usr/lib/issue
> >     ln -sf ./os.release.d/issue-fedora $RPM_BUILD_ROOT/usr/lib/issue
> > 
> > This doesn't make sense.
> 
> You're right. I'm not sure what happened there. Probably a copy-and-paste
> error and I forgot to change those spots.
> 
> Previously, this stuff was handled in the %post script directly, but I moved
> it all to a script at Dennis's request and must have missed converting that
> variable in a couple places (and not tested that path...)

Well, the plus side here is that $RPM_BUILD_ROOT is guaranteed not to be set at this point, so while it's incorrect to have it there, it still ends up resolving to the right location, so no harm done. I'll still remove it, of course.

Comment 3 Stephen Gallagher 2016-02-29 15:18:10 UTC
OK, after further investigation, the full solution here is going to be fairly complicated, so for the short-term we're only going to support updating the bootloader on GRUB2 systems (and we'll just skip that piece for non-GRUB2 systems). Non-GRUB2 systems will get their bootloader automatically updated on the next kernel installation.

Pull requests have been submitted for fedora-release:
* https://pagure.io/fedora-release/pull-request/28 (Fedora 24)
* https://pagure.io/fedora-release/pull-request/27 (Rawhide/Fedora 25)

Comment 4 Mike McCune 2016-03-28 23:33:48 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions