handdator

Visa fullständig version : Till Letherface å kanske andra åxå...



humlan57
2006-01-07, 19:03
HowTo: Get the Relook source code and compile your own image
-------------------------------------------------------------------------------
1) Preparing Linux environment to compile Relook images:


Important: Getting the source code from the server in Korea has to be done from a normal user space, NOT from a user with administrator privileges.

If this type of user doesn’t exist, create one now:

Logon as administrator (=user root in Fedora Linux, or user administrator in some other Linux distributions), open a terminal window and type:

useradd -m myname [Enter]
passwd mypassw [Enter]

(myname = name for the new user, mypassw = password for the new user)
( [Enter] means: press the Enter key )



To compile Relook images, we need the program ‘Crosstools’. This can be found at the DGStation Ftp server in Korea:

ftp://dev.dgstation.co.kr/pub/common/crosstool2.parkhw00.050401.tar.gz
(~ 101 MB)

or via a shortcut:
ftp://dev.dgstation.co.kr/pub/common/crosstool2.tar.gz



To install the Crosstools compiler:
Logged on as administrator, extract the crosstools package in:
/usr/local/


Now, logoff as administrator and logon as the normal user that will be used for compiling the Relook images.

In the user’s home directory, there is the (hidden) file:
$HOME/.bashrc

Open this file with a simple text editor such as K-Edit. (do NOT use an Office application)
Add after the existing text the following line:
export PATH=$PATH:/usr/local/crosstool2/powerpc-405-linux-gnu/gcc-3.3.2-glibc-2.3.2/bin

Save the .bashrc and close the text editor.

Make your work directory under your home directory. Open a terminal and type:
mkdir $HOME/work_cvs
[Enter]

( the '$HOME' can be replaced with '~' (tilde) throughout this whole guide )




The Linux environment is now ready to compile Relook images in the work_cvs directory.





2) Preparing Linux environment to get Relook source code:


The original Relook source code resides on a DGStation server in Korea. To get access to this server, one need an ssh Key. Via following link you can find the Email address of the person who is responsible for this server:

http://dev.dgstation.co.kr/phpBB2/viewtopic.php?t=9

( please read the whole thread, to see if this person is temporary replaced by someone else...)


By asking the ssh Key to this person, the key will be sent to you by Email, either inline or as an attachment. In case the key is inline included in your mail text, you have to copy it from:
-----BEGIN DSA PRIVATE KEY-----
to:
-----END DSA PRIVATE KEY-----

..and paste this in a simple text editor such as K-Edit. (do NOT use an Office application)

This keyfile could be saved under any name, the only thing that counts is that the same name is used in the ssh config file. (see further)
A possible name is: id_dsa.txt.

Put this ssh keyfile in your $HOME/.ssh folder. If this folder doesn’t exist, create one now:
mkdir $HOME/.ssh
[Enter]

Only the local user is granted access to this .ssh folder. For this, open a terminal window and type:
chmod 700 $HOME/.ssh
[Enter]

In this .ssh folder, there should be a file, named ‘config’. (If the file is not there, create it now with a text editor)
Make this file only accessible for the local user:
chmod 700 $HOME/.ssh/config
[Enter]

Open this config file with a text editor, such as Kedit, to indicate which ssh Keyfile will be used to access the DGStation server.

Add the following lines after the existing text (if there is any) in the $HOME/.ssh/config file:
Host dev.dgstation.co.kr
IdentityFile ~/.ssh/id_dsa.txt

Save the $HOME/.ssh/config file and close the text editor.


Type in the terminal window::
set CVS_RSH=ssh
[Enter]

Make this Keyfile only accessible for the local user:
chmod 600 $HOME/.ssh/id_dsa.txt
[Enter]



The Linux environment is now ready to get the Relook source code from the Korean server.





3) Retrieving the source code from the DGS server:


Important: this must be done from a normal user space, NOT with administrator privileges.

Check if your internet connection is OK.


I) Code Relook300s

Open a terminal window, and go to your work directory:
cd $HOME/work_cvs
[Enter]

Type in the terminal:
rsync -vaz --rsh="ssh -l anoncvs" dev.dgstation.co.kr::source.relook300 ./
[Enter]
With this command, the folder dgs will be made in the work_cvs directory, and in the folder dgs, two folders common and relook300 are made with their complete subdirectories and files.

In the common folder you can find mainly the Linux system and related hardware drivers for the different DGS models: 200s, 300s, 400s.
In the relook300 folder you can find the specific code for the Relook300s.


If there has been done already before a rsync operation in the work_cvs directory, only the differences in the files will be replaced to make your local directory synchronised with the remote directory on the DGStation server in Korea.

After the rsync operation, you should have an exact copy of the remote directory.


II) Code Relook400s

First, do the procedure to get the Relook300s code, in order to have your common folder.

Open a terminal window, and go to your work directory:
cd $HOME/work_cvs
[Enter]

Type in the terminal:
rsync -vaz --rsh="ssh -l anoncvs" dev.dgstation.co.kr::source.relook400 ./
[Enter]

With this command, there will be made a folder relook400 in the folder dgs, with the complete subdirectories and files.

In the relook400 folder you will find the specific code for the Relook400s.


III) Code Mutant200s (at this moment not yet available)

First, do the procedure to get the Relook300s code, in order to have your common folder.

Open a terminal window, and go to your work directory:
cd $HOME/work_cvs
[Enter]

Type in the terminal:
rsync -vaz --rsh="ssh -l anoncvs" dev.dgstation.co.kr::source.mutant200 ./
[Enter]

With this command, there will be made a folder mutant200 in the folder dgs, with the complete subdirectories and files.

In the mutant200 folder you will find the specific code for the mutant200s.



Making an rsync logfile:

rsync is a program that’s made in the first place to make mirrors from remote directories. During this action, the program can indicate on the screen which files are added or changed in your local directory. Because this information can be very helpful by software development, it’s a good to store it in a logfile.

This way, it can be done:
Instead of just opening one terminal window as described above, open two terminal windows.

Go in both terminals to your work directory:
cd $HOME/work_cvs
[Enter]

In the first terminal, type this to retrieve the code from the
300s:
rsync -vaz --rsh="ssh -l anoncvs" dev.dgstation.co.kr::source.relook300 ./ >rsynclog300s.txt 2>&1
[Enter]

or
400s:
rsync -vaz --rsh="ssh -l anoncvs" dev.dgstation.co.kr::source.relook400 ./ >rsynclog400s.txt 2>&1
[Enter]

or
200s:
rsync -vaz --rsh="ssh -l anoncvs" dev.dgstation.co.kr::source.mutant200 ./ >rsynclog200s.txt 2>&1
[Enter]


In the second terminal, type this to see the screen output for the
300s:
tail -f rsynclog300s.txt
[Enter]

or
400s:
tail -f rsynclog400s.txt
[Enter]

or
200s:
tail -f rsynclog200s.txt
[Enter]



Now, all rsync messages will be displayed onscreen and stored in the file rsynclog*.txt.


Important:

rsync synchronizes the local directory in your $HOME/work_cvs. With this action, all differences in your local directory will be replaced with the versions of the remote directory in Korea.
For those who are developing code, it’s important to be aware that all your own modifications will be wiped out by this procedure.

To avoid this, an alternative way is to do the rsync action in another directory than your work directory, for instance incoming-rsync. Leave in this directory the unmodified files of the previous rsync. At the next rsync, your rsync logfile will show all the files that are changed. Now you can decide by yourself which parts of the code in your work directory you will replace by the new versions.





4) Compiling Relook images:


Important: At the time of the first compilation on a newly installed system, it is necessary that the PC is connected to the internet. This allows the compiler to retrieve some extra files from the internet. This is only once. Later, this connection is not necessary during compiling time.


I) Relook400s:


Open a terminal window and go to your relook400 directory:
cd $HOME/work_cvs/dgs/relook400
[Enter]

type:
make
[Enter]

The compiler starts now making the images for the Relook. This can take upto a few minutes, depending on your hardware.
After compiling succeeded, you will find the compiled Relook400s images in directory:
$HOME/work_cvs/dgs/relook400/flash_img/


Making a compiling logfile:

During compiling, it may happen that the compiler shows possible errors and/or warnings on your screen. This can be caused either by newly added code on the server in Korea that is not 100% fully functional, by custom made code with some bugs, or by problems with your compiling environment.
In each of this cases, it can be very helpfull to have the compiler output messages stored in a logfile for bugtracking.

It can be done this way:
Instead of just opening one terminal window as described above to give the make command, open two terminal windows and go in both terminals to your 400s directory:
cd $HOME/work_cvs/dgs/relook400
[Enter]

In the first terminal, type:
make >compilog.txt 2>&1
[Enter]

In the second terminal, type:
tail -f compilog.txt
[Enter]

Now, all compiler messages will be displayed onscreen and stored in the file compilog.txt.


II) Mutant200s:

This part is still greyed out because it has to be checked first when the Mutant200 code will become available.

Open a terminal window, and go to your 200s directory:
cd $HOME/work_cvs/dgs/mutant200/
[Enter]
make
[Enter]

After compiling succeeded, you will find the 200s images in directory:
$HOME/work_cvs/dgs/mutant200/flash_img/





Now you have all the tools to make your own custom Relook images. I wish you many happy programming hours and great Relook images "against the limits".......



Although I tried to make this guide as good as possible: If there are still some errors or things unclear in this guide,
your feedback is very to make it better !


Best regards,
_________
relooker
----------------------------------------

Allt är klippt från annat ställe.

mvh humlan.