Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (15) </ [1] 2 3 4 5 6 ... >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: easier way to compile stuff for DSL, chroot + debootstrap< Next Oldest | Next Newest >
yodelaye Offline





Group: Members
Posts: 16
Joined: Feb. 2007
Posted: June 18 2007,19:08 QUOTE

Hi

DSL is great but has a drawback : it s a modified debian. Some debian package won't install through apt-get because DSL has not the proper debian dependency structure. This make compile stuff for DSL a real problem. There are often missing libs you can't add because of dependencies issues.

The mydsl repositery does include .dsl to compile and there was a mention on the forum of a script from Juanito to make the compile process easier. But it did not worked for me in some cases (may be because not used the proper way) but anyway this is another option, hopefully you ll find it usefull.

looking at the debian live cd stuff, I recently discovered the debian deboostrap function to install a minimal debian system. It gave me the idea to use it to build a compile environment for DSL which can be accessed by a chroot. In that way it is possible to compile stuff for DSL directly into DSL (no need to reboot into KNOPPIX or real debian)

this is a short how to to do this :

1.install debootstrap into DSL using apt-get
  - install the myDSL dpkg extension
  - apt-get update
  - apt-get install debootstrap
  - run the debootsrap install : this will download and install a minimal debian system into the directory you choose, without changing your running DSL (choose the woody install)

2. switch to your new debian by chroot :
  - once the new debian environnement is installed you are able to chroot in. this means you tell your system that the root "/" of your system is not any more the one set during boot process by DSL, but the /hda3/my_debian (assuming the target of the deboostrap install was there into the my_debian directory)
  - after the chroot the system will see
               /hda3/my_debian/ as /
               /hda3/my_debian/bin as /bin
               /hda3/my_debian/etc as /etc
               and so on
   - to chroot simply cd /mnt/hda3/
   - sudo su
   - chroot ./my_debian/
   - you can check that you are in a new environment :
     the result of pwd is /
     Note : you are looged as root in this new system

3. prepare your new system to be able to compile apps
   - to compile you need to install all the required tools. these will be installed only in your new system which is completely independant from your DSL box.
   - as you now work in a real debian you can easily do it using apt-get install and all dependency issues are gone : yeah !
   - apt-get install gcc flex bison make automake autoconf (and so on)
   - we also need to install the some dev packages of the libs the app you want to compile needs libsdl-dev for example
   
4. start compiling
   - all the chroot stuff has been done in a terminal window, but DSL is still running outside of this window. this means you still can launch firefox, go and grab the source of your app on sourceforge, save it into your normal home/dsl directory and use emelfm to decompress it into a directory of your new system
    - or in another terminal simply run from your home directory
      tar -xzvf my_app.tar.gz /mnt/hda3/my_debian/usr/src/
    - now you can go back in the terminal where you are chrooted in the debian system, go inside the src directory
    - cd /usr/src/my_app-src/
    - and perform a classic compilation procedure
    - ./configure
      Note:  use the prefix=/opt option to have the programm fully installed there so that you can transfer it easily later to DSL and you can easily turn it into myDSL extension or store it in your persistent opt partition
     -  ./make
     -  ./make install
     - once the compilation is finished you can from DSL (simply from the file manager emelfm for example) copy all the compiled files into your standard DSL

5. et voila !


I cannot say this works all the time but I found this usefull because it avoids to reboot to make your compilation work and avoid to install a multiboot with different system on your PC which can be a difficult process especially on old hardware DSL is dedicated to


Yodelaye
Back to top
Profile PM 
WDef Offline





Group: Members
Posts: 798
Joined: Sep. 2005
Posted: June 18 2007,19:54 QUOTE

This looks like it's got a lot of potential.
How big is the minimal woody in the chroot?
Back to top
Profile PM 
yodelaye Offline





Group: Members
Posts: 16
Joined: Feb. 2007
Posted: June 18 2007,20:26 QUOTE

Cannot remember how big it was just after the deboostrap and installation of the compile tools

Now I apt-get installed a bit too much useless stuff to give a good figure.
(even installed X and fluxbox in the chroot woody for fun...yes kind of weird way to have fun, I know. Didnt succeed to have it working)

I think it was 150MB to 200MB with only the necessary stuff to compile. But now the woody directory is 300MB, but including the useless X.
Back to top
Profile PM 
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: June 29 2007,18:59 QUOTE

Out of interest I tried this with Debian Sarge (i.e. oldstable now I guess) after I deleted the /usr/share/doc & man files but before adding anything:
Code Sample
$ du -ch | grep total
92M     total
Back to top
Profile PM 
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: June 30 2007,05:25 QUOTE

Hmm - I started to play with this after installing using the following:
Code Sample
# debootstrap --arch i386 woody /tmp/debian http://archive.debian.org/debian-archive/

Note that I had to install to /tmp/debian and the copy to /mnt/sdb4/debian as a direct install to hd had a bunch of errors.

The first thing I noticed was:
Code Sample
# apt-get update
Err http://archive.debian.org woody/main Packages
 Something wicked happened resolving 'archive.debian.org:http' (-3

I guess this means you have to re-setup everything after chroot or am I missing something?

Edit
----
Got it, you need to copy the following across:

/etc/dhcpc
/etc/resolv.conf
Back to top
Profile PM 
73 replies since June 18 2007,19:08 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (15) </ [1] 2 3 4 5 6 ... >/
reply to topic new topic new poll
Quick Reply: easier way to compile stuff for DSL

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code