Debian armhf


smilnovi

Still Fresh
Joined
Dec 31, 2008
Messages
68
Hi to all! I'm one of the happy recent owners of pandora, and I like it. But, I like Debian too, so I have tried to use the wiki, this forum and other web pages to find a way to install armhf on my SD card. So far, I haven't had much success. It seems to me as if there is a bit of confronting information which doesn't work for me.


I have choosen to use armhf kernel, and perhaps this is the main issue that I have with the instalation.


Since I'm using still developing Debian architecture, I'm using Sid version, and kernel 3.2.0. I have managed to partition my card to ext2 and swap partition, and using qemu-arm-static and chroot on my desktop PC to install armhf on the card. But, there are a few issues that I'm not sure about.


As far as I have been able to gather, if there is an OS on SD card, pandora will first boot xloader and u-boot from NAND. Now, for the next step I'm not sure. When I put autoboot.txt with


setenv bootargs debug root=/dev/mmcblk0p1 rw rootdelay=2 vram=6272K omapfb.vram=0:3000K


ext2load mmc 0:1 0x80300000 /boot/kernel-name



bootm 0x80300000



I have the following:


1)


if I just use default vmlinuz-3.2.0-2-omap, then pandora boots, but with NAND kernel, and then greets me with the message "/sbin/init: 0: can't access tty: job control turned off". I can then use command line to see that the booted kernel is the NAND one. I can manually do limited stuff in the system, and I can see that the SD is mounted and that I'm using the system from SD, but the system didn't boot entirely and properly.


2)


If I use uImage which I have created with


mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n 3.2.0-2-omap -d /boot/vmlinuz-3.2.0-2-omap /boot/uImage


which I have found on https://wiki.adyxax....ers/OpenPandora and this is the only place that I have been able to find exact parameters to use for pandora. On this site there is also an line about using mkimage with initrd.img.


Then all I see is the cube logo at the beginning of the pandora boot, and it stays that way. I have read that for the first time it takes a while (I don't understand why?) for it to boot, but I have waited for over half an hour and nothing.


The things that confuse me are:


- I have found 2 distinct and different formats for autoboot.txt file. Which one should I use?


- Why does Pandora boot NAND kernel if I have autoboot.txt on my first ext2 SD primary partition?


- Do I have to use mkimage or not, and if I do, what parameters do I have to use?


- What about initrd.img? Do I have to do something or not with that?


- If pandora boots NAND kernel, is it an first stage and it then wants to boot my kernel but fails for some reason? This I find strange because as far as I know, no other linux system boots this way - first one kernel and then the other.


I know about "Debian on SD" and other projects, but I'd like to use Debian packaging system in full, including kernel updates and similar.
 

Prometheus

Well-Known Member
Joined
Mar 8, 2008
Messages
9,472
Hi and welcome to the forum! :)


I'm not certain that this quite fits into the section for development discussion, so I'm moving it to the Support section if that's ok.
 

mcobit

Advanced Member
Joined
Jul 28, 2008
Messages
6,910
You will have to build the kernel for the omap hardware. A lot of optimisation went into the kernels for the Pandora.


If you want kernelupdates from debian arm, you'll need to get this stuff upstream to the debian distribution.


There are other pandoraspecific things, that you would need to take into account like buttons, lidswitch etc.


The best solution would be to use the Pandorakernel with the debiandistribution. Should work better, if you don't want to maintain your own kernel.
 

smilnovi

Still Fresh
Joined
Dec 31, 2008
Messages
68
So, I can use kernel from git.openpandora.org, and everything else from debian armhf? I can see that there is an 3.x.x series kernel. Do I need some special procedure to create uImage? And then the setup with autoboot.txt will boot my kernel?


I'm reading http://pandorawiki.org/Kernel_build_instructions now and will see if I can build it.
 

Linux-SWAT

Forum Addict!
Joined
Feb 13, 2010
Messages
9,048
Indeed, at first, just copy kernel + modules from the official rootfs.


The 3.x kernel is in /lib/boot/ , and it's modules in /lib/modules/


Use this autoboot:



Code:
setenv bootargs root=/dev/mmcblk0p1 ro rootwait vram=6272K omapfb.vram=0:3000K mmc_core.removable=0

ext2load mmc 0 0x80300000 /boot/uImage

bootm 0x80300000
 

Cloudef

Member
Joined
Dec 30, 2009
Messages
460
Location
Gensokyo
Keep in mind that SGX doesn't have hfp drivers out. N900 is special case as nokia provides those.
 

smilnovi

Still Fresh
Joined
Dec 31, 2008
Messages
68
Well, it seems that either it's not an issue with kernel, or that I don't know what I'm doing. Probably the latter. :)


I've tried to use default pandora kernel from the image (where is hidden the 3.2.1 kernel that is available through boot menu by pressing right shoulder button?), and I'm using autoboot.txt that Linux-SWAT posted, but I'm still stuck with the same situation - pandora boots NAND kernel, and then init says "/sbin/init: 0: can't access tty: job control turned off".


If it was an PC, I'd say that either kernel failed to setup something that I'm supposed to send to it as an parameter while it boots, or that there is something somewhere, perhaps in initrd.img, that it fails to load. But since it is not an standard PC, I don't quite understand the way it boots itself and why it loads the NAND kernel. :(


I guess chroot will do for now, until I find a suitable solution. <_<
 
Last edited by a moderator:

mcobit

Advanced Member
Joined
Jul 28, 2008
Messages
6,910
So you have copyed the kernel to your debian sdcard? The modules, too?
 

notaz

