Re: I don't believe what I just saw ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2014-12-05 at 15:21 -0800, Adam Williamson wrote:
> On Fri, 2014-12-05 at 18:12 -0500, Tom Horsley wrote:
> > On Fri, 05 Dec 2014 15:08:48 -0800
> > Adam Williamson wrote:
> > 
> > > It's intentional. See the bug.
> > 
> > Yea, I saw the bug and that's what confused me :-).
> > 
> > The initramfs file already exists. What reason is there for
> > a mass rebuild? I didn't see anything in the bug that explained
> > that.
> 
> I told you I don't feel like digging through the code to figure it out
> right now, it's release week, and I've had enough staring at anaconda
> source for this month. But, I mean, it's right there, the devs even gave
> you the starting point right in the bug report. The code's open. The
> function's called recreateInitrds . So go grep through the anaconda code
> for 'recreateInitrds' and you'll find the thing that's calling it, look
> at that thing and it'll probably tell you why. This is the 'open' bit of
> 'open source'. :)

so, fiiiine, you nagged me into doing it now, happy? :)

[adamw@adam anaconda (master %)]$ grep -R recreateInit *
anaconda.spec.in:- rpmostreepayload: Don't recreateInitrds for this payload (walters)
old_tests/pyanaconda_test/backend_test.py:            ('recreateInitrd', (A, ROOT_PATH), {}))
pyanaconda/install.py:        payload.recreateInitrds(force=True)
pyanaconda/packaging/rpmostreepayload.py:    def recreateInitrds(self, force=False):
pyanaconda/packaging/__init__.py:    def recreateInitrds(self, force=False):
[adamw@adam anaconda (master %)]$ git blame pyanaconda/install.py | grep recreateIn
57c19f44 (Brian C. Lane      2013-09-06 09:09:15 -0700 106)         payload.recreateInitrds(force=True)
[adamw@adam anaconda (master %)]$ git log | grep -10 57c19f44
...
commit 57c19f440148a0f31288bdabd923c4f663ad11fc
Author: Brian C. Lane <bcl@xxxxxxxxxx>
Date:   Fri Sep 6 09:09:15 2013 -0700

    Always regenerate initramfs (#994180)
    
    dracut depends on some of the configuration settings we write out in
    doConfiguration so we need to always regenerate the initramfs for the
    system after we write these.
commit 8efa6965fec7cf9edace6cb7a417069f02221677

So we're doing it because the initramfs won't necessarily be correct,
because anaconda writes out some configuration settings after it got
generated. You can go look at
https://bugzilla.redhat.com/show_bug.cgi?id=994180 and see the bug this
was added to fix. OK, extra credit, let's see what it did before that:

[adamw@adam anaconda (master %)]$ git checkout 8efa6965fec7cf9edace6cb7a417069f02221677
[adamw@adam anaconda ((8efa696...) %)]$ grep -R recreateI *
old_tests/pyanaconda_test/backend_test.py:            ('recreateInitrd', (A, ROOT_PATH), {}))
pyanaconda/packaging/livepayload.py:        self._recreateInitrds()
pyanaconda/packaging/__init__.py:            self._recreateInitrds()
pyanaconda/packaging/__init__.py:    def _recreateInitrds(self, force=False):
[adamw@adam anaconda ((8efa696...) %)]$ less pyanaconda/packaging/__init__.py
...
        new_firmware = False

        # Multiple driver disks may be loaded, so we need to glob for all
        # the firmware files in the common DD firmware directory
        for f in glob.glob(DD_FIRMWARE+"/*"):
            try:
                shutil.copyfile(f, "%s/lib/firmware/" % ROOT_PATH)
            except IOError as e:
                log.error("Could not copy firmware file %s: %s", f, e.strerror)
            else:
                new_firmware = True

...

        if new_firmware:
            self._recreateInitrds()

so for non-live installs it was rebuilding initrds when you'd pulled in
extra firmware as part of the install process (so the firmware got into
the initrd - as the firmwares got installed after the first version of
the initrd was built). For live installs it was always doing it:

[adamw@adam anaconda ((8efa696...) %)]$ grep -6 _recreateInit pyanaconda/packaging/livepayload.py 
    def postInstall(self):
        """ Perform post-installation tasks. """
        progressQ.send_message(_("Performing post-installation setup tasks"))
        blivet.util.umount(INSTALL_TREE)

        super(LiveImagePayload, self).postInstall()
        self._recreateInitrds()

If you do the same git blame dance and look back at commit
0c4ed2c2c4e03f0b753d13bddb90994498481ed7 it looks like before that there
was no initramfs recreation and live and it was added to fix
https://bugzilla.redhat.com/show_bug.cgi?id=853988 , and you can dive
down a rabbit hole and figure out what changed in live image
generation / installation / whatever so this had to be done for f18 but
it somehow worked before that, but this is the time sink I was trying to
avoid in the first place. =) Remember that live images don't 'install
packages', they just dump the live filesystem into place on the disk,
and anaconda has to clean around the edges of that, that'll certainly be
*part* of why anaconda has to re-generate the initramfs, but not the
whole story most likely.

still, this is how you answer questions like this, the code is there,
git is there, the commit logs are there, use the tools...whenever I
answer a question like this I'm doing all that stuff above to figure it
out, and when anaconda folks do they're probably doing the same thing
half the time because there's just so much of this crap it must be
impossible to remember it all...
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net
http://www.happyassassin.net

-- 
test mailing list
test@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe:
https://admin.fedoraproject.org/mailman/listinfo/test





[Index of Archives]     [Fedora Desktop]     [Fedora SELinux]     [Photo Sharing]     [Yosemite Forum]     [KDE Users]

  Powered by Linux