Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 656992 - sys-firmware/intel-microcode-20180527-r1 wrongly reports not having installed something when boot is unmounted
Summary: sys-firmware/intel-microcode-20180527-r1 wrongly reports not having installed...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-31 19:29 UTC by Christian Widmer
Modified: 2018-08-08 23:46 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info.log,6.83 KB, text/plain)
2018-05-31 19:29 UTC, Christian Widmer
Details
build.log (sys-firmware:intel-microcode-20180807_p20180808:20180808-191613.log,153.57 KB, text/plain)
2018-08-08 19:22 UTC, Christian Widmer
Details
ls -lv /boot (ls-boot.log,868 bytes, text/plain)
2018-08-08 19:25 UTC, Christian Widmer
Details
build.log (/boot manually mounted before emerging) (sys-firmware:intel-microcode-20180807_p20180808:20180808-192652.log,153.31 KB, text/plain)
2018-08-08 19:30 UTC, Christian Widmer
Details
sys-firmware:intel-microcode-20180804:20180808-191618.log (sys-firmware:intel-microcode-20180804:20180808-191618.log,546 bytes, text/plain)
2018-08-08 19:38 UTC, Christian Widmer
Details
emerge -d log with both build logs attached (emerge.log,518.98 KB, text/plain)
2018-08-08 20:38 UTC, Christian Widmer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Widmer 2018-05-31 19:29:54 UTC
Created attachment 534330 [details]
emerge --info

I have a separate boot partition that is not mounted by default. While this partition gets automounted as expected during the installation and the microcode is actually getting installed, elog wrongly reports that no ucode has been installed.

Steps to reproduce:
1. Unmount /boot
2. emerge -1 intel-microcode
3. See the warning that no ucode was installed
4. Manually mount /boot and confirm there actually has been an intel-uc.img installed into /boot despite the warning
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2018-08-08 19:08:04 UTC
If this is still an issue, please show us a build.log of >=sys-firmware/intel-microcode-20180807_p20180808 and `ls -lv /boot` output.
Comment 2 Christian Widmer 2018-08-08 19:22:32 UTC
Created attachment 542802 [details]
build.log

This is indeed still an issue.
Comment 3 Christian Widmer 2018-08-08 19:25:44 UTC
Created attachment 542804 [details]
ls -lv /boot

Directly after installing, the /boot directory obviously only shows the .keep file for it gets unmounted post-emerge. If I then mount it manually (without touching emerge in the meantime, of course), the attached output is shown.
Comment 4 Christian Widmer 2018-08-08 19:30:20 UTC
Created attachment 542806 [details]
build.log (/boot manually mounted before emerging)

Here is a build.log when I mount /boot manually before emerging intel-microcode. As you can see, the warning that no microcode was installed is missing in that case.
Comment 5 Christian Widmer 2018-08-08 19:38:02 UTC
Created attachment 542808 [details]
sys-firmware:intel-microcode-20180804:20180808-191618.log

There is a second log file created in PORTDIR when I emerge intel-microcode, which I should probably also attach. This is from the first emerge today (with /boot unmounted before executing emerge intel-microcode).
Comment 6 Thomas Deutschmann (RETIRED) gentoo-dev 2018-08-08 19:43:58 UTC
Mh, I don't understand yet:

Is "mount-boot_pkg_postinst" failing for you?

I.e. when pkg_postinst is called for the sanity check, all files should be already merged on disk in their final destinations.

Due to

> >>> /boot/intel-uc.img

I assume that the file "intel-uc.img" was successfully installed in /boot.

This is only possible if

> use initramfs && mount-boot_pkg_preinst

from pkg_preinst was successful.

But if this call was successful in pkg_preinst, I don't see a reason why it should fail in pkg_postinst. Also keep in mind, that we don't umount. I.e. if /boot was mounted successfully in pkg_preinst, it should be still mounted in pkg_postinst phase...

I am wondering if

> -s "${EROOT%/}/boot/intel-uc.img"

is the problem, i.e. that you have an EROOT offset.

Maybe you can run ebuild/emerge with "--debug" (including merge step when just using ebuild command)?
Comment 7 Christian Widmer 2018-08-08 20:21:21 UTC
/boot is unmounted post-emerge if it was /unmounted before executing emerge. The following table shows what happens in the different cases:

pre-install     | post-install    | warning | /boot/intel-ucode.img installed
-----------------------------------------------------------------------------
/boot unmounted | /boot unmounted | yes     | yes
/boot mounted   | /boot mounted   | no      | yes

Additionally, I have tracked down the issue. /boot gets unmounted by mount-boot_pkg_postrm (in pkg_postrm(); line 161) , which is executed before pkg_postinstall if an earlier version was installed and it also gets unmounted by mount-boot_pkg_postinst (in pkg_postinst(); line 169). This leads to the the check if something was installed failing because it only happens afterwards, when it obviously does find nothing because /boot has already been unmounted by that time. The check if something has been installed has to happen before pkg_postrm() to avoid the warning.
Comment 8 Christian Widmer 2018-08-08 20:27:05 UTC
Unfortunately, I was a bit too fast. Even deleting those two lines does not make the issue go away.
Comment 9 Christian Widmer 2018-08-08 20:38:49 UTC
Created attachment 542812 [details]
emerge -d log with both build logs attached

I have attached the output of emerge -d and appended both logs from PORTDIR, separated by a few ----- because they also contain debug output.
Comment 10 Thomas Deutschmann (RETIRED) gentoo-dev 2018-08-08 20:41:05 UTC
I am now able to reproduce and can work on a fix, thanks.
Comment 11 Larry the Git Cow gentoo-dev 2018-08-08 23:46:29 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03bd51396a4f29fb393700ad75dc34422f9dd297

commit 03bd51396a4f29fb393700ad75dc34422f9dd297
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2018-08-08 23:44:17 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2018-08-08 23:46:21 +0000

    sys-firmware/intel-microcode: sanity check moved to pkg_preinst ...
    
    ...and logging improved
    
    Closes: https://bugs.gentoo.org/656992
    Package-Manager: Portage-2.3.44, Repoman-2.3.10

 .../intel-microcode-20180807_p20180808-r1.ebuild   | 254 +++++++++++++++++++++
 1 file changed, 254 insertions(+)