2008/06/09

WMU-6500FS - Build environment



  1. M$ Windows machine with running CoLinux/Debian 4.0 installation (just minimal console setup, installing packages as needed) - in this document shell commands from this system are prefixed deb#
  2. uClibc development system - Prebuilt by JoKeR - download available [here] (tried to build my own, but did not succeed even with JoKeR's config) stored on 'deb#' system and placed in chroot jail - shell commands from this system are prefixed dev#
  3. WMU-6500FS box upgraded with JoKeR's firmware version C009M Advanced. Currently there is a newer version available - shell commands from this system are prefixed box#
The initial preparation of the environment consists of following steps:
  1. Download the archive with JoKeR's pre-built development system (assuming you want to extract it to your home directory):
      
    deb# cd ~
    deb# wget http://mgb111.pradnik.net/addons/uclibc-basic.tar.bz2
    
  2. Extracting the archive:
      
    deb# tar xjvf uclibc-basic.tar.bz2
    ...
    ./uclibc-basic/uclibc-env/dev/<device>
    tar: ./uclibc-basic/uclibc-env/dev/<device>: Cannot mknod: Operation not permitted
    ...
    tar: Error exit delayed from previous errors
    
    We ended up with some permition denied errors. We need to have root rights in order to create /dev nodes (special files created with the mknod command). The problem is soved when we untar the archive as superuser:
      
    deb# sudo tar xjvf uclibc-basic.tar.bz2
    Password: ...
    
    ... now the extraction finished with no errors.
  3. Now we are ready to log-in to the newly created chroot-ed environment:
      
    deb# chroot uclibc-basic/uclibc-env/ /bin/su -
    -bash: chroot: command not found
    
    We need superuser rights in order to use the chroot command:
      
    deb# sudo chroot uclibc-basic/uclibc-env/ /bin/su -
    Password: ...
    dev#
    
    ... so now we are sucessfully logged in the new environment.
Tip:
I am using Putty connection manager for accessing all the systems and I have found it very convenient. In 'PCM' it is possible to create a command sequence executed just after the login - so for the dev# login I just setup the following command sequence:
  
deb# cd ~
deb# chroot uclibc-basic/uclibc-env/ /bin/su -
dev# export PATH=$PATH:/mnt/C/sys/bin
dev# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/C/sys/lib:/mnt/C/sys/apache2/lib

11 comments:

Dynia said...

Hi Filodej,
First Id like to thank you for such a comprehensive Linux guide for MGB111 box users.
Apparently you are a gifted teacher. :)

The second: Could you please clarify how should i install the C+ environment? I need it in order to complete the installation of MYSQL which I need for my Apach server. I downloaded the package from the JKR`s site and untared on /mnt/C directory, but I cannot use it.
I tried your instructions,but chrood does not work, saying that there are no such file.
Many thanks in advance.
Regards, Dynia .

filodej said...

Hi Dynia,
Thanks for you supportive words. I am glad there is someone who if finding my site little bit helpful.

I tried to elaborate more about the preparation of the environment, I hope it'll help you.

Regarding to MySQL: I'd like just to point out one thing - regarding to Wiki the MySQL is partly implemented in C++. I did not look at the source, but in case there are exceptions used it could be a problem with the current build environment we are using. The problem is that the gcc 3.3.6 (as it is configured now) generates code which is catching no exceptions at all. The problem is that between 3.3 and 3.4 the default exception model changed and it seems that the gcc change management did not go very well at that point. I am going to elaborate more about this issue in another post, for now, take it just as a warning that things need not go so smooth as you probably expect.

In any case, I wish you good luck with it, maybe I get to it later as well, so please, let me know, when you proceed.

Best regards,
Filodej

Dynia said...

Hi Filodej,

Thank you for quick answer. I`ve got my build enironment working although i proceeded not exactly as you wrote. I didn`t get errors when I simply untar Joker`s file.
And the string:
deb# chroot uclibc-basic/uclibc-env/ /bin/su - executed smoothly.
I do not understand why it went like that and also do not understand how you got "sudo" working. My system is missing this feature.
Would be great to know how may i install sudo.
Thank you and kind regards,
Dynia

Dynia said...

Re: Mysql build.
Now knowing that C++ issue I decided not to proceed with my builds of Mysql. Will try utilize sqlite.
K.R. Dynia.

filodej said...

Hi Dynia,
I am glad the more detailed description helped.

Regarding to sudo, it seems to me that you are logged-in as root already, aren't you? At least on my system the chroot command is in /usr/sbin/ directory which is inaccessible for regular users.

Regarding to sudo installation, I do not know what host system you are running, I have both debian based. On Ubuntu there was the sudo installed just out of the box (I would say they use it extensively from GUI administration tools). On CoLinux I choose a minimal Debian installation and (as far as I can remember) the sudo was not installed there. I installed it via the
apt-get install sudo
command (as superuser ;). Then it was necessary to add my user account to /etc/sudoers to be able to use the sudo command.

Regards,
F.

Anonymous said...

Hi Filodej,
first of all thanks a lot for your tutorial. I think is excellent for persons like me who don't have enough knowledge about linux and other stuffs.
I have a question. You use coLinux to prepare some files. I've Kubuntu installed on my PC. Can i use Kubuntu instead of coLinux? Thanks in advance

filodej said...

Hi,
of course you can use Kubuntu instead of CoLinux. Cooperative Linux is just a port of linux kernel on MS Windows. I am using it because I am still running Windows on my workstation :-(
All in all everything I have described here can be applied on "native" Debian based Linux installations as well.
Regards,
Filodej

Anonymous said...

HI.
I try to install client mutella form source. I've installed uclib-basic package und readline, configure ends OK but make returns a lot of errors. I can't find file ...etc. What should I do????

LOP_B said...

Hi, have you successfully run mysql?
Because i am using the jockers site precompiled http://mgb111.pradnik.net/addons/servers-sql/mysql5-5.0.90-t-100304.tar
and i have the following error:
$ mysqld
100527 15:45:47 [Warning] option 'myisam_max_extra_sort_file_size': unsigned value 2147483648 adjusted to 2147483647
100527 15:45:47 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

100527 15:45:47 [ERROR] Aborting

100527 15:45:47 [Note] mysqld: Shutdown complete

LOP_B said...

OHOH! i think the problem was root :P
I've created a user named mysql, and run it again, and it works.

Anonymous said...

Hi Filodej,

Not sure if you are still looking at this, but I had a go at the build environment, however, when trying to "chroot" (sudo chroot uclibc-basic/uclibc-env/ /bin/su -), I got tis following error message:

chroot: failed to run command ‘/bin/su’: Permission denied

Any idea?

Cheers,

Kermit