Certified Guru
Joined
Aug 23, 2005
Messages
4,913
Location
Lithuania
Website
notaz.gp2x.de
How did you format your card (can you list partition with fdisk -l)?


Which partition has autoboot?


What filesystems did you use?
 

smilnovi

Still Fresh
Joined
Dec 31, 2008
Messages
68
[facepalm]


Yes, the modules... :wacko:


Well, I have copied them too now, and did depmod -a, but I still get the same error. I will have to check what else I have missed. Also, it seems that SID cdebootstrap has issues with cleaning its stuff after the second stage installation (well, it is SID afterall :) ), so there is also an possibility that there are some issues from Debian side...


@Notaz:


device boot start end blocks id system


/dev/mmcblk0p1 * 33 458784 14680064 83 linux


/dev/mmcblk0p2 458785 488512 951296 82 linux swap


Pandora loads NAND kernel as far as I can tell, which like I have said is a bit confusing, mounts SD p1, but then reports an init error. Then I do manual /etc/init.d/mountall.sh and after that most of the stuff works, but some stuff report the same error, missing /dev/tty (emacs for example, and init if I try to manually start it) and refuse to start. I'm not sure what initializes /dev/tty, since I can see the file there, but I guess either an module initializes it or something in the kernel image itself. I've tried to modprobe a few modules by hand, but I don't see any (by name) that could be appropriate for /dev/tty.


But, I'll recheck first what else I have missed, and then repost the results.
 

smilnovi

Still Fresh
Joined
Dec 31, 2008
Messages
68
where is hidden the 3.2.1 kernel that is available through boot menu by pressing right shoulder button?
This is the one i indicated. The /boot one is still the 2.6.

I apologize, in all my haste I have overlooked that part of your post.


3.2.1 now boots, thank you! But I still have issues with init, the same error at the beginning. It seems that it is something Debian related, so I will have to check on Debian forums.


BTW, are you sure that default 3.2.1 pandora-adapted kernel works with Debian armhf? I will have to recompile the kernel using Debian armhf tools if possible, as soon as I have greater understanding of the way the pandora kernel has to be built.
 

Linux-SWAT

Forum Addict!
Joined
Feb 13, 2010
Messages
9,048
I don't think this problem comes from the kernel.
 
Last edited by a moderator:

smilnovi

Still Fresh
Joined
Dec 31, 2008
Messages
68
I don't think this problem comes from the kernel.

And you're right. It was init. Or rather, lack of it.


For some reason, instead of pointing to the /sbin/init.REAL, /sbin/init link pointed to /bin/sh. I really don't understand why. Perhaps because I have done second-stage install under chrooted quemu on my desktop? Second stage didn't finish properly, there was an error installing cdebootstrap-apt-helper, so I guess other cdebootstrap helper packages didn't also, and so probably the cleanup wasn't finished...


I'm not sure. I will investigate more later, and if needed report to the appropriate Debian team.


Anyway, I have relinked init, and, it works! So, command line boot works now, there are some issues I'm resolving and cleaning up (I have some FS corruption after all of the forcefull card removals and reboots and it seems fsck has borked some of the inodes which were occupied :unsure: ), and I hope I will soon be able to use pandora as it was meant to be. :)


I hope debsums will help me locate the problems so that I can reinstall as needed. If anyone knows any other (better?) debian tool that can recheck all of the installed packages and point out files that are broken, please point them to me.


BTW, I plan to continue updating on my progress with Debian armhf for anyone who'd like to try it too, so, I'd need an advice, should I continue it in this thread, open a new one, or perhaps use some other?
 

smilnovi

Still Fresh
Joined
Dec 31, 2008
Messages
68
Great, thanks, I'm checking it out! There are a lots of docs and forum threads all over the place for me to read upon.


In the meantime, a few things aren't quite obvious to me from the various wiki sources, and I'd like to be sure if I have understood everything correctly:


- when people here say "firmware" it is actually packed install of kernel for pandora NAND, for which I need openembedded and openpandora overlay over openembedded, if I want to compile and build it myself (currently, I don't)


- pandora-kernel (from git.openpandora.org) is "regular" kernel with appropriate openpandora team additions that I can build without openembedded stuff if I don't want to flash NAND


- if I follow the "stable release" tag in pandora-kernel, I should be safe with an functional 3.2.x kernel


- with Debian, when installing compiled kernel image from package, there is also appropriate config file containing parameters that have been selected to compile that instance of the kernel. Where can I find that config for pandora, so that I can know what is ok for pandora HW?
 

Linux-SWAT

Forum Addict!
Joined
Feb 13, 2010
Messages
9,048
-Firmware is the OS.


-Yes.


-I do myself:



Code:
cd /usr/src/

git clone git://openpandora.org/pandora-kernel.git

ln -s pandora-kernel linux

cd pandora-kernel

git checkout --track -b pandora-3.2 origin/pandora-3.2

make omap3_pandora_defconfig

-Yup, certainly /proc/config or something like that.

Also the



Code:
make omap3_pandora_defconfig

above will give you the .config.
 

smilnovi

Still Fresh
Joined
Dec 31, 2008
Messages
68
Thank you, I think I have all the info that I need for now! :D


I hope compiling my own kernel will help, because I have random segmentation faults with various stuff, just today morning fsck segfaulted and I had to rerun it in hope it will finish. Sometimes system boots, sometimes init segfaults and everything stops, apps crash... Fun times! :D


My guess so far is that the combination of pandora kernel, pandora and debian armhf firmware and modules, and debian armhf system don't like each other very much. Or, maybe it's because it is Debian Sid after all... Well, I hope I will be able to fix it.
 
Top