TiVoCommunity.com
(c)opyright 1995-2005 All rights reserved
indexcheckTC
This area is a static history of posts in the TiVo Community Forum Archive.
This archive history was made for the simple indexing of search sites like Google.



Pages:1



What Dir Is The Path Located In?

(Click here to view the original thread with full colors/images)



Posted by: TomP

Can someone please tell me what dir. the $PATH is located in?



Posted by: Robert S

$PATH isn't a file, it's an environment variable. It's maintained by the operating system as part of the resources available to each process.

You can print your current path with

echo $PATH



Posted by: TomP

Robert:
Thanks for the reply! This path has about four lines of information in it and I can't add anything to it with my .profile or rc.sysinit.
I don't know where it came from but I know I can't seem to get rid of the information in it and set it back up to my one liner.
I have tried to use the BlesTiVo and reinstall my ols 2.5 image on it, all to no avail. This is a Sony t-60 I'm working with.
It really got me going.
Thanks again!!
TomP



Posted by: TomP

This is what my $PATH looks like:

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/bin:/sbin:/usr/bin:/usr/libsetup:/mnt/usr

/local/bin:/mnt/usr/bin:/mnt/bin:/mnt/usr/local/sbin:/mnt/usr/sbin:/mnt/linux

/usr/local/bin:/mnt/linux/usr/bin:/mnt/linux/bin:/mnt/linux/usr/local/sbin:/mn

t/linux/usr/sbin:/mnt/linux/sbin:/cdrom/live/usr/local/bin:/cdrom/live/usr/bin:

/cdrom/live/bin:/cdrom/live/usr/local/sbin:/cdrom/live/usr/sbin:/cdrom/live/sb

in:/cdrom/live/usr/X116/bin:.:/mad:/tivonet:

There may be a typo or two but this what it looks like. I don't know how or where this got like this.
I need your "PRO" help PLEASE. I can't do anything I know to make it change to the the basic path=/bin:/sbin:/tvbin:/devbin.
Thanks!!
TomP:confused:



Posted by: Robert S

$PATH is probably set up in rc.sysinit. It looks like some 'helpful' autoinstaller has tried to modify it for you. I would look in rc.sysinit and rc.sysinit.author (and, failing that, look for other scripts called by those scripts that might modify it).

The thing to remember that

set PATH=/bin

spawns a subshell in which $PATH is set to /bin. When set completes, the subshell terminates and the change to $PATH is lost!

Originally you had to do

set PATH=/bin
export $PATH

So export pushes the change to $PATH back up to the main shell session. These days you can usually do

export PATH=/bin

But I don't know if both of those work on TiVo.



Posted by: TomP

Thanks for your help Robert. I tried something and that was to just boot to the cdrom with the tivo disconnected from my PC and I then I checked the path, guess what? That was what it was showing. I have no idea as to how that happened. I have used this cd (nic_install) for a while and it has really confused me.
I'm in the process of reformating my drive and reinstalling my OS XPPro and I also had a Red Hat partition on my drive. I was wondering if that may have caused the problem some how.
It's beyond me what in the world happened. I'm going to get this XP reinstalled and and remove the Red Hat and also going to try to just boot the floppy and see what the path is.
Again thank you Robert. Don't leave me yet.
TomP



Posted by: Robert S

If the TiVo drive is in the PC, the $PATH is that of the bash shell running on the PC. That list of directory looks relatively sensible for a CD like nic_install. Altering $PATH on the PC will have no effect on the TiVo, which will create its own $PATH(s) when it boots. I assumed you were working on the TiVo over the network. Removing RH will have no effect on this.

Like I said, you need to poke about in rc.sysinit and related files to see if you can find where the TiVo configures its $PATH and edit that appropriately.

(My cards on table: I'm a fairly experienced Unix user, but have never actually bothered to do more than upgrade the hard drives on my TiVoes, so I'm a bit hazy on some of the TiVo-specific stuff).



Posted by: TomP

Will do and let you know.
Thanks Again.
TomP



Posted by: TomP

Robert:
I tried your suggestions and still nothing worked.
I looked in the rc.sysinit file and it showed the default path. Didn't find anything else.
Is there anyway to format my drives manually and then try a reinstall of my image?
Thanks.
TomP



Posted by: nephilim

Ara... It looks like the path you're listing is the one from the scaled down Linux distro on a Tivo Boot CD/Disk. Editing the rc.sysinit file there won't do a bloody thing as the entire OS exists on the read-only CD and in volatile RAM as a Ramdisk. (IE It no longer exists once you reboot.)
What you need to do is either Telnet into your Tivo if you have that capability, or use an MFS boot disk, mount the Tivo partition, and edit it from...

/mnt/tivo/etc/rc.d/rc.sysinit

... /mnt/tivo being where you mounted the drive.
Also, when you edit the path DO NOT simply put export PATH=blah into your rc.sysinit or any other rc file. That will completely overwrite the PATH variable.
You need to do:

export PATH=$PATH:[whatever directories here, separated by colons]

To preserve the original variable.
This is Linux, and notoriously unforgiving. Killing the PATH might render the entire Tivo inoperable.



Posted by: TomP

nephilim:
You are correct. It is the cdrom path that is showing up, I just don't know how to fix it. I have did an "DOD" erase on my tivo drives and now I got to learn how to get that fixed. If you can help me I would be greatful.
Many Thanks and a "HAPPY NEW YEAR" to you and yours!!!
TomP



Posted by: TomP

Got my drives back up and running and I still have the cdrom path statement. I have no idea as to what the problem is. I need some help.
Thanks!!!
TomP



Posted by: alansh

This PATH you're seeing -- is it while the drive is mounted in your PC or when it's in the TiVo?



Posted by: TomP

alansh:
Its while they are attachnd to the pc as indicated by the instructions here.
HDC=C drive Master Secondary and the HDB=Slave Primary.
Now I can't even get it to find the command "CPIO".
I'm just about had my fill of TIVO and Linux!!!!
TomP



Posted by: Robert S

Unix is case-sensitive, so CPIO and cpio are different files.

What is the problem you're trying to solve?

Although $PATH is a handy shortcut, you can ALWAYS run a command by typing its full pathname. If it's something like /usr/local/bin/cpio, you might get rather tired fingers, but the command will run.

If you're writing a script, then using the full pathname is virtually essential as you don't want the behaviour of the script to change depending on what $PATH happens to be when it runs.



Posted by: TomP

Robert:
Thanks for the reply.
I was trying to install JOE and when I got to the part where I used the :cpio: command it says "command not found".
As you know I've had nothing but troubles with the $PATH statement since the other day and I reread you input to me again and tried it as you said per word and I may have it strightened out. Im not sure yet though.
This is what I'm doing with my PATH statement: I'm mounted in the mnt7 dir and I set the path statement PATH statement as follows:
echo PATH=$PATH
PATH=/bin:/sbin:/tvbin:/devbin:/var:/var/hack:/var/hack/joe
is this correct? If so I'm still not getting to "cpio".
I really thank you for the help!!!
TomP

Robert:
(1) Just rebooted the tivo drives attached to my PC and my .profile is now gone and the same crap in the PATH is now back.
I don't know what else to do other than forget it.
TomP

(2) Just booted from a floppy and the path statement is the same.

(3) Only Sec. Drive (HDC) floppy,and cdrom drive (no cd in rom) attached. Same Path Statement.

(4) Just CDROM and floppy attached no change in PATH Statement.

(5) Just floppy attached, Still the same. echo PATH=$PATH is the command I'm using.

I noticed that while booting with the floppy and the cdrom that a line states that a "Ramdisk: Compressed imgage is found at block 488.
Does this mean anything of importance to my problem?
I'm going to try a plain "Linux Boot Disk" now if I can find one.



Posted by: sanderton

The TiVo's PATH only becomes active when the TiVo boots (or rather, when you open a shell on the TiVo). When you have it connected to your PC, it's the PATH for the PC which is in action, which is what you're seeing.

You can do all this cpio stuff via telnet when the drive is back in the TiVo.

If you must do it on the PC, then the command will be:

/mnt7/bin/cpio [other stuff]

assuming that the TiVo's system partition is munted as /mnt7.



Posted by: Robert S

Er, /mnt7/bin/cpio (if it exists) would be a version of cpio compiled for the TiVo, so I wouldn't expect it to work.

Perhaps if you explain why you're trying to alter $PATH, we might be able to make some progress?

(Also, echo and export are two different commands...)



Posted by: TomP

Robert S:
I'm trying to install the basic hacks for Joe, tivobin, tivoweb etc:
The PATH statement use to look like the default: /bin:/sbin:/tvbin:/devbin when I booted and nothing else when I booted up. It's just a concern due to I don't want that large path statement on my TiVo, just what I need. Also Do I make all the changes to TiVo in the HDC drive instead of Root?
I made the "changes" to the path in root and when I booted up my changes were gone ans so was my .profile
Thank Guys and have a Safe and Happy New Year!!!
TomP



Posted by: TomP

Maybe I'm just worrying about nothing.
I would like to know if I do all my work from mnt7 or root.
Thanks:
TomP



Posted by: sanderton

quote:
Originally posted by Robert S
Er, /mnt7/bin/cpio (if it exists) would be a version of cpio compiled for the TiVo, so I wouldn't expect it to work.



D'oh. Sorry. too much champagne last night.



Posted by: sanderton

quote:
Originally posted by TomP
I'm trying to install the basic hacks for Joe, tivobin, tivoweb etc:
The PATH statement use to look like the default: /bin:/sbin:/tvbin:/devbin when I booted and nothing else when I booted up. It's just a concern due to I don't want that large path statement on my TiVo, just what I need. Also Do I make all the changes to TiVo in the HDC drive instead of Root?
I made the "changes" to the path in root and when I booted up my changes were gone ans so was my .profile



Once you've installed Turbonet, all these things can be installed over the network when the Tivo drive is in the TiVo; which is much easier!

The confusion seems to be because you are (or maybe I am) getting mixed up between the PATH you see when you PC is booted in Linux, and the PATH you will see when your TiVo is running. Entirely different things.



Posted by: TomP

sanderton:
I think it is my confussion. Tivo when it booted in my pc before it would show the tivo'v path but something happened and it started doing as shown earlier.
I have "AirNet" but all I get from that is the Tivo main menu screen where you can see where the seasons passes are located.
I can't get into tivo from that way I can if I get the bash prompt.
What happened was I had everything working and thin installed "Elseed" and thing went down from there.
I'm restoring my 310b backup as I type this. I'll see what happens next.
It seems to have stopped at 891 of 1364 Mb, so I guess I need to restart it.
I forgot to ask, should I make all my changes in the /mnt7 dir instead of root?
Thanks for coming to the rescue also!!
TomP



Posted by: Robert S

When the TiVo is running, hda7 (or hda4) will be the root partition (mounted on /). When the drive is in the PC, / is part of the Linux install that the PC is running, so you have to temporarily mount the TiVo's root partition on /mnt7 so you can modify the files in it.



Posted by: TomP

Robert:
That cleared up alot for me. I have been tring to do every thing from the"/" instead of from mnt7. The reason I say mnt7 is mnt4 won't mount due to I guess there is nothing on it.
Thanks Again!!!
TomP



Posted by: sanderton

quote:
Originally posted by TomP

I have "AirNet" but all I get from that is the Tivo main menu screen where you can see where the seasons passes are located.
I can't get into tivo from that way I can if I get the bash prompt.



So you haven't got a bash over the network? (No response when you Start>Run on your PC and type

telnet xxx.xxx.xxx.xxx

where the xs are your TiVo IP address?

That sounds like the first problem to solve!

Easiest way to do that is to pull the drive, attach to your PC, boot with the airnet install CD-ROM and re-install the airnet drivers. This will ressurect your bash prompt over the network.



Posted by: TomP

Finally got it stright. When I setup my .profile it took care of it and it was reading the cdrom's path when I put the drives in my pc. So after all the confussion, I hope this info helps some other poor sole.
Thanks to all that helped:
Now on to elseed's problem.
TomP





vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Limited.
vB Easy Archive Final ©2000 - 2009 - Created by Stefan "Xenon" Kaeser Modified by Adam J. de Jaray