You are not logged in.

#1 2025-04-21 19:06:17

utkarshverma
Member
Registered: 2022-12-30
Posts: 18

[SOLVED] Using symlinked /etc/modprobe.d files with mkinitcpio

For maintenance convenience and visibility, I like to keep all files I modify (system-wide and user) in my dotfiles repo (https://github.com/UtkarshVerma/dotfiles). However, I faced an issue when I tried to apply this to /etc/modprobe.d.

So, my module options are saved in /etc/modprobe.d/gmk67.conf -> /home/subaru/dotfiles/root/etc/modprobe.d/gmk67.conf. However, when I generate the initramfs and reboot, the options are not applied until I remove and load the module again (explained here: https://bbs.archlinux.org/viewtopic.php?id=303721)

So, I went ahead and inspected the contents of the initramfs and noticed that mkinitcpio packages the symlinks as they are. So, when the module is loaded during boot, the options are not applied since /home is probably not mounted at that time.

Now, my main question is, how do I get this to work? Is there an option I could pass to mkinitcpio that tells it to copy files to the initramfs rather than symlinking them? I only want this for symlinks within /etc/modprobe.d.

Any help would be appreciated. Thanks!

Last edited by utkarshverma (2025-04-22 09:26:30)

Offline

#2 2025-04-21 19:58:29

utkarshverma
Member
Registered: 2022-12-30
Posts: 18

Re: [SOLVED] Using symlinked /etc/modprobe.d files with mkinitcpio

So, I fixed this by adding a FILES+=(/etc/modprobe.d/*.conf) via a drop-in mkinitcpio.conf config. As mentioned in mkinitcpio manpage, add_file results in copying both the target and the link in case of symlinks.

Offline

Board footer

Powered by FluxBB