Difference between revisions of "NeTV local compilation"
(→Preparing the device) |
|||
(3 intermediate revisions by 2 users not shown) | |||
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. | ||
− | |||
− | |||
==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. | ||
− | + | Then, execute this series of commands to create a unionfs that unlocks the free space on the microSD card: | |
− | + | 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 | ||
− | + | Finally, download and install the package to the new unionfs root: | |
− | + | 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. It takes a while, maybe a half hour or so. It's recommended to kill the NeTVBrowser and NeTVServer before running this to free up RAM. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | 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: | Once this process is done, you can now use gcc: | ||
Line 36: | Line 37: | ||
./hello | ./hello | ||
Hello, world! | Hello, world! | ||
+ | |||
+ | The total space consumed by the toolchain is currently around 380 MB. | ||
+ | |||
+ | '''Important note''': every time the device is rebooted, you need to re-do the unionfs. You do not need to re-install the toolchain, as it is already there, but you do need to chroot into the unionroot. |
Latest revision as of 20:20, 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 to create a unionfs that unlocks the free space on the microSD card:
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
Finally, download and install the package to the new unionfs root:
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. It takes a while, maybe a half hour or so. It's recommended to kill the NeTVBrowser and NeTVServer before running this to free up RAM.
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.
Important note: every time the device is rebooted, you need to re-do the unionfs. You do not need to re-install the toolchain, as it is already there, but you do need to chroot into the unionroot.