[SOLVED] insmod error "operation not permitted" as root
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to install a third party driver and the provided makefile makes a call to insmod. Whenever I try to install this I run "su", so I am root and should have permissions. However, when I run "make install" I get the following output:
Code:
# make install
Unloading any instances of foo module
Loading new foo into running kernel
insmod: error inserting 'foo.ko': -1 Operation not permitted
make: *** [install] Error 1
Like I said before, I'm doing this as root, so I don't see how this is possible. Additionally, every time I try to do this it seems to cause a lot of damage to whatever kernel I'm currently booted in; USB and ethernet (and hence the Internet) stop working and I have to wipe the kernel and reinstall it.
I'm currently running Fedora 9 kernel 2.6.27.25-78.2.56.fc9.x86_64
try changing the permissions of the folder in which the makefile is located
for example:
Code:
# chmod -R 744 foo.d
where foo.d is the directory in which makefile resides
Thanks for your reply mf93. I just tried what you said and according to "ls -l" the permissions for the directory are now "drwxr--r--". Unfortunately, I still get the exact same error message when I try "make install". Could it be a permissions issue with another directory? I have access to all the source files and can make any changes that might be necessary.
Try running 'make -n install 2>&1|tee /tmp/make.txt'. This will --dry-run the install part and log all details to the "/tmp/make.txt" plain text file. Maybe reading it shows some clues wrt commands, paths or permissions else you could attach it.
Try running 'make -n install 2>&1|tee /tmp/make.txt'. This will --dry-run the install part and log all details to the "/tmp/make.txt" plain text file. Maybe reading it shows some clues wrt commands, paths or permissions else you could attach it.
Thanks for your reply unSpawn. I'm new to Linux so I don't know how to interpret any of this -- here's the output.
Code:
$ make -n install 2>&1|tee /tmp/make.txt
echo "Unloading any instances of foo module"
if [ "`awk '/bar/ {print $1}' /proc/modules`" = "foo" ]; then \
rmmod foo; \
fi;
echo "Loading new foo into running kernel"
/sbin/insmod foo.ko
echo "Copy newly build module to /lib/modules/2.6.27.25-78.2.56.fc9.x86_64/kernel/drivers/company"
if [ ! -d /lib/modules/2.6.27.25-78.2.56.fc9.x86_64/kernel/drivers/company ]; then \
mkdir /lib/modules/2.6.27.25-78.2.56.fc9.x86_64/kernel/drivers/company; \
fi;
cp -f foo.ko /lib/modules/2.6.27.25-78.2.56.fc9.x86_64/kernel/drivers/company/foo.ko
echo "Remove previous foo character device file"
rm -f /dev/foo
echo "Creating character special file for driver"
mknod -m 666 /dev/foo c `awk '/bar/ {print $1}' /proc/devices` 0
echo "Adding entry to /etc/rc.d/rc.local"
if [ -f rc.local.temp ]; then \
rm -r rc.local.temp; \
fi;
if [ -f /etc/rc.d/rc.local ]; then \
cp /etc/rc.d/rc.local /etc/rc.d/rc.local.bak; \
else \
touch /etc/rc.d/rc.local; \
fi;
# copy all lines, except those for foo module to temp file
awk 'BEGIN { eat=0; last=0; } \
/load foo kernel module/ { eat=1; } \
/end of foo load/ { eat=0; last=1 } \
{ \
if (eat && last==0) true; \
else if (eat==0 && last) \
last=0; \
else if (eat==0 && last==0) print >> "rc.local.temp" \
}' < /etc/rc.d/rc.local
#add entry for foo in the new file
echo "#load foo kernel module" >> rc.local.temp
echo "if [ -f /lib/modules/2.6.27.25-78.2.56.fc9.x86_64/kernel/drivers/company/foo.ko ]; then \\" >> rc.local.temp
echo "insmod /lib/modules/2.6.27.25-78.2.56.fc9.x86_64/kernel/drivers/company/foo.ko; \\" >> rc.local.temp
echo "fi;" >> rc.local.temp
echo "#end of foo load" >> rc.local.temp
#copy temp file to /etc/rc.d
mv -f rc.local.temp /etc/rc.d/rc.local
chmod 755 /etc/rc.d/rc.local
Is there any more information in dmesg or the /var/log/[debug|messages|syslog|<other>] files?
Is the module for the correct architecture?
Does the module depend on other modules being loaded first (but likely a different error message if so)?
Thanks for your reply catkin.
Can you install other modules?
I honestly don't know; I just started using Linux and this driver is the first time I've ever even heard of a module. Are there any fairly innocuous modules out there that I could use to test this?
Is there any more information in dmesg or the /var/log/[debug|messages|syslog|<other>] files?
dmesg
Code:
foo: module license 'Proprietary' taints kernel.
foo: DeviceName PCI interface not found
foo: DeviceName PCI interface not found
foo: DeviceName PCI interface not found
/var/log/messages
Code:
Oct 6 12:27:49 lisa kernel: foo: module license 'Proprietary' taints kernel.
Oct 6 12:27:49 lisa kernel: foo: DeviceName PCI interface not found
Oct 6 12:54:47 lisa kernel: foo: DeviceName PCI interface not found
Oct 7 10:02:33 lisa kernel: foo: DeviceName PCI interface not found
I didn't find anything else.
Is the module for the correct architecture?
Getting the module to simply compile was a big hassle. One of the things I had to change was replacing "i686" with "core2" in the makefiles (after updating gcc), so I think it's now compiled for my architecture.
Does the module depend on other modules being loaded first (but likely a different error message if so)?
Not that I'm aware of; the vendor's installation instructions don't mention any.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.