• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: kernel change  (Read 3614 times)
peter a
Full Member
***

Karma: 0
Posts: 132


View Profile
« on: February 15, 2010, 09:03:47 AM »

How do you change the kernel on Debian, when booting from a USB drive ?
( Made with http://www.cyrius.com/debian/kirkwood/sheevaplug/unpack.html )
I tried booting back from nand , mounting the boot partition ( sda1 ) and replacing the uImage file  (http://sheeva.with-linux.com/sheeva/index.php?dir=2.6.32.8%2F ) by renaming sheeva-xxxxxx-ulmage to just ulmage, and it won`t boot after that.
I tried replacing the old uImage back and it still wouldn’t boot, so in guess it`s not that simple to replace the kernel by swapping the UImage file.
I finished getting it to boot with the old UImage file, by tar untaring my tar ball back into the boot partition.

What is the way to replace the kernel and still make it boot ?
Logged

peter a
Full Member
***

Karma: 0
Posts: 132


View Profile
« Reply #1 on: February 15, 2010, 10:23:13 AM »

Just tried TheBigYahi method :-

mkdir /mnt/BootMnt
mount /dev/sda1 /mnt/BootMnt/
wget http://sheeva.with-linux.com/sheeva/README-2.6.32.8
chmod 755 README-2.6.32.8
./README-2.6.32.8 --rootkernel
mv /boot/sheeva-2.6.32.8-uImage /mnt/BootMnt/uImage

And still get the same :-

Code:
CPU : Marvell Feroceon (Rev 1)

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  3 2 1 0
(Re)start USB...
USB:   scanning bus for devices... 2 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
.
........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.

4480111 bytes read
.
.........................
.........................
.........................
.........................
.........................
.........................
.......................
..
........................

I think it`s getting to be not what I`m doing , but what uimage I`m trying to install .
or something else !!!!
Logged

mundhra
Newbie
*

Karma: 1
Posts: 36


View Profile
« Reply #2 on: February 15, 2010, 11:28:06 AM »

i've gone through similar issues as to what you're describing.

here's the uboot config from your install link:

setenv bootargs_console console=ttyS0,115200
setenv bootargs_root 'root=/dev/sda2 rootdelay=10'
setenv bootcmd_usb 'usb start; ext2load usb 0:1 0x0800000 /uInitrd; ext2load usb 0:1 0x400000 /uImage'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_usb; bootm 0x400000 0x0800000'

if you notice, the sheeva.with-linux.com kernels only have a uImage, and not a uInitrd, so the above boot configs will not work properly.

using this link as reference, i came upon the following:

setenv bootargs_console console=ttyS0,115200
setenv bootargs_root 'rw root=/dev/mmcblk0p1 rootdelay=10 rootfstype=ext2'
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x800000 /boot/uImage-2.6.30-sheevaplug'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_mmc; bootm 0x0800000'

i modified this for my config on my sdcard and it works. so, in your situation, if you have sda1 as /boot and sda2 as /, i would try something like this:

setenv bootargs_console console=ttyS0,115200
setenv bootargs_root 'root=/dev/sda2 rootdelay=10'
setenv bootcmd_usb 'usb start; ext2load usb 0:1 0x0800000 /uImage'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_usb; bootm 0x0800000'
Logged

peter a
Full Member
***

Karma: 0
Posts: 132


View Profile
« Reply #3 on: February 15, 2010, 12:21:48 PM »

Thank you !!!! , you are spot on

only changed :-

setenv bootcmd_usb 'usb start; ext2load usb 0:1 0x0800000 /sheeva-2.6.32.8-uImage'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_usb; bootm 0x0800000'

and have a boot after all day trying .

Webmin says - Linux 2.6.32.8 on armv5tel , so the kernel change did work.
Logged

mundhra
Newbie
*

Karma: 1
Posts: 36


View Profile
« Reply #4 on: February 15, 2010, 01:09:22 PM »

glad it worked. i spent a couple hours spinning my wheels on this yesterday (after forgetting things i already knew).

just keep in mind that if you update your kernel to .9 or whatever, you'll need to update your bootcmd_usb line.
Logged

peter a
Full Member
***

Karma: 0
Posts: 132


View Profile
« Reply #5 on: February 15, 2010, 01:55:16 PM »

My new problem , which isn`t a problem let is I need to reset the ENVs ( it still boots )

I did a oops on it which didn`t help, that is doing a printenv and paste the result back ot it`s self !!!!

Code:
baudrate=115200
loads_echo=0
rootpath=/mnt/ARM_FS/
netmask=255.255.0.0
console=a0000
e=ttyS0,115200
CASset=min
MALLOC_len=1
ethprime=egiga0
ethmtu=1500
usb0Mode=host
nandEcc=1bit
ethact=egiga0
cesvcid=ULULULULULULPPULULULULULDA
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
yuk_ethaddr=00:00:00:EE:51:81
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
ethaddr=00:50:43:01:4D:34
run_diag=no
serverip=10.10.0.2
ipaddr=10.10.0.1
nandEnvBase=a0000
pcieTune=no
bootcmd_mmc=mmcinit; ext2load mmc 0 0x0800000 /uInitrd; ext2load mmc 0 0x400000 /uImage
bootargs_setenv=bootcmd nand read.e 0x800000 0x100000 0x400000; bootm 0x800000
bootcmd_msetenv=bootcmd setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_mmc; bootm 0x400000 0x0800000
arcNumber=2097
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=10.4.50.4:10.4.50.5:10.4.50.5:255.255.255.0:DB88FXX81:eth0:none
bootargs_console=console=ttyS0,115200
bootargs_root=root=/dev/sda2 rootdelay=10
bootcmd_usb=usb start; ext2load usb 0:1 0x0800000 /sheeva-2.6.32.8-uImage
bootcmd=setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_usb; bootm 0x0800000
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=yes
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes

I may have to do a printout and do a line by line to the factory default  or do a clear and dump.

Logged

mundhra
Newbie
*

Karma: 1
Posts: 36


View Profile
« Reply #6 on: February 15, 2010, 02:18:20 PM »

i don't see anything obviously wrong with what you pasted.

if the lines didn't start with setenv, then nothing should be modified. if you didn't do a saveenv, a power-off then power-on should revert you to the last saved environment variables regardless.
« Last Edit: February 16, 2010, 09:03:12 AM by mundhra » Logged

diefrisur
Newbie
*

Karma: 0
Posts: 11


View Profile
« Reply #7 on: February 17, 2010, 02:04:49 PM »

I followed the above steps and the result was the following:

Code:
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
mice: PS/2 mouse device common for all mice
rtc-mv rtc-mv: rtc core: registered rtc-mv as rtc0
i2c /dev entries driver
cpuidle: using governor ladder
cpuidle: using governor menu
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
mmc0: mvsdio driver initialized, lacking card detect (fall back to polling)
Registered led device: plug:green:health
mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver
mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver
mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SDHC card at address d555
mmcblk0: mmc0:d555 SD04G 3.79 GiB
 mmcblk0: p1 p2 p3 < p5 >
mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )
mv_xor mv_xor.2: Marvell XOR: ( xor cpy )
mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
oprofile: using timer interrupt.
TCP cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
rtc-mv rtc-mv: setting system clock to 2010-02-17 21:06:40 UTC (1266440800)
Waiting 10sec before mounting root device...
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem) on device 179:1.
Freeing init memory: 140K
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
[<c00307e4>] (unwind_backtrace+0x0/0xdc) from [<c04033b8>] (panic+0x48/0x11c)
[<c04033b8>] (panic+0x48/0x11c) from [<c002b5f0>] (init_post+0xd4/0xfc)
[<c002b5f0>] (init_post+0xd4/0xfc) from [<c0008440>] (kernel_init+0xe0/0x110)
[<c0008440>] (kernel_init+0xe0/0x110) from [<c002c40c>] (kernel_thread_exit+0x0/0x8)

Any idea what went wrong?
Logged

mundhra
Newbie
*

Karma: 1
Posts: 36


View Profile
« Reply #8 on: February 17, 2010, 03:34:30 PM »

I followed the above steps and the result was the following:

Any idea what went wrong?

have you double-checked your uboot settings? can you post them?
from what i can see, you have an sd card with partitions on 1, 2, 5. i'm assuming 1 is /boot, 2 is /, and 5 is swap. did you make sure /boot was mounted when you ran the sheeva with linux README? did you rename the kernel in boot or leave it as it is?

i also found this, which could explain it http://osdir.com/ml/fedora-arm/2010-01/msg00005.html. i guess that issue would be resolved by just resetting the affected params.
Logged

diefrisur
Newbie
*

Karma: 0
Posts: 11


View Profile
« Reply #9 on: February 18, 2010, 04:37:47 AM »

I used the uboot settings described in one of the earlier posts, i.e.

setenv bootargs_console console=ttyS0,115200
setenv bootargs_root 'rw root=/dev/mmcblk0p1 rootdelay=10 rootfstype=ext2'
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x800000 /boot/uImage-2.6.30-sheevaplug'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_mmc; bootm 0x0800000'

but modified it slightly because I renamed the file to /boot/uImage. I tried both "/boot/uImage" and "/uImage" and I also tried both "0x800000" and "0x0800000" in the bootcmd_mmc because in the last line the address seems to be 0x0800000.

So currently my bootargs should be

setenv bootargs_console console=ttyS0,115200
setenv bootargs_root 'rw root=/dev/mmcblk0p1 rootdelay=10 rootfstype=ext2'
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x0800000 /boot/uImage'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_mmc; bootm 0x0800000'

Your guess re the partitions is correct and I had also thought that /boot was mounted before running the README. I can't doublecheck though because it's not booting anymore...

I'll probably try updating uboot from 3.4.19 to 3.4.27 next as per the link you attached.
Logged

mundhra
Newbie
*

Karma: 1
Posts: 36


View Profile
« Reply #10 on: February 18, 2010, 09:59:05 AM »

i've read that the unpatched uboot .27 potentially has issues that don't appear in .19. if /dev/mmcblk0p1 is your /boot, then the bootcmd_mmc should refer to /uImage. do you have a card reader to verify that a uImage exists on the sd's first partition?

ugh, i just figured out what's probably going on. i posted the section straight from the site i found, not what i modified to make it work for me. try this:

setenv bootargs_console console=ttyS0,115200
setenv bootargs_root 'rw root=/dev/mmcblk0p2 rootdelay=10 rootfstype=ext2'
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x0800000 /uImage'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_mmc; bootm 0x0800000'

the bootargs_root should refer to your /, which is mmcblk0p2. the bootcmd_mmc parameter is refering to /boot, which is mmcblk0p1, the first partition (0), hence the "mmc 0".

it that doesn't work, you can try this as a substitute:

setenv bootcmd_mmc 'mmcinit; ext2load mmc 1 0x0800000 /boot/uImage'

that line would be in the event that you did not have your first partition mounted as /boot, and the kernel got written to your root partition's /boot.
« Last Edit: February 18, 2010, 10:02:23 AM by mundhra » Logged

diefrisur
Newbie
*

Karma: 0
Posts: 11


View Profile
« Reply #11 on: February 19, 2010, 01:41:34 AM »

Ah, thanks for pointing that out. This makes sense in that I think the kernel is loaded before the error message pops up. I'll try and let you know if this caused the error. I whish I had more time to really get into things and understand the details. So it's mostly trial and error...   Sad 
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #12 on: February 19, 2010, 07:16:47 AM »

@diefrisur,

I think the problem you encounter is because you are using wrong root device.
Quote
rtc-mv rtc-mv: setting system clock to 2010-02-17 21:06:40 UTC (1266440800)
Waiting 10sec before mounting root device...
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem) on device 179:1.
Freeing init memory: 140K
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
[<c00307e4>] (unwind_backtrace+0x0/0xdc) from [<c04033b8>] (panic+0x48/0x11c)

In the message
Quote
VFS: Mounted root (ext2 filesystem) on device 179:1
device 179 refer to MMC device and 1 refer to first partition, see /usr/src/linux/Documentation/devices.txt for detail.
And In the message
Quote
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
unable to open an initial console usually because in the specified root=/dev/... root file system does not have /dev/console device node. And No init found mean that root file system does not have /sbin/init.

Hope this diagnosis problem help.
Logged

Good Luck Smiley

diefrisur
Newbie
*

Karma: 0
Posts: 11


View Profile
« Reply #13 on: February 20, 2010, 05:53:25 AM »

Thanks very much. It now works and I have the latest kernel running. I also changed the address from 0x0800000 to 0x08000000.
Logged

Pages: [1]
Print
Jump to: