It is currently Wed Jun 19, 2013 1:17 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: How to build a tonidoplug2 kernel
PostPosted: Tue Dec 13, 2011 10:35 pm 
Super Tonidoid
Super Tonidoid
Joined: Sat Oct 22, 2011 2:52 pm
Posts: 36

This is a step by step procedure to build the original kernel that comes with your tp2. All responsibility is yours. The software built here is to replace the kernel and modules on an existing operational sata or usb disk. The purpose is to assure yourself that you can build a functional kernel. I highly recommend that you build a stable kernel before creating a new one with different capabilities.

The cross compiler used in this procedure is only functional on a linux desktop. This was done with a debian/ubuntu style os called Zonin. It is my current choice. Linux is linux, the procedure should be the same except for installing dependencies.

1) Open a command line terminal.

2) Download a cross compiler.
wget http://www.plugcomputer.org/405/us/gplu ... bi.tar.bz2

3) Install the cross compiler in the /opt directory.
sudo tar xvjpf arm-marvell-linux-gnueabi.tar.bz2 -C /opt/

4) Delete the download.
rm arm-marvell-linux-gnueabi.tar.bz2

5) Install software dependencies.
sudo apt-get install build-essential automake autoconf libtool pkg-config intltool
sudo apt-get install libncurses5-dev uboot-mkimage

6) Make a working directory and go to it. Mines is called tonido
mkdir tonido
cd tonido

7) Download tonido kernel source code.
wget http://www.tonidoplug.com/partners/topk ... 22.tar.bz2

8) Install kernal source.
tar xvjpf kernel-2.6.31-topkick1281p2-codelathe-20111122.tar.bz2

9) Delete the download.
rm kernel-2.6.31-topkick1281p2-codelathe-20111122.tar.bz2

10) Simplify the package name and move to it.
mv kernel-2.6.31-topkick1281p2-codelathe-20111122 kernel-2.6.31
cd kernel-2.6.31

11) Set the environment for the build. The declarations are only valid for the life of the command shell. If you exit the shell and open a new shell to continue, you will need to set the enviroment again. Highly recommend cut and paste on these commands as the statement need to be exact.
export PATH=/opt/arm-marvell-linux-gnueabi/bin:$PATH
export CROSS_COMPILE="arm-marvell-linux-gnueabi-"
export ARCH=arm

12) Clean up build for start fresh.
make mrproper

13) Create a default configuration file for the build. This is the shipped kernel.
make mv88f6281_gw_defconfig

14) If were going to change the kernel or modules. This is where the configuration is modified. The README file in this directory tells you about different program that will make the changes. I will write another howto telling how to add audio to the tp2. That will change the configuration file. I suggest just building a clean kernel for now using the default configuration.

15) Build the kernel.
make uImage

16) Build the modules
make modules

17) Make a directories to store the new software.
mkdir ../current_kernel
mkdir ../current_kernel/boot

18) Store the modules.
make INSTALL_MOD_PATH=../current_kernel modules_install

19) Move the kernel into the new directory and change is access.
cp arch/arm/boot/uImage ../current_kernel/boot/
chmod 744 ../current_kernel/boot/uImage

The new kernel is at ../current_kernel/boot/uImage
The new modules are at ../current_kernel/lib/modules

I assuming your boot directly from the tp2 and that you have a bootable disk that is not booted but mounted at /media/disk1part1/.

Using the shell
ssh tp2 -l root
cd /media/disk1part1/boot
mv uImage uImage_save
cd /media/disk1part1/lib
mv modules modules_save
exit

Now back at command shell at ~/tonido/kernel-2.6.31
scp ../current_kernel/boot/uImage root@tp2:/media/disk1part1/boot/
scp ../current_kernel/lib/modules/ root@tp2:/media/disk1part1/lib/

reboot and I hope it works.


Offline
 Profile  
 Post subject: Re: How to build a tonidoplug2 kernel
PostPosted: Wed Dec 14, 2011 4:07 pm 
Admin Tonidoid
Admin Tonidoid
User avatar
Joined: Tue Dec 30, 2008 12:13 am
Posts: 7408
Location: Dallas, USA

Nice write up, stickied!


Offline
 Profile  
 Post subject: Re: How to build a tonidoplug2 kernel
PostPosted: Wed Dec 14, 2011 7:50 pm 
Regular Tonidoid
Regular Tonidoid
Joined: Sat Nov 05, 2011 4:42 pm
Posts: 19

This is great! :D
Can't wait to see how the alsa drivers get compiled in. Thanks so much for the nice write-up.


Offline
 Profile  
 Post subject: Re: How to build a tonidoplug2 kernel
PostPosted: Sat Jan 07, 2012 6:45 am 
Rookie Tonidoid
Rookie Tonidoid
Joined: Tue Nov 22, 2011 5:30 am
Posts: 7

Hi guys. This works fine for me, right down to step 12 when I encounter the error:

root@TonidoPlug2:~/tonido/kernel-2.6.31# make mrproper
/opt/arm-marvell-linux-gnueabi/bin/arm-marvell-linux-gnueabi-gcc: 1: ELF€”4X4: not found
/opt/arm-marvell-linux-gnueabi/bin/arm-marvell-linux-gnueabi-gcc: 2: Syntax error: "(" unexpected (expecting "/opt/arm-marvell-linux-gnueabi/bin/arm-marvell-linux-gnueabi-gcc: 1: ELF
€”4X4: not fo/opt/arm-marvell-linux-gnueabi/bin/arm-marvell-linux-gnueabi-gcc: 2: Syntax error: "(" unexpected (expecting ")")
CLEAN .tmp_versions
CLEAN include/asm-arm/mach-types.h
CLEAN scripts/basic
CLEAN scripts/kconfig
CLEAN include/config
CLEAN .config .config.old include/asm include/linux/autoconf.h include/linux/version.h include/linux/utsrelease.h
root@TonidoPlug2:~/tonido/kernel-2.6.31#

Any ideas what could be causing this? As far as I can see I have followed all instructions correctly.

Many thanks

Allan


Offline
 Profile  
 Post subject: Re: How to build a tonidoplug2 kernel
PostPosted: Sat Jan 07, 2012 12:04 pm 
Tonido MVP
Tonido MVP
Joined: Fri Oct 21, 2011 8:20 pm
Posts: 295

superfurryallan wrote:
Any ideas what could be causing this? As far as I can see I have followed all instructions correctly.

I think this is the problem:
"The cross compiler used in this procedure is only functional on a linux desktop. "

You are attempting to run this on a tonido plug. The gcc cross compiler won't work there. You need to run this on a non-ARM Linux box. The original poster ran it on a debian variant called Zonin. I just ran it a few days ago on Ubuntu 11.10 and it worked perfectly.

If you don't have a running Linux desktop, you can boot from a CD or USB stick without disturbing your other OS.


Offline
 Profile  
 Post subject: Re: How to build a tonidoplug2 kernel
PostPosted: Wed Jan 11, 2012 2:06 pm 
Regular Tonidoid
Regular Tonidoid
Joined: Sat Nov 05, 2011 4:42 pm
Posts: 19

UrbanVoyeur wrote:
If you don't have a running Linux desktop, you can boot from a CD or USB stick without disturbing your other OS.

This is what I did, using the Universal USB Installer and the latest version of Ubuntu. I used an 8GB USB stick and used persistence for some storage (set it to the max), however I let one particularly long step go overnight and my computer shut itself off for some reason by the morning. When I went to start it back up something must have been corrupted since I could not log back into Ubuntu (made it to the login screen and then things got weird). I re-flashed the USB stick using the Universal USB Installer and started the process again, making sure I finished it in one sitting. Not sure if my little problem was a one-off ordeal or it's repeatable, but just to be safe I'd probably recommend doing the entire process in one shot if you're going to boot off a USB stick.


Offline
 Profile  
 Post subject: Re: How to build a tonidoplug2 kernel
PostPosted: Wed Jan 11, 2012 2:11 pm 
Tonido MVP
Tonido MVP
Joined: Fri Oct 21, 2011 8:20 pm
Posts: 295

usaplanb wrote:
I re-flashed the USB stick using the Universal USB Installer and started the process again, making sure I finished it in one sitting.

Were you able to successfully build the kernel?


Offline
 Profile  
 Post subject: Re: How to build a tonidoplug2 kernel
PostPosted: Tue Jan 17, 2012 12:19 pm 
Tonido Team
Tonido Team
Joined: Wed Jan 28, 2009 11:30 pm
Posts: 1361

Now it is in the knowledge base.
http://www.tonido.com/support/display/docs/How+to+build+a+TonidoPlug2+kernel


Offline
 Profile  
 Post subject: Re: How to build a tonidoplug2 kernel
PostPosted: Wed Jan 18, 2012 12:38 pm 
Regular Tonidoid
Regular Tonidoid
Joined: Sat Nov 05, 2011 4:42 pm
Posts: 19

UrbanVoyeur wrote:
Were you able to successfully build the kernel?

Yes, I was able to do this successfully.
I really wanted audio support for my TP2. I'm trying to run a Logitech Squeezebox server (which works great) and a Squeezeslave client as well (works now, but so far a little buggy). I haven't messed with it for a few weeks but I need to get back to it. I'm trying to get the same basic functionality as the SqueezePlug software (it doesn't support the TonidoPlug unfortunately) and it seems like I'm most of the way there.
The downside is I ended up corrupting whatever's on the internal flash memory of my TP2 and the procedure to reflash it fails for some reason (my boot environment variables got screwed up at some point during my tinkering and while I've reset them to their original state - thanks for your help with that btw - allowing me to boot to my SATA drive, the internal flash memory seems really screwed). To be clear, the aforementioned problem was NOT caused by me building a new kernel, just me being an idiot messing with my uBoot variables.


Offline
 Profile  
 Post subject: Re: How to build a tonidoplug2 kernel
PostPosted: Wed Jan 18, 2012 1:51 pm 
Tonido MVP
Tonido MVP
Joined: Fri Oct 21, 2011 8:20 pm
Posts: 295

usaplanb wrote:
The downside is I ended up corrupting whatever's on the internal flash memory of my TP2 and the procedure to reflash it fails for some reason

Have you tried this:
http://www.tonidouser.com/doku.php?id=a ... ootfsplug2

Or this:
viewtopic.php?f=32&t=4507&start=10


Offline
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 6 hours [ DST ]


 Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: