Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 523684 - sys-apps/portage: config protection for files renamed or removed by the sysadmin
Summary: sys-apps/portage: config protection for files renamed or removed by the sysadmin
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, PATCH
Depends on:
Blocks:
 
Reported: 2014-09-25 10:03 UTC by cyberbat
Modified: 2014-12-04 05:41 UTC (History)
1 user (show)

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


Attachments
dblink.mergeme: implement bug #523684 (dblink.mergeme-implement-bug-523684.patch,5.15 KB, patch)
2014-09-26 03:14 UTC, Zac Medico
Details | Diff
CONFIG_PROTECT: handle non-existent files (listed directly in CONFIG_PROTECT) (CONFIG_PROTECT-handle-non-existent-files.patch,3.08 KB, patch)
2014-10-25 01:03 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cyberbat 2014-09-25 10:03:25 UTC
I have host with gentoo and xen hypervizor on it. To boot Xen by default I have rename 20_linux_xen to 10_linux_xen and 10_linux to 20_linux. But when I update or reinstall grub it installs 10_linux and 20_linux_xen again so as I have 10_linux, 10_linux_xen, 20_linux and 20_linux_xen.

I understand why it's done so, but it doesn't seems as correct behavior for me. Or may be I should change boot menu order in some other way?
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-09-25 10:16:20 UTC
Why would you run the bootloader in a domU at all? app-emulation/xen-tools has pygrub for that.

http://wiki.xen.org/wiki/PyGrub

Additionally, you could play with INSTALL_MASK and CONFIG_PROTECT_MASK in make.conf to keep sys-boot/grub's files out or protect them so they would never be overwritten.
Comment 2 cyberbat 2014-09-25 13:17:14 UTC
I use grub on dom0 only
Comment 3 Mike Gilbert gentoo-dev 2014-09-25 14:18:29 UTC
This seems like a missing piece of the config-protect feature in portage.
Comment 4 Zac Medico gentoo-dev 2014-09-25 15:41:30 UTC
This could be handled by checking for files that are in CONTENTS of the installed instance, but don't exist in the file system. In this case, we could merge the new file as a ._cfg, so that the user will be prompted by etc-update/dispatch-conf.
Comment 5 Mike Gilbert gentoo-dev 2014-09-25 16:02:36 UTC
(In reply to Zac Medico from comment #4)

Yes, I have had the same idea, but have been lazy about implementing it. ^_^
Comment 6 Mike Gilbert gentoo-dev 2014-09-25 16:04:25 UTC
Oh, for systemd specifically, it would be nice if that also worked for symlinks that the sysadmin has removed. See also bug 485598.

I imagine that would require some modification of etc-update/dispatch-conf as well.
Comment 7 Zac Medico gentoo-dev 2014-09-26 03:14:13 UTC
Created attachment 385488 [details, diff]
dblink.mergeme: implement bug #523684

If a CONFIG_PROTECTed file was installed but no longer exists in the file system, then it may have been deleted or renamed by the admin. Therefore, force the file to be merged with a ._cfg name, so that the admin will be prompted for this update.
Comment 9 Zac Medico gentoo-dev 2014-10-20 19:33:47 UTC
This is fixed in 2.2.14.
Comment 10 Zac Medico gentoo-dev 2014-10-24 09:12:38 UTC
I've notice that etc-update does not prompt for updates when the destination file doesn't exist. So, I think we should fix that before we can consider this bug "fixed".
Comment 11 Zac Medico gentoo-dev 2014-10-24 09:17:55 UTC
Also, if a file (rather than a directory) is listed in CONFIG_PROTECT (supported since bug #14321), the the ConfigProtect class will not protect it unless it exits. So, we should fix it to work even if the file does not exist (due to being renamed or removed by the sysadmin).
Comment 12 Zac Medico gentoo-dev 2014-10-24 23:46:42 UTC
(In reply to Zac Medico from comment #10)
> I've notice that etc-update does not prompt for updates when the destination
> file doesn't exist. So, I think we should fix that before we can consider
> this bug "fixed".

Actually, both etc-update and dispatch-conf appear to work correctly, so the ConfigProtect issue (comment #11) is the only thing left to fix.
Comment 13 Zac Medico gentoo-dev 2014-10-25 01:03:59 UTC
Created attachment 387326 [details, diff]
CONFIG_PROTECT: handle non-existent files (listed directly in CONFIG_PROTECT)

This fixes the ConfigProtect class, etc-update, and dispatch-conf to account for non-existent files (rather than directories) that are listed directly in CONFIG_PROTECT. It has been valid to list files directly in CONFIG_PROTECT since bug #14321. However, the support for non-existent files added for bug #523684 did not include support for non-existent files listed directly in CONFIG_PROTECT.
Comment 15 Brian Dolbec (RETIRED) gentoo-dev 2014-12-04 05:41:57 UTC
This is in the portage-2.2.15 release.