Reply
Thread Tools
Posts: 90 | Thanked: 2 times | Joined on Mar 2006
#1
So, I've done some reading and thinking to get a handle on my questions as best as possible.

I've installed Xterm and VIM for editing. Right now, I need to use the extremely long launch sequence in Xterm to launch VIM. It's pretty painful. So, I've seen posts that give brief explaination on creating a file or two to make this launch process shorter. I was hoping to run my thoughts here and get some confirmation as to whether my thinking is right or not.

I can create a file called ".profile" For the lack of better explanation, this is a text file created with VIM and the ".profile" is the name. Can I relate this to an ".ini" file for the lack of some other way to explain it? In this text file I can add these two lines of text:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/var/lib/install/usr/lib
PATH=$PATH:/var/lib/install/usr/sbin

Then, I save the file using the commands in VIM.

So, once the file is saved, where does VIM store the file? In the root directory "/"? Then the file needs to be moved into directory:
/home/user/

I haven't tried moving files around yet, but I will look into figuring out how to do that.

Can someone explain how the boot up process works with this? I'm wondering how editing this file incorrectly can cause the device to be unbootable?

Thanks again for taking your time with this. I'm new at this, but it's fun learning.

David
 
Posts: 12 | Thanked: 0 times | Joined on Dec 2005
#2
I had no idea editing that file incorrectly could make the device not boot. Someone else will have to fill you in on that.
Sorry for the tedious explanation that follows, but I tried to be thorough so people who haven't used the command line might have some hope of understanding.
I think the file is saved to what they call the "working directory" *unless another directory is specified in the filename when you run vim*.
The working directory is the directory that you are "in" and it is indicated by the path at the command prompt(the cursor) before the character "$" (although if you become root the character is "#").
I'm quite sure the default working directory for the regular user and root is what is confusingly called the root directory, or "/".
Thus, when you start up xterm I think you'll see the characters "/ $" before your cursor, indicating that you are a regular user and the working directory is "/" or the root directory.
You can change directories with the command "cd". So entering and running the command "cd /home" will change your directory to "/home" and your cursor would then be preceeded this: "/home $". If you become root (sudo gainroot is the command on the 770) it will say "/home #".

The command to move files is "mv" so you can move a file called /home/user/foo.doc to the directory /home/user/MyDocs by running "mv /home/user/foo.doc /home/user/MyDocs". I think.

A very useful place to look for help using commands is in "man" pages, which are basically concise manuals. Usually you can just run the command "man x" where x is the name of the program to look up commands on linux computers. The 770 doesn't have "man" installed, though. There is an online equivalent at http://man.linuxquestions.org/ that should be useful if you're using the 770.

That solution to being able to run "vim" more easily seems to involve changing certain variables and I have some sort of brain damage that prevents me from using them properly. A much easier solution that I used is to create a link to vim in /bin which is already in your path. Use this command(I think you have to be root to run this) "ln -s /var/lib/install/usr/bin/vim /bin" and you should then be able run vim by just typing "vim" and hitting return.

edit: I corrected the completely misleading thing I wrote about where files are saved in vim. Perhaps insomniacs shouldn't give linux tips.

Last edited by Cloud8; 2006-03-15 at 19:19.
 
Posts: 23 | Thanked: 1 time | Joined on Jan 2006 @ Portland
#3
Originally Posted by Linear2202
So, I've done some reading and thinking to get a handle on my questions as best as possible.

I've installed Xterm and VIM for editing. Right now, I need to use the extremely long launch sequence in Xterm to launch VIM. It's pretty painful. So, I've seen posts that give brief explaination on creating a file or two to make this launch process shorter. I was hoping to run my thoughts here and get some confirmation as to whether my thinking is right or not.
It's less painful if you are able to enable a keyboard to use with the Nokia. (I won't offer any advice since I'm having problems with my BT keyboard. :-( )

I can create a file called ".profile" For the lack of better explanation, this is a text file created with VIM and the ".profile" is the name. Can I relate this to an ".ini" file for the lack of some other way to explain it? In this text file I can add these two lines of text:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/var/lib/install/usr/lib
PATH=$PATH:/var/lib/install/usr/sbin

Then, I save the file using the commands in VIM.
Good start on creating a .profile file. One thing you can do is add an alias setting so that typing "vi" will invoke "vim" - but I'm not sure if the default shell (ash, I believe) supports aliases. There is also a version of bash for the Nokia -- which is as simple to install as xterm.

So, once the file is saved, where does VIM store the file? In the root directory "/"? Then the file needs to be moved into directory:
/home/user/
The name of the vim configuration file is ".vimrc". It should be in /home/user -- but you can move it there with the command "mv" (which stands for "move"). You'll need to look for this file with the ls command: "ls" alone will show all files that do not begin with a period (.), while "ls -a" will show all files. On the Nokia, "ls -?" will show all of the available options.

All of this also applies to .profile. (I'm not sure which one you're asking for help with.)

Can someone explain how the boot up process works with this? I'm wondering how editing this file incorrectly can cause the device to be unbootable?

Thanks again for taking your time with this. I'm new at this, but it's fun learning.
Not unbootable exactly, but because you are changing things in the operating system there is a possibility that you could do something that will cause your Nokia to stop working. Until you get a good grasp of how the Linux environment works, don't try to gain root on your Nokia: this will restrict your ability to change the most important settings on your Nokia, & keep the possibility of doing something dangerous to a minimum. (You can still do something stupid & cause problems for yourself -- but as long as you're willing to accept the loss of any data on your Nokia, I can't think of anything that reflashing the firmware can't fix.)

And I have to say that you're finding the reason why UNIX is more fun to use than Windows: you're able to open the hood & actually see how things work. (Well, this is my opinion: some people don't want to get their hands dirty, & happily ignore these features.)

Geoff
 
Posts: 6 | Thanked: 0 times | Joined on Jan 2006
#4
David,
Have you seen these instructions in the itT Wiki?
Using XTERM
I followed them and got VIM working. I'm a LINUX newbie too (though I do remember command line from DOS).

See Ya
Viking
 
Posts: 67 | Thanked: 3 times | Joined on Feb 2006
#5
If you want to do serious Linux learning:

1. Read what's at http://www.linux.org/
2. Read what's at http://www.linux.com/
3. Install a desktop Linux on an old PC. Good way to learn and the system shouldn't be that slow, so you can use it for some tasks at well. Desktop Linux is supposedly user friendly these days and also it is not as limited as embedded Linux.
__________________
icct - internet communication, mobile Linux - http://icct.blogspot.com/
 
CrossBow's Avatar
Posts: 58 | Thanked: 5 times | Joined on Dec 2005
#6
OK - I belive a little understanding goes a long way, and many people have had problems with this, so here is a full explanation.

If you miss-edit this file, your 770 will technically still boot, but it may not be able to find certain files it needs to start the GUI, and user level services. As a non-root user, you cannot keep the system from booting, but you can mess up your own user account. Since the 770 has only one user account, and it must start it by default, it basically has the effect of making the your 770 appear "hosed".

Here's why:

The line:
PATH=$PATH:/var/lib/install/usr/bin

means set the path to what ever it is now ($ means "the current value of") and also ("and also" is represented by the colon) "/var/lib/install/usr/bin".

If you leave off the current path ($PATH) the system will only look for files and services in the NEW PATH you entered. The problem is that the needed files/services are NOT IN /var/lib/install/usr/bin, and thus the services/GUI cannot be started.

It is a little like a programming statement:

let x=x+1

While it is mathematically impossible for any number to ever equal itself +1, this (or something similar) is perfectly OK is most programming languages. It means take the current value of x and add 1 to it. This is very different than

let x=1

where x is REPLACED by 1.

So feel free to play with ADDING to your PATH, but always make SURE that the current PATH value ($PATH) is (correctly) still in there. For example:

PATH=$PATH:/var/lib/install/usr/bin:/var/lib/install/usr/sbin

Wanna see the current path? Type:

echo $PATH
__________________
--- CrossBow

Mobile Linux? Got That.
Pepper Pad 3, Nokia 770, GP2X, Motorola A780

Please visit http://linuxslate.com/ New! Discussion boards just started.
 
Posts: 41 | Thanked: 0 times | Joined on Dec 2005 @ Brasil
#7
a pratical way of not messing with /etc/profile, /root/.profile, /etc/sudoers or whatever file is to open two tabs and log in in both as root. After saving the file in your texteditor, type exit so you leave you root account and login again. If any error was made you got a chance to undo it using the already opened root-shell.

I'd say vim/vi is not very well-suited for a begginer (neither is emacs, but that's IMHO ), Joe may be a better alternative. Only downside is that Joe's default keymap uses CTRL+smthing, and you have to use the menu to get that. I added most used functions (quit, save, save as, select, etc) to be used with ESC+ a number as mentioned in maemo-wiki.

That said, possibly the best editor for newbies is (again IMHO) midnight-commander's mcedit. Unfortunately, it doesn't seem to work well in its present encarnation.
 
Posts: 90 | Thanked: 2 times | Joined on Mar 2006
#8
Thanks everyone for taking to time to help. I do appreciate it. I'll do my best to digest everything for awhile.

I love detailed explanations, because I like to understand what is happening and why.

I know what it's like to try to explain stuff to people who are in over their head. I perform tech support for a wireless communications company specializing in emergency dispatch equipment. I do appreciate everyone's time and patience.

Thanks again..

David
 
Posts: 90 | Thanked: 2 times | Joined on Mar 2006
#9
So, I start to read everything here again. I go to look at link provided by Viking. I read it, and wow, it seems straight forward. I think to myself " I know I have seen this before." So, what was the issue then that I couldn't understand? I have no idea, but I understand that now. *Bangs my head against the wall, stupid stupid*

Thanks again everyone.
 
Posts: 106 | Thanked: 3 times | Joined on Dec 2005
#10
David - You've probably realized and fixed this by now, but I just wanted to point out that your original post contains a typo. Where it says:

PATH=${PATH}:/var/lib/install/usr/sbin

it should say:

PATH=${PATH}:/var/lib/install/usr/bin

If someone tried the sbin line by mistake, it still would not be possible to run VIM (or other 3rd party programs) just by typing "vim", because VIM is installed in /var/lib/install/usr/bin.

Regards - Neil
 
Reply


 
Forum Jump


All times are GMT. The time now is 04:04.