FS#55323 - [mkinitcpio] Hook symlinks cause erronous deprecation warnings

Attached to Project: Arch Linux
Opened by arc (arcnmx) - Monday, 28 August 2017, 19:33 GMT
Last edited by Dave Reisner (falconindy) - Sunday, 01 October 2017, 18:19 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Using symlinks in /etc/initcpio/* to another part of the filesystem causes mkinitcpio to warn with confusing messages like: "Hook 'modconf' is deprecated. Replace it with 'modconf' in your config".

I encountered this due to the use of a central system config store that installs symlinks to itself throughout the system. I was also shadowing an existing hook, hence my error message mentioning "modconf".

Steps to reproduce:
1. ln -s /dev/null /etc/initcpio/install/
2. mkinitcpio -L
3. Observe deprecated "null" warning.

See attached for a patch addressing the warning when both the source and destination file are the same, which makes for useless messages. This does not address the case where the symlink points outside of the folder but to a filename different than the symlink's name; perhaps a check for slashes in the link target or that the resolved path still points inside of the same directory (or one of initcpio dirs) should be used instead.
This task depends upon

Closed by  Dave Reisner (falconindy)
Sunday, 01 October 2017, 18:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  https://git.archlinux.org/mkinitcpio.git /commit/?id=8d59e6a1d7ef3e68b6ed3f17a7a0 c20873055592
Comment by Eli Schwartz (eschwartz) - Monday, 28 August 2017, 21:39 GMT
You should probably (also) send this to the arch-projects mailing list via `git send-email`.
Comment by Dave Reisner (falconindy) - Sunday, 01 October 2017, 18:19 GMT
Thanks for the report and the patch. Going with a slightly simpler solution.

Loading...