Difference between revisions of "Didj Kernel Build Environment"

From eLinux.org
Jump to: navigation, search
(Steps to a working didj build environment using Ubuntu 9.1 (Karmic Koala))
(Steps to a working didj build environment using Ubuntu 9.1 (Karmic Koala))
Line 7: Line 7:
 
Install Scratchbox:
 
Install Scratchbox:
  
<blockquote>
+
:sudo apt-get update
sudo apt-get update
+
:sudo apt-get install scratchbox-core scratchbox-devkit-cputransp scratchbox-devkit-debian scratchbox-libs scratchbox-toolchain-arm-gcc4.1-uclibc20061004
sudo apt-get install scratchbox-core scratchbox-devkit-cputransp scratchbox-devkit-debian scratchbox-libs scratchbox-toolchain-arm-gcc4.1-uclibc20061004
+
</blockquote>
+
  
 
Add these settings to /etc/sysctl.conf
 
Add these settings to /etc/sysctl.conf
  
<blockquote>   
+
:vm.vdso_enabled = 0
vm.vdso_enabled = 0
+
:vm.mmap_min_addr = 4096
vm.mmap_min_addr = 4096
+
</blockquote>
+
  
  
 
Run:
 
Run:
  
<blockquote>
+
:sudo sysctl -p
    sudo sysctl -p
+
</blockquote>
+
  
  
 
Add yourself to the "scratchbox" user group:
 
Add yourself to the "scratchbox" user group:
  
<blockquote>
+
:sudo /scratchbox/sbin/sbox_adduser "$USER"
    sudo /scratchbox/sbin/sbox_adduser "$USER"
+
</blockquote>
+
  
  
 
Make a symbolic link to avoid sudo errors:
 
Make a symbolic link to avoid sudo errors:
  
<blockquote>
+
:sudo ln -s /scratchbox/tools/bin/fakeroot /scratchbox/tools/bin/sudo
    sudo ln -s /scratchbox/tools/bin/fakeroot /scratchbox/tools/bin/sudo
+
</blockquote>
+
  
  
Line 45: Line 35:
 
Enter "scratchbox" into a terminal to start the sandbox environment:
 
Enter "scratchbox" into a terminal to start the sandbox environment:
  
<blockquote>
 
 
#    Next, enter "sb-menu" to bring up the Scratchbox configuration menu.
 
#    Next, enter "sb-menu" to bring up the Scratchbox configuration menu.
 
#    Then you'll want to select "Setup".
 
#    Then you'll want to select "Setup".
Line 55: Line 44:
 
#    Select "YES" to install files on the target. Choose any extra packages to install, and then select "OK".
 
#    Select "YES" to install files on the target. Choose any extra packages to install, and then select "OK".
 
#    Finally, choose "YES" to select the target you just created.
 
#    Finally, choose "YES" to select the target you just created.
</blockquote>
 
  
  
 
Run:
 
Run:
  
<blockquote>
+
:wget http://medialib.leapfrog.com/didj_opensource_code/Didj-Linux-4222-20090422-1236.tar.gz
    wget http://medialib.leapfrog.com/didj_opensource_code/Didj-Linux-4222-20090422-1236.tar.gz
+
</blockquote>
+
  
  
 
And decompress it:
 
And decompress it:
  
<blockquote>
+
:tar -xzf Didj-Linux-4222-20090422-1236.tar.gz
    tar -xzf Didj-Linux-4222-20090422-1236.tar.gz
+
</blockquote>
+
  
  
 
Run:
 
Run:
  
<blockquote>
+
:nano .bashrc
    nano .bashrc
+
</blockquote>
+
  
  
 
And put in this text:
 
And put in this text:
  
<blockquote>
+
:export PROJECT_PATH=~/Didj-Linux-4222-20090422-1236
    export PROJECT_PATH=~/Didj-Linux-4222-20090422-1236
+
:export TARGET_MACH=LF_LF1000
    export TARGET_MACH=LF_LF1000
+
:export CROSS_COMPILE=sbox-arm-linux-uclibc
    export CROSS_COMPILE=sbox-arm-linux-uclibc
+
:export ROOTFS_PATH=~/didj-rootfs
    export ROOTFS_PATH=~/didj-rootfs
+
:export RELEASE_PATH=~/release
    export RELEASE_PATH=~/release
+
:export TFTP_PATH=~/tftp
    export TFTP_PATH=~/tftp
+
</blockquote>
+
  
  
Line 95: Line 75:
 
Run:
 
Run:
  
<blockquote>
+
:sudo cp /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/host_tools/mkimage /scratchbox/compilers/bin/
sudo cp /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/host_tools/mkimage /scratchbox/compilers/bin/
+
:sudo mv /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/host_tools/mkimage /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/host_tools/mkimage.disable
sudo mv /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/host_tools/mkimage /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/host_tools/mkimage.disable
+
</blockquote>
+
  
 
Now go go back into scratchbox and run:
 
Now go go back into scratchbox and run:
  
<blockquote>
+
:mkdir didj-rootfs
    mkdir didj-rootfs
+
:mkdir release
    mkdir release
+
:mkdir tftp
    mkdir tftp
+
:./Didj-Linux-4222-20090422-1236/scripts/make_rootfs.sh
    ./Didj-Linux-4222-20090422-1236/scripts/make_rootfs.sh
+
</blockquote>
+
  
 
If you want to change kernel options, make sure you are not in scratchbox and run these commands:
 
If you want to change kernel options, make sure you are not in scratchbox and run these commands:
  
<blockquote>
+
:sudo apt-get install libncurses5-dev
    sudo apt-get install libncurses5-dev
+
:cd /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/linux-2.6.20-lf1000
    cd /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/linux-2.6.20-lf1000
+
:make menuconfig
    make menuconfig
+
</blockquote>
+

Revision as of 21:24, 13 March 2010

Steps to a working didj build environment using Ubuntu 9.1 (Karmic Koala)

Add the following line your "/etc/apt/sources.list":

deb http://scratchbox.org/debian/ stable main

Install Scratchbox:

sudo apt-get update
sudo apt-get install scratchbox-core scratchbox-devkit-cputransp scratchbox-devkit-debian scratchbox-libs scratchbox-toolchain-arm-gcc4.1-uclibc20061004

Add these settings to /etc/sysctl.conf

vm.vdso_enabled = 0
vm.mmap_min_addr = 4096


Run:

sudo sysctl -p


Add yourself to the "scratchbox" user group:

sudo /scratchbox/sbin/sbox_adduser "$USER"


Make a symbolic link to avoid sudo errors:

sudo ln -s /scratchbox/tools/bin/fakeroot /scratchbox/tools/bin/sudo


At this point you will need to log out of and then back in to your computer and re-open terminal.

Enter "scratchbox" into a terminal to start the sandbox environment:

  1. Next, enter "sb-menu" to bring up the Scratchbox configuration menu.
  2. Then you'll want to select "Setup".
  3. Select "<NEW>" for a new target, then enter "didj" as your target name.
  4. Choose "arm-gcc4.1-uclibc20061004" as your compiler.
  5. Then, browse down to select the "cputransp" development kit. Then select "DONE".
  6. Next, select "qemu-arm-cvs" for your CPU-transparency method.
  7. Then, choose "NO" for extracting a rootstrap to the target.
  8. Select "YES" to install files on the target. Choose any extra packages to install, and then select "OK".
  9. Finally, choose "YES" to select the target you just created.


Run:

wget http://medialib.leapfrog.com/didj_opensource_code/Didj-Linux-4222-20090422-1236.tar.gz


And decompress it:

tar -xzf Didj-Linux-4222-20090422-1236.tar.gz


Run:

nano .bashrc


And put in this text:

export PROJECT_PATH=~/Didj-Linux-4222-20090422-1236
export TARGET_MACH=LF_LF1000
export CROSS_COMPILE=sbox-arm-linux-uclibc
export ROOTFS_PATH=~/didj-rootfs
export RELEASE_PATH=~/release
export TFTP_PATH=~/tftp


Exit scratchbox

Run:

sudo cp /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/host_tools/mkimage /scratchbox/compilers/bin/
sudo mv /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/host_tools/mkimage /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/host_tools/mkimage.disable

Now go go back into scratchbox and run:

mkdir didj-rootfs
mkdir release
mkdir tftp
./Didj-Linux-4222-20090422-1236/scripts/make_rootfs.sh

If you want to change kernel options, make sure you are not in scratchbox and run these commands:

sudo apt-get install libncurses5-dev
cd /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/linux-2.6.20-lf1000
make menuconfig