LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 03-06-2008, 05:48 AM   #1
freeindy
Member
 
Registered: Nov 2002
Posts: 205

Rep: Reputation: 30
nfs root path variable (pxe/nfs boot)


Hi,

How can I pass, either by dhcpd.conf or by kernel boot parameter, a variable that is exported in host bash.

I have a target that boots from the host but I want the root path to be 'read' by host variable. For example,

in bash:
export TARGET="/my/root/path"

Passing by kernel boot parameter
nfsroot:xx.xx.xx.xx:$TARGET
THIS DOESN'T WORK. It passed :: mount $TARGET and got kernel panic.

In dhcpd.conf the variable is set as:
option Root-Path "/my/root/path"
and I don't know how to change it here.

Or is it possible by any other means?

Thanks
¤ndy
 
Old 03-07-2008, 03:08 PM   #2
Wells
Member
 
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 383

Rep: Reputation: 31
In your dhcpd.conf file, is that option passed as a global option or as one for a specific host? If it is as a global option, you should be able to override it for an individual host in that hosts' configuration section of the dhcpd.conf file.
 
Old 03-07-2008, 03:29 PM   #3
beadyallen
Member
 
Registered: Mar 2008
Location: UK
Distribution: Fedora, Gentoo
Posts: 209

Rep: Reputation: 36
I don't think it's possible to do what you want via an environment variable in the dhcpd.conf file. It's not interpreted as a shell script, so it won't work directly. I suppose you could have a sed script to make the changes, the restart dhcpd, but it'd be an ugly hack to say the least.

I do something similar to what you want but with symlinks for the root directory. In the config file, I've got a permanent nfs root entry as /mnt/nfsroots/currentroot. currentroot is actually a symlink to the directory I really want to export. I've got a shellscript that swaps the symlink between directories whenever I want to change filesystems. Actually, my kernel sent by tftp is a symlink too. Dead easy to test new images on my dreambox.

Why are you wanting to do this anyway?

Last edited by beadyallen; 03-07-2008 at 03:33 PM.
 
Old 03-11-2008, 10:19 AM   #4
freeindy
Member
 
Registered: Nov 2002
Posts: 205

Original Poster
Rep: Reputation: 30
beadyallen,

I have targets that needs to run exactly the same distro but a few directories like /var /root /home needs to be different. So what I originally did was I had the distro at:

Code:
/tftpboot/images/distro
then i soft linked the whole distro to it:

Code:
/target1/distro/boot -> /tftpboot/images/boot
/target1/distro/etc -> /tftpboot/images/etc
/root
etc.

Now I know it doesn't work... mounted by nfs doesn't allow to have symlinks on top level. But what I'm doing now that works is:

in my /tftpboot/images/distro i have copies of root like:

Code:
/root_target1
/root_target2
...

/root -> root_target1

The thing is that the complete distro is 1.7G and I don't want to copy it for each target.

Then when it is tested on one distro, I need to do try another distro for exact same procedure. Instead of me re-writing the dhcpd.conf or kernel parameters all the time when I'm jumping between distros, I was hoping I could do this by simple environment variable or something

Indy

Last edited by freeindy; 03-11-2008 at 10:31 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
PXE boot / NFS freeindy Linux - Networking 3 03-06-2008 05:40 AM
NFS/PXE Boot on Linux Kernel kushalkoolwal Linux - Kernel 3 02-05-2008 06:46 PM
pxe nfs boot, kernel panic - portmap error davidcollins001 Linux - Networking 0 04-29-2007 01:20 PM
NFS Error during PXE Boot from NFS server JatMan Linux - Enterprise 0 10-16-2006 06:48 PM
NFS Root Boot - Exports soulkeeper Linux - Networking 3 07-24-2004 03:27 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration