Difference between revisions of "NeTV local compilation"

From Chumby Wiki
Jump to: navigation, search
Line 1: Line 1:
 +
==Compatibility==
 +
This documentation is verified at version 12 firmware.
 +
 
NeTV includes the abilities to download packages that are pre-compiled from the chumby release servers.  
 
NeTV includes the abilities to download packages that are pre-compiled from the chumby release servers.  
  
 
To do local development, you will use this facility to install gcc.  
 
To do local development, you will use this facility to install gcc.  
 
WARNING -- DO NOT USE THIS PROCEDURE IT HAS NOT BEEN COMPLETELY DEBUGGED. In particular, if the device runs out of space during tool installation you can brick the device. Currently trying to figure out a more robust method for installing the very large package of tools required for development.
 
  
 
==Preparing the device==
 
==Preparing the device==
 
First, connect to the network using the NeTV UI. Once you are connected to the network, ssh into the device.  
 
First, connect to the network using the NeTV UI. Once you are connected to the network, ssh into the device.  
  
Now, type the command
+
Then, execute this series of commands:
  
opkg update
+
  mount -o remount,rw /
 +
  mkdir /tmp/roroot
 +
  mount / /tmp/roroot -o bind
 +
  mkdir /tmp/unionroot
 +
  mkdir /media/storage/newroot
 +
  mount -w -t unionfs -o dirs=/media/storage/newroot=rw:/tmp/roroot=ro unionfs /tmp/unionroot
 +
  mount /var/volatile /tmp/unionroot/var/volatile -o bind
 +
  chroot /tmp/unionroot /bin/bash
 +
  mount -a
 +
  mkdir /dev/pts
 +
  mkdir /dev/shm
 +
  mount devpts /dev/pts -t devpts
 +
  mount tmpfs /dev/shm -t tmpfs -o rw,mode=777
  
This will update the list of installable packages.
+
  opkg update
 
+
  opkg install task-sdk-native
Before going on, you will need to change / to be writeable. This is done by using
+
  opkg install libgcc-dev
 
+
mount -o remount,rw /
+
 
+
==Free up space==
+
By default, there is not enough disk space to install the toolchain and all development libraries.  Fortunately, there are a lot of unnecessary Qt packages installed.  Remove them:
+
opkg remove qt4-embedded-examples qt4-embedded-assistant qt4-embedded-designer libqt3supporte4 --force-depends
+
 
+
You can also have a look at the list of installed packages using "opkg list-installed" and pick packages that you don't need.
+
 
+
==Stop the UI==
+
The user interface uses WebKit, which can take up a lot of the device's memory.  Be sure to stop it before installing the SDK:
+
/etc/init.d/chumby-netvbrowser stop
+
/etc/init.d/chumby-netvserver stop
+
 
+
==Getting the compiler installed==
+
Once you have freed up about 250 MB, you can run
+
 
+
opkg install task-sdk-native
+
  
 
This process will download all of the files, headers, and executables required to do C development.
 
This process will download all of the files, headers, and executables required to do C development.
Line 41: Line 36:
 
  ./hello
 
  ./hello
 
  Hello, world!
 
  Hello, world!
 +
 +
The total space consumed by the toolchain is currently around 380 MB.

Revision as of 03:03, 3 October 2011

Compatibility

This documentation is verified at version 12 firmware.

NeTV includes the abilities to download packages that are pre-compiled from the chumby release servers.

To do local development, you will use this facility to install gcc.

Preparing the device

First, connect to the network using the NeTV UI. Once you are connected to the network, ssh into the device.

Then, execute this series of commands:

 mount -o remount,rw /
 mkdir /tmp/roroot
 mount / /tmp/roroot -o bind 
 mkdir /tmp/unionroot
 mkdir /media/storage/newroot
 mount -w -t unionfs -o dirs=/media/storage/newroot=rw:/tmp/roroot=ro unionfs /tmp/unionroot 
 mount /var/volatile /tmp/unionroot/var/volatile -o bind
 chroot /tmp/unionroot /bin/bash
 mount -a
 mkdir /dev/pts
 mkdir /dev/shm
 mount devpts /dev/pts -t devpts
 mount tmpfs /dev/shm -t tmpfs -o rw,mode=777
 opkg update
 opkg install task-sdk-native
 opkg install libgcc-dev

This process will download all of the files, headers, and executables required to do C development.

Once this process is done, you can now use gcc:

gcc -o hello hello.c
./hello
Hello, world!

The total space consumed by the toolchain is currently around 380 MB.