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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
12-24-2004, 04:26 AM
|
#1
|
LQ Newbie
Registered: Dec 2004
Location: São Paulo, Brazil
Distribution: Ubuntu 9.10
Posts: 29
Rep:
|
Linux Environment variables
Hello guys,
I'm currently creating an RPM package for a device driver and I 'm having difficulty finding documentation which contains a list of standard Linux environment variables that I can use in the spec file. This presents a problem because I'm currently pointing to specific directories in my box (for example the kernel source path), which will be different depending on what version of the Kernel and etc that the end-user has. Any one know where I can find this stuff?
Also, how does linux handle environment variables? What files do I have to modify to include a directory in the PATH, etc...
Thanks in advance, you guys have always been great.
|
|
|
12-24-2004, 05:09 AM
|
#2
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
Most of the variables you would be concerned with would be shell variables. You will find a long list of shell variables in man bash.
Of course each program may have its own set of variables. For instance it's common to have these variables:
JAVA_HOME=/usr/lib/java
KDEDIR=/opt/kde
To modify the path you would do something like this:
export PATH=${PATH}:/MyDirectory
You can change this for all users by putting it in /etc/profile or just a specific user by editing ~/.bashrc
|
|
|
12-24-2004, 09:18 AM
|
#3
|
LQ Newbie
Registered: Dec 2004
Location: São Paulo, Brazil
Distribution: Ubuntu 9.10
Posts: 29
Original Poster
Rep:
|
Those are good tips /bin/bash, thanks. But I still can't find a variable or a command to discover the kernel version, or the path to the kernel source of the user.
|
|
|
12-24-2004, 11:25 AM
|
#4
|
Senior Member
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054
Rep:
|
uname -r will give you the running kernel version.
for the kernel source, mine's in /usr/src where there's a directory called linux-2.X.XXXX-X. basically look in /usr/src.
the file that i use to add to the path variable is /etc/profile as it allows for the path to be seen globally for all users. after saving changes, you can load those variables with the 'source /etc/profile' command.
|
|
|
12-31-2004, 05:27 AM
|
#5
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
Most config files will set the path to the kernel sources to the default /usr/src/linux, and of course if there are no sources there you get an error. If you put your kernel sources somewhere else just make a symlink /usr/src/linux that points to your sources. e.g.
/usr/src/linux -> /home/user/linux-2.6.10
|
|
|
12-31-2004, 12:19 PM
|
#6
|
LQ Newbie
Registered: Dec 2004
Location: São Paulo, Brazil
Distribution: Ubuntu 9.10
Posts: 29
Original Poster
Rep:
|
It works, thanks
|
|
|
All times are GMT -5. The time now is 09:33 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|