Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 348946 - mount-boot.eclass should unmount or remount to ro again post-install or post-rm
Summary: mount-boot.eclass should unmount or remount to ro again post-install or post-rm
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: AMD64 Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-17 12:36 UTC by Jaco Kroon
Modified: 2011-02-13 07:40 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaco Kroon 2010-12-17 12:36:44 UTC
The eclass currently correctly remounts /boot to rw or mounts /boot pre-install or pre-rm, however, it leaves /boot like this when done merging.  Ideally /boot mount options should be returned exactly the way it was found before tampering with it.
Comment 1 SpanKY gentoo-dev 2011-01-09 03:20:40 UTC
should be all set now.  it might not recover 100% on an emerge of an already installed package since the post funcs arent in the emerged package's env, but it should pick up after that.

http://sources.gentoo.org/eclass/mount-boot.eclass?r1=1.17&r2=1.18
Comment 2 Jaco Kroon 2011-01-10 08:59:28 UTC
Looks good thanks!
Comment 3 Jaco Kroon 2011-02-10 07:08:51 UTC
Hi,

Afraid it remounts back to ro too soon, and also in cases where /boot was NOT mounted ro to begin with.

We've just set up a chroot where /mnt/gentoo/boot was mounted rw, chroot, emerge -av grub-static resulted in:

 * 
 * Automatically remounting /boot as ro
 * 
>>> Original instance of package unmerged safely.
mv: cannot move `//boot/grub/stage2' to `//boot/grub/stage2.old': Read-only file system
 * *** IMPORTANT NOTE: you must run grub and install
 * the new version's stage1 to your MBR.  Until you do,
 * stage1 and stage2 will still be the old version, but
 * later stages will be the new version, which could
 * cause problems such as an unbootable system.
 * This means you must use either grub-install or perform
 * root/setup manually! For more help, see the handbook:
 * http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=1&chap=10#grub-install-auto
 * Copying files from /lib/grub, /usr/lib/grub and /usr/share/grub to //boot/grub

However, this may have been caused by an incorrect /etc/mtab entry indicating that /boot was mounted ro.  However, in the case where we're in a live system with an actual ro /boot the above still happens.

It would seem that the remounting back to ro (or unmounting) happens somewhere between src_install and pkg_postinstall.  My suggestion would be to postpone this till after pkg_postinstall as this should resolve the issue we're experiencing currently.  It should be as simple as renaming the function on line 104 of the eclass from mount-boot_pkg_postinst to whatever is the correct name.

Please let me know if this should be considered a new bug or if it's OK to leave it here.