Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
NeilAlexander
PostPosted: Jul 11, 2011 - 06:36 AM
Rookie


Joined: Jul 21, 2007
Posts: 39
Location: Brisbane Australia

1. After downloading and unpacking the latest .iso image for the support CD, both "make menuconfig" and "make" gave me a bunch of "permission denied" errors before quitting. It looks like a simple Linux permissions problem, but nothing I have done so far has resolved it. Ideas?

2. I have written a little program to flash one of the on-board LEDs by writing alternating 1's and 0's to the LED's file, with intervening nanosleeps. If I just run it, it crashes with a "Segmentation fault". If I run it as "su", it works fine. Do I have to do all of my physical I/O as "su"?

Thanks in advance,
Neil
 
 View user's profile Send private message  
Reply with quote Back to top
hce
PostPosted: Jul 11, 2011 - 07:07 PM
Raving lunatic


Joined: Jan 07, 2003
Posts: 4580
Location: Oslo, Norway

1) Do a find . -type d -print 0 | xargs -0 chmod 755 followed by a find . -type f -print 0 | xargs -0 chmod 644. That should sort out all the permission issues. If you get permission denied while performing that, reset the file owner of the file to your user using the chown command.

2) Check which users have write access to the character device. You should also check if your open call returns a valid file descriptor, and not an error code.
 
 View user's profile Send private message  
Reply with quote Back to top
NeilAlexander
PostPosted: Jul 12, 2011 - 12:54 PM
Rookie


Joined: Jul 21, 2007
Posts: 39
Location: Brisbane Australia

hce wrote:
1) Do a find . -type d -print 0 | xargs -0 chmod 755 followed by a find . -type f -print 0 | xargs -0 chmod 644. That should sort out all the permission issues. If you get permission denied while performing that, reset the file owner of the file to your user using the chown command.

2) Check which users have write access to the character device. You should also check if your open call returns a valid file descriptor, and not an error code.


Thanks, hce. I tried that but I still get the following:

for "make menuconfig"
/bin/bash: package/config/mconf: Permission denied

for "make"
/bin/bash: package/lzma/lzmacheck.sh: Permission denied
/bin/bash: package/sed/sedcheck.sh: Permission denied
/bin/bash: package/sed/sedcheck.sh: Permission denied
/bin/bash: .//toolchain/dependencies/dependencies.sh: Permission denied
make: *** [dependencies] Error 126

By the way, it should be "-print0" rather than "-print 0"
 
 View user's profile Send private message  
Reply with quote Back to top
hce
PostPosted: Jul 13, 2011 - 08:38 PM
Raving lunatic


Joined: Jan 07, 2003
Posts: 4580
Location: Oslo, Norway

Quote:
By the way, it should be "-print0" rather than "-print 0"
Correct, -print0 it is. The former was a typo by me.
 
 View user's profile Send private message  
Reply with quote Back to top
NeilAlexander
PostPosted: Jul 14, 2011 - 03:32 AM
Rookie


Joined: Jul 21, 2007
Posts: 39
Location: Brisbane Australia

Also, did you mean to set 755 on files (not directories?) and 644 on directories (not files)? What is the downside of setting u+x permission on files that aren't executable?
---
A related question: In my system, right-clicking on a file shows properties which include a MIME type. Shell scripts and executables generally have the MIME type "application/x-executable", whether or not they have +x permission set. Is this MIME type interpreted by Linux as being equivalent to +x permission?
 
 View user's profile Send private message  
Reply with quote Back to top
hce
PostPosted: Jul 14, 2011 - 04:49 PM
Raving lunatic


Joined: Jan 07, 2003
Posts: 4580
Location: Oslo, Norway

Quote:
Also, did you mean to set 755 on files (not directories?) and 644 on directories (not files)? What is the downside of setting u+x permission on files that aren't executable?
Directories needs to be executable to be able to go into them, files do not need to be executable. There is nothing limiting you setting file permissions to 755, you are still able to read them.
 
 View user's profile Send private message  
Reply with quote Back to top
hce
PostPosted: Jul 14, 2011 - 04:51 PM
Raving lunatic


Joined: Jan 07, 2003
Posts: 4580
Location: Oslo, Norway

Quote:
A related question: In my system, right-clicking on a file shows properties which include a MIME type. Shell scripts and executables generally have the MIME type "application/x-executable", whether or not they have +x permission set. Is this MIME type interpreted by Linux as being equivalent to +x permission?
I guess your distribution looks at the start of the file to figure out its contents. Shell scripts typically start with a hashbang, to indicate what shell should be executed to run the script.
 
 View user's profile Send private message  
Reply with quote Back to top
NeilAlexander
PostPosted: Jul 15, 2011 - 01:49 AM
Rookie


Joined: Jul 21, 2007
Posts: 39
Location: Brisbane Australia

Thanks again, hce, and my regards to all the citizens of Oslo. I notice you helped me way back on 2009, so you are delivering great service to the AVR community!
 
 View user's profile Send private message  
Reply with quote Back to top
hugoboss
PostPosted: Jul 15, 2011 - 02:13 AM
Resident


Joined: Feb 19, 2010
Posts: 507
Location: Montreal, QC, CA

No sane linux distribution would ever assume an executable MIME type as +x. That would be very very bad for a number of reasons. It's the kind of thing Windows does.
 
 View user's profile Send private message  
Reply with quote Back to top
NeilAlexander
PostPosted: Jul 19, 2011 - 01:22 AM
Rookie


Joined: Jul 21, 2007
Posts: 39
Location: Brisbane Australia

Smile
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits