Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 686830

Summary: sys-firmware/intel-microcode: installation will fail when /boot is mounted ro only
Product: Gentoo Linux Reporter: Thomas Deutschmann (RETIRED) <whissi>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: CONFIRMED ---    
Severity: normal CC: dev-portage, josef64
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=710618
Whiteboard:
Package list:
Runtime testing required: ---

Description Thomas Deutschmann (RETIRED) gentoo-dev 2019-05-26 23:59:16 UTC
# mount -o remount,ro /boot
# emerge -1 sys-firmware/intel-microcode

...will fail with

>  * checking 233 files for package collisions
>  * One or more files installed to this package are set to be installed to
>  * read-only filesystems. Please mount the following filesystems as read-
>  * write and retry.
>  *
>  *      /boot
>  *
>  * Package 'sys-firmware/intel-microcode-20190514_p20190525' NOT merged
>  * due to read-only file systems. If necessary, refer to your elog
>  * messages for the whole content of the above message.

error.

However, we are using mount-boot elcass to handle exactly this case. And eclass will detect that /boot is mounted ro only:

>  * To avoid automounting and auto(un)installing with /boot,
>  * just export the DONT_MOUNT_BOOT variable.
> 
>  * Your boot partition, detected as being mounted at /boot, is read-only.
>  * It will be remounted in read-write mode temporarily.

It looks like portage is checking for /boot after src_install, before any pkg_* function which clashes with mount-boot eclass.

It's working as expected when /boot is unmounted.
Comment 1 Zac Medico gentoo-dev 2019-05-27 04:55:58 UTC
(In reply to Thomas Deutschmann from comment #0)
> It looks like portage is checking for /boot after src_install, before any
> pkg_* function which clashes with mount-boot eclass.

The readonly and file collision checks are intentionally executed prior to pkg_preinst, since pkg_preinst could potentially make irreversible changes that are better to avoid when the readonly and file collision checks fail.

I suppose we could trust that execution of pkg_preinst should be harmless, and delay the readonly and file collisions checks until afterwards. Maybe we should support a RESTRICT or PROPERTIES value to trust pkg_preinst in this respect.
Comment 2 Zac Medico gentoo-dev 2019-06-05 02:24:03 UTC
Note that FEATURES=mount-sandbox may interfere with mount-boot.eclass functions.
Comment 3 Thomas Deutschmann (RETIRED) gentoo-dev 2019-06-05 21:18:56 UTC
In my case there's _no_ FEATURES=mount-sandbox set.
Comment 4 Till Schäfer 2020-05-12 11:04:27 UTC
For me, this also fails for unmounted /boot. See Bug 710618