free5lot / hid-apple-patched

Allows to swap the Fn key and left Control key and other tweaks on Macbook Pro and Apple keyboards in GNU/Linux
GNU General Public License v2.0
350 stars 61 forks source link

DKMS support #18

Closed almson closed 8 years ago

almson commented 8 years ago

DKMS support would be very handy.

Here is a dkms.conf file that seems to work:

MAKE="make LINUX_HEADER_DIR=/usr/src/linux-headers-${kernelver}"
BUILT_MODULE_NAME=hid-apple
DEST_MODULE_LOCATION='/kernel/drivers/hid'
PACKAGE_NAME=hid-apple
PACKAGE_VERSION=1.0
REMAKE_INITRD=yes
AUTOINSTALL=yes

To install, save the dkms.conf file into the source code folder, and:

sudo dkms add .
sudo dkms build hid-apple/1.0
sudo dkms install hid-apple/1.0

The instructions to override hid_apple * extra are not needed.

free5lot commented 8 years ago

Thank you @almson for your issue, could you make this as Pull Request so I could accept your tested version? PS. Maybe AUTOINSTALL=yes is a good option too, and maybe MAKE and CLEAN options are not needed, are they?

almson commented 8 years ago

Ok, I will do that after I test it thoroughly. I haven't worked with dkms before, so I'm not familiar with all the options. I'll test your suggestions.

free5lot commented 8 years ago

Thank you @almson.

almson commented 8 years ago

I've updated the dkms config in the original post and confirm that it's working great through many kernel updates.

free5lot commented 8 years ago

Thank you @almson, I'll add this as new file and will add it to instruction. Do you personally consider it as the best install option over install.sh and manual build in Ubuntu?

almson commented 8 years ago

I think dkms is simple, easy and you only have to do it once. Again, I'm not too knowledgeable about these things to know what advantages the other approaches might have. Perhaps the linux header path has to be adjusted on other distros and a script can check this and prompt the user?

What would be the best install option on Ubuntu, however, would be a .deb file that packages the dkms, is in the repos, and shows up in the Additional Drivers applet. Then we could tell Linus and his kernel team to kiss our ass.

Some instructions: https://help.ubuntu.com/community/Kernel/DkmsDriverPackage If I have time I'll give it a shot to try to create it.

free5lot commented 8 years ago

It would be great. But not sure if it's not an overkill for a patch with several additional kernel options.

BastienMunoz commented 8 years ago

After doing the "dkms install", what do I need to do to swap fn and control? I rebooted my computer but nothing changed, I think that I need to change some parameters in a file or something, but I can't find it.

Thanks for your help!

free5lot commented 8 years ago

Hm, this information should be added to README for DKMS-installation way.

Not sure about any difference for DKMS installation, but in usual case you should modify modprobe config file of hid-apple, like /etc/modprobe.d/hid_apple.conf and add desired options there. E.g. options like swap_fn_leftctrl=1, ejectcd_as_delete=1. Usual hid-apple options fnmode, iso_layout and swap_opt_cmd are also supported.

Additional available options of this patched version:

More information how to add these options: https://help.ubuntu.com/community/AppleKeyboard#Ubuntu_11.10_up_to_recent https://wiki.archlinux.org/index.php/Apple_Keyboard

BastienMunoz commented 8 years ago

After looking at the install.sh file I've found out the file to modify, but it still didn't work, I missed that I needed to do a: "sudo update-initramfs -u -k all" like mentioned in your first link. It was my mistake.

Thanks for your help!

free5lot commented 8 years ago

@Ichigo-Roku you're welcome!