Author Topic: 3MX toolchain/build instructions  (Read 5680 times)

josch

  • Newbie
  • *
  • Posts: 4
3MX toolchain/build instructions
« on: April 10, 2009, 05:27:09 PM »
hello there!

i was unable to find how you build the 3MX images - is there a public toolchain for that?
or alternatively: what are the steps, what are the changes you make?
i read somewhere 3MX uses oe? so is 3MX actually an openembedded distribution and can i thus just grab a bitbake file with build instructions or check out a repo of the necessary files anywhere?

i'm just very interested in seeing how 3MX works and what the modifications are to make it run on the machines and what this magical *.img recovery file format is.

I would be glad if someone could point me to documentation or instructions of the above if i might have failed to search properly.

wicknix

  • Hero Member
  • *****
  • Posts: 634
Re: 3MX toolchain/build instructions
« Reply #1 on: April 10, 2009, 07:55:13 PM »
The recovery.img is just a .tar.bz2 of a root filesystem renamed to .img.

Regarding build instructions, there really arent any yet. I manually added everything by hand. Eventually i'll push my OE configs for 3MX upstream once i have it completely worked out. A little more info by me found here: http://trendtac.hyves.nl/forum/2703996/KO7q/ALL_ABOUT_THE_3MX_DISTRO_BY_MATT_O/#searchhyver=&show_reactions_1=6&hub_threadlist_1=1&__state__=1

Cheers.

Felix

  • Newbie
  • *
  • Posts: 21
Re: 3MX toolchain/build instructions
« Reply #2 on: April 10, 2009, 07:58:23 PM »
Toolchain wise as far as I understand it, is built off the Debian Etch Mipsel repositories, you can get a file that converts the original debian packges from here. http://www.freeshells.ch/~wicked74/alpha400/packages/3MX-rc3/mk3mx however I myself am still a bit clueless as to weather I am building the packages correctly. Bit unclear on what the script means by appname files folders.

Only one way to find out I guess, install it and see if it borks.. LoL
« Last Edit: April 10, 2009, 08:02:54 PM by Felix »

glynallinson

  • Newbie
  • *
  • Posts: 26
  • Me
    • Taita
Re: 3MX toolchain/build instructions
« Reply #3 on: April 10, 2009, 08:38:46 PM »
I don't know about this toolchain/build stuff, not compiled anything before. but i have downloaded .debs from the mipsel repositories and the dependancies and installed them manually to see if they work. Its slow and boring, thankfully debian does list where files are installed. I got gemdropsx to work this way, but couldn't figure out how to make the thing smaller (half of the game was missing at the bottom of the screen)

Felix

  • Newbie
  • *
  • Posts: 21
Re: 3MX toolchain/build instructions
« Reply #4 on: April 10, 2009, 08:45:56 PM »
Yeah I tried and failed at using the mk3mx script, epic failure on my part, it's slowly dawning on my what wicknix means by editing it all by hand, sod that for a game of soldiers... That must take erm, hours, days, months, years.. noooo!

I just unpacked the image and saw how many files there are in the package.. LoL my 80GB drive is about to get busy.. but editing stuff that way must take... erm, I dont know how long but IMHO, V.LONG!!!
« Last Edit: April 10, 2009, 08:57:57 PM by Felix »

glynallinson

  • Newbie
  • *
  • Posts: 26
  • Me
    • Taita
Re: 3MX toolchain/build instructions
« Reply #5 on: April 10, 2009, 08:50:24 PM »
Yeah I tried and failed at using the mk3mx script, epic failure on my part, it's slowly dawning on my what wicknix means by editing it all by hand, sod that for a game of soldiers... That must take erm, hours, days, months, years.. noooo!

:D yes it does take some time, thankfully i have alot of patience.

Felix

  • Newbie
  • *
  • Posts: 21
Re: 3MX toolchain/build instructions
« Reply #6 on: April 10, 2009, 09:02:43 PM »
Hmm, going to have a crack at fiddling with the MadWifi drivers and see if I can get aircrack-ng updated to aircrack-ng rc3 which has been out for a while, all you guys with aircrack, SVN the latest build and do make && make install, your missing bits of the good stuff because packages maintained on the repositories are so out of date, I just got a warning from ClamAV my build has gone downstream and the only way to update is install and edit it all by hand.. Something I will pass on, if their is no updated build for intrepid within the next 3 months, then I'll go a pirate it out of Jaunty!

duttydea

  • Full Member
  • ***
  • Posts: 136
  • You wont know untill you search, then ask!!
Re: 3MX toolchain/build instructions
« Reply #7 on: April 10, 2009, 09:32:29 PM »
Taken from http://members.home.nl/janrinze/trendtac.html#Compiling_native

Quote
Compiling native:

In the Debian repository for the 'Etch' distribution there is a huge amount of binaries for the mipsel platform. This repository can be searched for packages and so i did a search for gcc and related software. I found the following files :

binutils_2.17-3_mipsel.deb
gcc-4.1-base_4.1.1-21_mipsel.deb
cpp-4.1_4.1.1-21_mipsel.deb
libc6-dev_2.3.6.ds1-13etch5_mipsel.deb
gcc-4.1_4.1.1-21_mipsel.deb

Debian packages are archives with inside them a control.tar.gz and a data.tar.gz. The control.tar.gz often holds scripts for post installation activities and also for removal. The data.tar.gz holds the files to be copied to the root folder. So if we want to install these on our EPC 700 we just need to collect the data.tar.gz files from each .deb file and extract them on our EPC 700.
A simple script or oneliner can do this for us :
(WARNING: USE THIS ONLY ON THE EPC 700 and only the above list of .deb files have been tested. Other .deb files can break your EPC 700)

put all de .deb files on the SDcard and use the following commands:

cd /SD/SD_1/
for package in $( ls *.deb ); do ar -x $package data.tar.gz ; tar xzf ./data.tar.gz -C / ; done
rm ./data.tar.gz
ln -s /usr/bin/gcc-4.1 /usr/bin/gcc
 
This will copy all the necessary files to the correct place on your EPC 700. The ln statement will create a softlink to the new gcc-4.1 executable and allows us to invoke it simply with gcc.
Unfortunately this is not enough to get started. When we want to use the compiler it cannot find the newly installed libraries. The distrib on the EPC 700 does not have a proper ld.so.conf file and thus we need to create one. (this example works but some people might think this is not the proper way to do this.)

echo "# default libc configuration" >> /etc/ld.so.conf
echo "/lib" >> /etc/ld.so.conf
echo "/usr/lib" >> /etc/ld.so.conf
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig

The libraries are now detected and we can continue by testing our compiler.
______________________________________________
CnM MiniBook : 3MX RC3.1 / Custom Debian (DLA)
Desktop: XP PRO & Vista
Linux Knowledge: Restricted to 3MX & Debian Etch (Basic)

wicknix

  • Hero Member
  • *****
  • Posts: 634
Re: 3MX toolchain/build instructions
« Reply #8 on: April 11, 2009, 03:51:49 AM »
FYI: I forgot to mention that gcc is already included in rc3.1, as is perl, python, ruby, and tcl/tk. This is just the base gcc and binutils however. You will need to install the -dev packages for gtk, x11, sdl, jpg, png, xpm, etc in order to build anything other than a simple hello word program.

Cheers

josch

  • Newbie
  • *
  • Posts: 4
Re: 3MX toolchain/build instructions
« Reply #9 on: April 11, 2009, 07:28:46 AM »
The recovery.img is just a .tar.bz2 of a root filesystem renamed to .img.

ah nice!
so i could basically simply debootstrap myself a debian lenny mipsel chroot, do --second-stage on the device and then package it with kernel and modules in a tar.bz2 that i rename to some *.img, put on a vfat sdcard and switch the device on with the reset switch pressed and thus copying everything into the nand flash.

wicknix

  • Hero Member
  • *****
  • Posts: 634
Re: 3MX toolchain/build instructions
« Reply #10 on: April 11, 2009, 04:53:46 PM »
Well, you could do that with debian etch (i've already done it), but not lenny. Etch was the last release that could run both 2.4 and 2.6 kernels. Unless you have a working 2.6 kernel for these machines lenny wont work.

Cheers.

josch

  • Newbie
  • *
  • Posts: 4
Re: 3MX toolchain/build instructions
« Reply #11 on: April 11, 2009, 05:44:06 PM »
ah sure! thx for reminding me of that!

then after all i'm looking forward to learn what you set up to make everything work properly later when you might release some instructions on how a 3MX build can be done by oneself.  ;D


wicknix

  • Hero Member
  • *****
  • Posts: 634
Re: 3MX toolchain/build instructions
« Reply #13 on: April 11, 2009, 08:29:44 PM »
Well 3MX was really just a quick fix to get something a bit more usable on my alpha400. There really wasnt/isnt an easy way to duplicate it. Here is what i did....

1) Took stock alpha400 recovery.img and extracted it to desktop pc running xubuntu.
2) Stripped out (by hand) most all the xip garbage (some packages and window manager)
3) Grabbed a bunch of applications and libraries from debian etch mipsel repositories.
4) Tested a slew of things to see what would work and what wouldnt.
5) Made test .img's with said applications installed to test on the machine.
6) Reflashed with numerous test .img's until i felt everything worked decently.
7) Set up OE (open embedded) and made generic configs for these machines.
8 ) Extracted Xenium and copied out a few programs(why reinvent the wheel?)
9) Built a few apps with open embedded that weren't in etch repositories.
10) Manually added applications, dependencies and added scripts by hand. (lots of work)
11) Made more test .img's to try out (eventually released for people to test and report bugs)
12) Try to fix as many bugs a possible from reports and add tweaks/changes.
13) Package up more test .img's and see if all went ok.
14) Release usable .img's into the wild for people to play with.

Thats basically how i made 3MX. It's a cobble job that was just tossed together. My long term project is to finish up my OE configs and push them upstream to be included in OE so that anybody can build userlands and packages for these machines quite easily.

Cheers.

lokesh

  • Newbie
  • *
  • Posts: 5
Re: 3MX toolchain/build instructions
« Reply #14 on: April 11, 2009, 08:35:25 PM »
that would be awsome...