Difference between revisions of "Didj Kernel Build Environment"

From eLinux.org
Jump to: navigation, search
(Created page with '==Steps to a working didj build environment using Ubuntu 9.1 (Karmic Koala)== Add the following line your "/etc/apt/sources.list": <blockquote>deb http://scratchbox.org/debian/…')
 
(Add Category Didj)
 
(7 intermediate revisions by 2 users not shown)
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 from your home folder:
  
<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 EROOTFS_PATH=~/didj-rootfs
    export RELEASE_PATH=~/release
+
:export RELEASE_PATH=~/release
    export TFTP_PATH=~/tftp
+
:export TFTP_PATH=~/tftp
</blockquote>
+
:export KERNELDIR=~/Didj-Linux-4222-20090422-1236/linux-2.6.20-lf1000/
 +
:export PATH=$PATH:/scratchbox/compilers/arm-gcc4.1-uclibc20061004/bin
  
 
+
Exit scratchbox
Exit then go back into scratchbox to load the environment variables.
+
 
+
Comment out lines 50 and 51 in Didj-Linux-4222-20090422-1236/linux-2.6.20-lf1000/install.sh
+
  
 
Run:
 
Run:
  
<blockquote>
+
:sudo cp /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/host_tools/mkimage /scratchbox/compilers/bin/
    mkdir didj-rootfs
+
: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
    mkdir release
+
    mkdir tftp
+
    ./Didj-Linux-4222-20090422-1236/scripts/make_rootfs.sh
+
</blockquote>
+
  
 +
Now go go back into scratchbox and run:
  
I had to comment out the lines that make the uImage in the install.sh file in the linux subdirectory. If anyone knows why this returns a file not found error, please let me know.
+
:mkdir didj-rootfs
 +
:mkdir release
 +
:mkdir tftp
 +
:./Didj-Linux-4222-20090422-1236/scripts/make_rootfs.sh
  
However, this setup does build a kernel image without reporting any errors.
+
==Change Kernel Settings==
 +
If you want to change kernel options, make sure you are not in scratchbox and run these commands:
  
The kernel is at Didj-Linux-4222-20090422-1236/linux-2.6.20-lf1000/vmlinux
+
:sudo apt-get install libncurses5-dev
The ~/tftp path will have kImage and zImage
+
:cd /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/linux-2.6.20-lf1000
 
+
:make menuconfig
If you want to change kernel options, make sure you are not in scratchbox and run these commands:
+
  
<blockquote>
+
==Create kernel.bin==
    sudo apt-get install libncurses5-dev
+
To make a bootable kernel.bin for use in a distribution package run this command inside scratchbox:
    cd /scratchbox/users/$USER/home/$USER/Didj-Linux-4222-20090422-1236/linux-2.6.20-lf1000
+
:./Didj-Linux-4222-20090422-1236/scripts/make_kernel.py
    make menuconfig
+
The resulting kernel.bin will be in the scripts directory.
</blockquote>
+
[[Category:Didj]]

Latest revision as of 15:28, 9 May 2011

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 from your home folder:

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 EROOTFS_PATH=~/didj-rootfs
export RELEASE_PATH=~/release
export TFTP_PATH=~/tftp
export KERNELDIR=~/Didj-Linux-4222-20090422-1236/linux-2.6.20-lf1000/
export PATH=$PATH:/scratchbox/compilers/arm-gcc4.1-uclibc20061004/bin

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

Change Kernel Settings

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

Create kernel.bin

To make a bootable kernel.bin for use in a distribution package run this command inside scratchbox:

./Didj-Linux-4222-20090422-1236/scripts/make_kernel.py

The resulting kernel.bin will be in the scripts directory.