• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1] 2
Author Topic: sheeva with-linux kernels into normal Debian install?  (Read 10167 times)
darkscout
Newbie
*

Karma: 0
Posts: 26


View Profile
« on: March 02, 2010, 10:32:03 PM »

For the life of me I can't figure out how to get sheeva.with-linux kernel releases to work with the normal Debian install.

sheeva.with-linux is only a uImage where as the Debian kirkwood installs have uImage & uInitrd.

I've tried to extract the uImage kernel and use the standard Debian tools to rebuild everything. Below is the post I was making when I thought I was brilliant and it'd work Smiley.

Right now it just hangs loading uImage.
Code:
Marvell>> ext2load mmc 0 0x0800000 /uInitrd

2576284 bytes read
Marvell>> ext2load mmc 0 0x400000 /uImage

Requiring a hard reboot.
--------
So you can extract the normal vmlinuz from the uImage by stripping off a bit.
Code:
# dd if=uImage of=testKernel bs=64 skip=1

# ls -l testKernel vmlinuz-2.6.32-2-kirkwood
-rw-r--r-- 1 root root 1429756 Mar  2 20:12 testKernel
-rw-r--r-- 1 root root 1429756 Feb 12 16:01 vmlinuz-2.6.32-2-kirkwood
#

# diff testKernel vmlinuz-2.6.32-2-kirkwood

So following that logic:
Code:
dd if=sheeva-2.6.32.9-uImage of=vmlinuz-2.6.32.9-kirkwood bs=64 skip=1
Then I can get it to build a initrd image:

Code:
root@plug:/boot# update-initramfs -k 2.6.32.9 -c
update-initramfs: Generating /boot/initrd.img-2.6.32.9

You need to create a link for the vmlinuz,
Code:
# ln -s /boot/vmlinuz-2.6.32.9-kirkwood /boot/vmlinuz-2.6.32.9

Code:
# update-initramfs -k 2.6.32.9 -u
update-initramfs: Generating /boot/initrd.img-2.6.32.9
Generating kernel u-boot image... done.
Creating backup of /boot/uImage.
Creating new /boot/uImage.
Generating initrd u-boot image... done.
Creating backup of /boot/uInitrd.
Creating new /boot/uInitrd.

Logged

darkscout
Newbie
*

Karma: 0
Posts: 26


View Profile
« Reply #1 on: March 02, 2010, 10:59:17 PM »

I found the solution, but it wasn't quite the one I was looking for...

It requires change of the boot args.

Code:
setenv load_sd 'mmcinit;ext2load mmc 0 0x800000 /uImage'
setenv bootcmd_sd 'setenv bootargs $(bootargs_sd);run load_sd;bootm 0x800000'

I've also just thought this through and I'm going to rename that to /sheeva-uImage so that when I do an apt update Debian doesn't replace uImage.

Also going to change the failover so that if I remove /uImage-sheeva it will boot my standard distro.

Code:
setenv bootargs_sd 'console=ttyS0,115200 root=/dev/mmcblk0p2 rw'
setenv load_debian_sd 'mmcinit; ext2load mmc 0 0x0800000 /uInitrd; ext2load mmc 0 0x400000 /uImage'
setenv load_sheeva_sd 'mmcinit; ext2load mmc 0 0x800000 /sheeva-uImage'
setenv bootcmd_debian_sd 'setenv bootargs $(bootargs_sd);run load_debian_sd;bootm 0x400000 0x0800000'
setenv bootcmd_sheeva_sd 'setenv bootargs $(bootargs_sd);run load_sheeva_sd;bootm 0x800000'

setenv bootargs_nand 'console=ttyS0,115200 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs'
setenv bootcmd_nand 'setenv bootargs $(bootargs_nand);nand read.e 0x2000000 0x100000 0x1000000;bootm 0x2000000'

setenv bootcmd 'run bootcmd_sheeva_sd;run bootcmd_debian_sd;run bootcmd_nand'

Now nearly no matter what happens I should boot.

Smiley

-

Still hoping to hear of a solution that doesn't require me running around the house figuring out WTF I put my USB-b cable and dragging the plug out of its secret hiding place to hook it up to my MacBook.

« Last Edit: March 02, 2010, 11:33:51 PM by darkscout » Logged

Abra
Newbie
*

Karma: 1
Posts: 29


View Profile
« Reply #2 on: March 03, 2010, 03:53:26 AM »

initrd is not needed, actually your bootcmd_sheeva_sd doesn't use it (and if it succeeds, bootcmd_debian_sd is never run).
So are you booting the sheeva-uImage now?
Logged

darkscout
Newbie
*

Karma: 0
Posts: 26


View Profile
« Reply #3 on: March 03, 2010, 08:16:39 AM »

initrd is not needed, actually your bootcmd_sheeva_sd doesn't use it (and if it succeeds, bootcmd_debian_sd is never run).
So are you booting the sheeva-uImage now?

Yep. That's the 'failback' if I want to go to the standard debian distro so I don't have to break out the cable. All I have to do is move sheeva-uImage and reboot.

I just copy and pasted those instructions from somewhere I found them.
Logged

mundhra
Newbie
*

Karma: 1
Posts: 36


View Profile
« Reply #4 on: March 03, 2010, 12:29:36 PM »

darkscout: the solution you found is the correct one. as long as you did a saveenv, you shouldn't need to mess with the serial console anymore. on subsequent kernel updates you will just need to rename/link the updated kernel so that it is found by uboot.
Logged

Deviant0ne
Newbie
*

Karma: 0
Posts: 30



View Profile
« Reply #5 on: March 15, 2010, 02:31:49 PM »

I was having the same issue; I tried to follow your instructions, to no avail. Finally, after about a week of tinkering (keeping in my that I'm not exactly sure how I did it), I was able to get the sheeva-with-linux kernels working.

I first added the following to my /etc/apt/sources.list :
Code:
deb http://people.debian.org/~tbm/orion lenny main
I then did a:
Code:
sudo apt-get update
followed by:
Code:
sudo apt-get install flash-kernel
Installing flash-kernel and its dependencies creates (I'm not yet sure how) the ability to use the script and install the kernels to NAND. Once the install was complete, I then navigated to where I had stored the README-2.6.32.9 script (which I had already made executable) and ran the following command:
Code:
sudo bash ./README-2.6.32.9 --nandkernel
This wrote the kernel correctly to flash, I rebooted and I was up and running with 2.6.32.9. I hope this helps!
« Last Edit: March 16, 2010, 11:49:56 AM by Deviant0ne » Logged

Deviant0ne
Newbie
*

Karma: 0
Posts: 30



View Profile
« Reply #6 on: March 16, 2010, 12:01:48 PM »

Ok, I think I have this figured out... When you install flash-kernel, one of the dependencies is a package called 'devio'. This package allows for the correct reading (or writing) to a region of a block device. This is the key to using the README scripts provided from sheeva-with-linux. Before running the script, it is my belief that all one would need to do is:
Code:
sudo apt-get install devio
This should allow for the installation of a NAND kernel without the need for flash-kernel and other unneeded dependencies. Granted, I haven't tested this yet, but it seems to me, the most solid solution.

More information about flash-kernel and dependencies HERE
More information about devio HERE
« Last Edit: March 16, 2010, 12:03:28 PM by Deviant0ne » Logged

KidE
Newbie
*

Karma: 1
Posts: 28


View Profile
« Reply #7 on: March 14, 2011, 11:59:45 AM »

This is exactly wat i was looking for. It solved a whole bunch of my problems without having to recompile my kernel.

I would like to link this article in my new and improved HOWTO
Logged

pacolm
Full Member
***

Karma: 1
Posts: 102


View Profile
« Reply #8 on: March 15, 2011, 12:44:02 AM »

I was having the same issue; I tried to follow your instructions, to no avail. Finally, after about a week of tinkering (keeping in my that I'm not exactly sure how I did it), I was able to get the sheeva-with-linux kernels working.

I first added the following to my /etc/apt/sources.list :
Code:
deb http://people.debian.org/~tbm/orion lenny main
I then did a:
Code:
sudo apt-get update
followed by:
Code:
sudo apt-get install flash-kernel
Installing flash-kernel and its dependencies creates (I'm not yet sure how) the ability to use the script and install the kernels to NAND. Once the install was complete, I then navigated to where I had stored the README-2.6.32.9 script (which I had already made executable) and ran the following command:
Code:
sudo bash ./README-2.6.32.9 --nandkernel
This wrote the kernel correctly to flash, I rebooted and I was up and running with 2.6.32.9. I hope this helps!

Wow!, that's impressive. So, what are the steps in order to get a guruplug upgraded in this way?. Could you please make a 'guide for dummies'?. Do we need to modify anything in our uboot before run the 'sudo bash ./README-2.6.XX.X --nandkernel' command?. I mean if we need to set the proper arcNumber or whatever. How could we remove the previous kernel version not used?.
 In my case, guruplug server plus running debian in the nand flash, not in a external drive/sd card, so, running the command with the nandkernel option should work, isn't it?

 Thanks in advance,

PacoLM
Logged

cbxbiker61
Global Moderator
Sr. Member
*****

Karma: 38
Posts: 497


View Profile
« Reply #9 on: March 15, 2011, 04:51:36 PM »

How could we remove the previous kernel version not used?.

If you're putting your kernel on nand with --nandkernel, the only "old" files that you might want to delete would be the /lib/modules/OLD_VERSION.  I leave mine in place until I'm satisfied the new kernel runs well.
« Last Edit: March 16, 2011, 01:18:05 AM by cbxbiker61 » Logged

pacolm
Full Member
***

Karma: 1
Posts: 102


View Profile
« Reply #10 on: March 16, 2011, 12:21:18 AM »

How could we remove the previous kernel version not used?.

If you're putting your kernel on nand with --nand-write, the only "old" files that you might want to delete would be the /lib/modules/OLD_VERSION.  I leave mine in place until I'm satisfied the new kernel runs well.


 Hi cbxbiker61,

 I have a previous bad experience updating a kernel using a READMEX.X.X file, I had bricked my guruplug. It was my fault, I forgot to set the arcNumber, finally, with the help of many people here, I was able to get it back to life again. I'm pretty worried about upgrading the kernel, so it will be very useful for people like me have a step-by-step guide.
 
 You mentioned the option --nand-write, so know I'm more confused than before... where is this option, in the script to install the new kernel, I only see "--nandkernel" and "--rootkernel". Could you please help me?.

 TIA,

 PacoLM
Logged

cbxbiker61
Global Moderator
Sr. Member
*****

Karma: 38
Posts: 497


View Profile
« Reply #11 on: March 16, 2011, 01:19:08 AM »

How could we remove the previous kernel version not used?.

If you're putting your kernel on nand with --nand-write, the only "old" files that you might want to delete would be the /lib/modules/OLD_VERSION.  I leave mine in place until I'm satisfied the new kernel runs well.


 Hi cbxbiker61,

 I have a previous bad experience updating a kernel using a READMEX.X.X file, I had bricked my guruplug. It was my fault, I forgot to set the arcNumber, finally, with the help of many people here, I was able to get it back to life again. I'm pretty worried about upgrading the kernel, so it will be very useful for people like me have a step-by-step guide.
 
 You mentioned the option --nand-write, so know I'm more confused than before... where is this option, in the script to install the new kernel, I only see "--nandkernel" and "--rootkernel". Could you please help me?.

 TIA,

 PacoLM

Should've been --nandkernel. Fixed now.
Logged

pacolm
Full Member
***

Karma: 1
Posts: 102


View Profile
« Reply #12 on: March 16, 2011, 03:15:57 PM »

Hi,

 Here are the actual enviroment variables on my Guruplug server plus:
Code:
bootcmd=${x_bootcmd_usb}; ${x_bootcmd_kernel}; setenv bootargs ${x_bootargs} ${x_bootargs_root}; bootm 0x6400000;
bootdelay=3
baudrate=115200
x_bootcmd_usb=usb start
x_bootcmd_kernel=nand read.e 0x6400000 0x100000 0x400000
x_bootargs=console=ttyS0,115200
x_bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs
ethact=egiga0
ethaddr=XX:XX:XX:XX:XX:XX
eth1addr=XX:XX:XX:XX:XX.XX
ipaddr=192.168.1.43
serverip=192.168.1.33
filesize=B940000
fileaddr=6400000
stdin=serial
stdout=serial
stderr=serial
arcNumber=2659
mainlineLinux=yes

 As you could see, there are many differences from the recommended settings of the README-2.6.38 (the latest one):
Code:
####### change bootargs, replace nand_mtd with orion_nand and add rootfstype=jffs2
# setenv bootargs rootfstype=jffs2 console=ttyS0,115200 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=192.168.1.9:192.168.1.4:192.168.1.4:255.255.255.0:DB88FXX81:eth0:none

 ...mainly in the bootargs section.
 I would like to upgrade the kernel on my plug, but I bricked it in a previous kernel upgrade trial. I ask for help from some expert in this upgrades. Should I change the bootargs of my plug, or should I apply the changes recommended in the upgrade script?

 My plug is using the internal flash to boot the Debian lenny, I do not have any microSD to boot from, as is working fine, I would like to leave it as it is, but with a new kernel. After bricking the plug, I finally was able to put a new kernel and the performance of the application I use it for improved a lot.

 Another question is regarding the uboot, is this version 'U-Boot 2010.03-01161-gd91b0a9 (Apr 22 2010 - 03:24:41) ' compatible with the new kernel or do I need to upgrade it too?

 More information, these are the partitions created on NAND:
Code:
Creating 3 MTD partitions on "orion_nand":
0x000000000000-0x000000100000 : "u-boot"
0x000000100000-0x000000500000 : "uImage"
0x000000500000-0x000020000000 : "root"

 And the actual kernel version:
Code:
Linux guruplug-debian 2.6.33.7 #3 PREEMPT Thu Dec 9 14:14:08 EST 2010 armv5tel GNU/Linux

 I know that there are a lot of questions, but I'm plenty of doubts before taking the decission!

Thanks in advance,

PacoLM
Logged

pacolm
Full Member
***

Karma: 1
Posts: 102


View Profile
« Reply #13 on: March 25, 2011, 03:20:36 PM »

Hi again,

 Quick question, as nobody answered the doubts I have in my previous post. In my guruplug the setting of the rootfstype is ubifs

Code:
x_bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs


 But in the script to upgrade the kernel there are these lines:
Code:
flash_eraseall -j /dev/$Mtd
nandwrite -pm /dev/$Mtd sheeva-$KVer-uImage
The first one, will do a format to jffs2, as seen here
Code:
guruplug-debian:/mnt# flash_eraseall --help (edited)
  -j, --jffs2       format the device for jffs2

So, do I need to change my bootargs or not previously to upgrade the kernel?. My rootfs is not going to change, it's only a kernel upgrade, isn't it?

Please, help me to disipate my doubts, I'm not an expert, but I would like to keep my guruplug updated.

Thanks in advance,

PacoLM

Logged

cbxbiker61
Global Moderator
Sr. Member
*****

Karma: 38
Posts: 497


View Profile
« Reply #14 on: March 26, 2011, 08:56:46 AM »


 But in the script to upgrade the kernel there are these lines:
Code:
flash_eraseall -j /dev/$Mtd
nandwrite -pm /dev/$Mtd sheeva-$KVer-uImage
The first one, will do a format to jffs2, as seen here
Code:
guruplug-debian:/mnt# flash_eraseall --help (edited)
  -j, --jffs2       format the device for jffs2

So, do I need to change my bootargs or not previously to upgrade the kernel?. My rootfs is not going to change, it's only a kernel upgrade, isn't it?

Please, help me to disipate my doubts, I'm not an expert, but I would like to keep my guruplug updated.

Thanks in advance,

PacoLM



The kernel is being written into it's own partition.  The script does not reformat your root filesystem, but does copy the modules onto the root filesystem.
Logged

Pages: [1] 2
Print
Jump to: