LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 10-06-2010, 12:05 PM   #1
Philmac
LQ Newbie
 
Registered: Sep 2010
Distribution: Fedora 9
Posts: 11

Rep: Reputation: 1
Question insmod error "operation not permitted" as root


Hello,

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

Any ideas?

Thanks in advance

Last edited by Philmac; 10-08-2010 at 01:26 PM.
 
Old 10-06-2010, 09:04 PM   #2
mf93
Member
 
Registered: Jun 2009
Distribution: Debian Squeeze, centOS
Posts: 229

Rep: Reputation: 36
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
 
Old 10-07-2010, 09:05 AM   #3
Philmac
LQ Newbie
 
Registered: Sep 2010
Distribution: Fedora 9
Posts: 11

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by mf93 View Post
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.
 
Old 10-07-2010, 09:23 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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.
 
Old 10-07-2010, 09:35 AM   #5
mf93
Member
 
Registered: Jun 2009
Distribution: Debian Squeeze, centOS
Posts: 229

Rep: Reputation: 36
If changing the permissions for the install directory didnt fix it i doubt it will be a permissions problem.
 
Old 10-07-2010, 09:42 AM   #6
Philmac
LQ Newbie
 
Registered: Sep 2010
Distribution: Fedora 9
Posts: 11

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by unSpawn View Post
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
 
Old 10-07-2010, 09:50 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Can you install other modules?

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)?
 
Old 10-07-2010, 10:43 AM   #8
Philmac
LQ Newbie
 
Registered: Sep 2010
Distribution: Fedora 9
Posts: 11

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by catkin View Post
Can you install other modules?

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.
 
Old 10-08-2010, 01:26 PM   #9
Philmac
LQ Newbie
 
Registered: Sep 2010
Distribution: Fedora 9
Posts: 11

Original Poster
Rep: Reputation: 1
Figured it out (sort of)! Had to replace insmod with depmod -a and modprobe then copy foo.ko to lib/modules/$(uname -r)/kernel/drivers/misc/
 
1 members found this post helpful.
Old 10-09-2010, 03:13 PM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Philmac View Post
Figured it out (sort of)! Had to replace insmod with depmod -a and modprobe then copy foo.ko to lib/modules/$(uname -r)/kernel/drivers/misc/
Thanks for posting your solution.
 
Old 10-11-2010, 10:36 PM   #11
mf93
Member
 
Registered: Jun 2009
Distribution: Debian Squeeze, centOS
Posts: 229

Rep: Reputation: 36
why is it only sort of figured out? and if youve solved it mark the thread solved
 
  


Reply

Tags
driver, error, insmod, root



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"creating symbolic link" "operation not permitted" wheni Linux - Newbie 3 05-08-2011 01:36 AM
Logged in as "root"/Fedora 8 but get "Operation not permitted" when using "chmod etc gosunlee Linux - Newbie 7 02-10-2008 05:56 AM
bash# "chvt N" as non-root says 'Operation not permitted' GrapefruiTgirl Linux - Desktop 4 09-16-2007 04:44 PM
"capset: Operation not permitted" error when I run valgrind. rsravi74 Linux - Newbie 1 09-02-2007 05:30 PM
"Operation not permitted" error logging in to Ubuntu Dapper Drake paulBottomley Linux - Newbie 7 08-10-2006 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration