Welcome! Log In Create A New Profile

Advanced

Rescue system not working after upgrading kernel

Posted by jst818 
Rescue system not working after upgrading kernel
January 14, 2017 10:25AM
Having troubles reaching pogo via ssh (putty) booting usb hdd after running "apt-get dist-upgrade" as last command.
Kernel is linux-4.9.0-kirkwood-tld-1 with DTB file (4a option) -> upgraded from linux-4.8.3-kirkwood-tld-1 .

Putty says: network error, connection timed out,
but i can ping pogo, response time is 1 ms.

netconsole on win7 output shows it runs fine through initram&boot image:

Quote

U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:23:43 -0700)
Pogo E02
gcc (Debian 4.9.2-10) 4.9.2
GNU ld (GNU Binutils for Debian) 2.25
Hit any key to stop autoboot: 0
starting USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
scanning usb for storage devices...
Use USB retry period from the environment: 15 second(s)
1 Storage Device(s) found
Unknown command 'ide' - try 'help'
Unknown command 'mmc' - try 'help'

Partition Map for USB device 0 -- Partition Type: DOS

Part Start Sector Num Sectors UUID Type
1 2048 20971520 000d7189-01 83 Boot
2 20973568 1932550144 000d7189-02 07
loading envs from usb 0 ...
** File not found /boot/uEnv.txt **
Unknown command 'ide' - try 'help'
Unknown command 'mmc' - try 'help'
running scan_disk ...
Scan device usb
device usb 0:1
1 bytes read in 140 ms (0 Bytes/s)
Found bootable drive on usb 0
3260992 bytes read in 274 ms (11.3 MiB/s)
7726417 bytes read in 368 ms (20 MiB/s)
10466 bytes read in 735 ms (13.7 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
Image Name: Linux-4.9.0-kirkwood-tld-1
Created: 2017-01-14 14:19:36 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3260928 Bytes = 3.1 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
Image Name: initramfs-4.9.0-kirkwood-tld-1
Created: 2017-01-14 14:19:41 UTC
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 7726353 Bytes = 7.4 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
Booting using the fdt blob at 0x1c00000


Starting kernel ...






Booting without usb hdd
netconsole on win7 output:
Don´t know why Rescue V2.8.2 http://forum.doozan.com/read.php?4,7915 won´t kick in, i got it installed, tested about 2 month ago and it was working (ie booting into rescue without hdd attached).
nc -l -u -p 6666


Quote

U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:23:43 -0700)
Pogo E02
gcc (Debian 4.9.2-10) 4.9.2
GNU ld (GNU Binutils for Debian) 2.25
Hit any key to stop autoboot: 0
starting USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Unknown command 'ide' - try 'help'
Unknown command 'mmc' - try 'help'

no USB devices available
Unknown command 'ide' - try 'help'
Unknown command 'mmc' - try 'help'
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide
Unknown command 'ide' - try 'help'
device ide 0:1
** Bad device ide 0 **
device ide 1:1
** Bad device ide 1 **
device ide 2:1
** Bad device ide 2 **
device ide 3:1
** Bad device ide 3 **
Scan device mmc
Unknown command 'mmc' - try 'help'
device mmc 0:1
** Bad device mmc 0 **
device mmc 1:1
** Bad device mmc 1 **
device mmc 2:1
** Bad device mmc 2 **
device mmc 3:1
** Bad device mmc 3 **
** Bad device usb 0 **
** Bad device usb 0 **
** Bad device usb 0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!



printenv output:
Quote

PogoE02> printenv
printenv
arcNumber=3542
bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $loa
d_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
device=0:1
devices=usb ide mmc
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-pogo_e02.dtb
ethact=egiga0
ethaddr=XX:XX:XX:XX:XX:XX //nic adress is ok
if_netconsole=ping $serverip
init_ide=ide reset
init_mmc=mmc rescan
init_usb=usb start
ipaddr=192.168.1.100
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=ext2load usb 0:1 0x1c00000 /boot/dts/kirkwood-pogo_e02.dtb
load_dtb_addr=0x1c00000
load_initrd=ext2load usb 0:1 0x1100000 /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=ext2load usb 0:1 0x800000 /boot/uImage
load_uimage_addr=0x800000
machid=dd6
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
ncip=192.168.1.2
partition=nand0,2
preboot=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_ide "ide reset"; setenv scan_mmc "mmc rescan"; for dev i
n $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo devi
ce $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv dev
ice $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
scan_ide=ide reset
scan_mmc=mmc rescan
scan_usb=usb start
serverip=192.168.1.2
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=nc
stdin=nc
stdout=nc
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=setenv init_usb "usb start"; setenv init_ide "ide reset"; setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devt
ype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in 0; do run uenv_read_disk; done; done;
uenv_loaded=0
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read; fi; else if $devtype part $disknum; then run uenv_read; fi; fi
usb_boot=run load_dtb; run load_uimage; if run load_initrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi
usb_ready_retry=15

Environment size: 3171/131068 bytes
PogoE02>



Edited 3 time(s). Last edit at 01/15/2017 03:36AM by bodhi.
Rescue system not working after upgrading kernel
January 14, 2017 11:29AM
Nevermind, found a copy of rootfs which is working ok.
I guess i should avoid "apt-get dist-upgrade".

As for not working rescue system, ima pretty sure one (or more) of this made it, because i entered it while upgrading to 4.9.0.
Quote

fw_setenv load_dtb 'ext2load usb 0:1 0x1c00000 /boot/dts/kirkwood-pogo_e02.dtb'
fw_setenv load_initrd 'ext2load usb 0:1 0x1100000 /boot/uInitrd'
fw_setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
fw_setenv usb_boot 'run load_dtb; run load_uimage; if run load_initrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi'



Edited 3 time(s). Last edit at 01/15/2017 03:35AM by bodhi.
Re: Rescue system not working after upgrading kernel
January 15, 2017 03:43AM
jst818,

You don't have any rescue system envs in your listing. You must have forgotten to add them back after installing the new u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Rescue system not working after upgrading kernel
January 16, 2017 06:33AM
So i should perform "B. Flashing default u-boot envs image" procedure once again ?



Edited 1 time(s). Last edit at 01/16/2017 07:30AM by jst818.
Re: Rescue system not working after upgrading kernel
January 16, 2017 06:42AM
http://forum.doozan.com/read.php?3,12381,page=1
B. Flashing default u-boot envs image
d.

Quote

root@pogo:/tmp# /usr/sbin/flash_erase /dev/mtd0 0xc0000 1
Erasing 128 Kibyte @ 7f640f5c00000064 -- 7 % complete

Not what should be:
Quote

Expected output:
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0xc0000 done

Quote

root@pogo:/tmp# /usr/sbin/nandwrite -s 786432 /dev/mtd0 uboot.2016.05-tld-1.environment.img
Writing data to block 6 at offset 0xc0000

Here is latest fw_printenv
Quote

root@pogo:/tmp# fw_printenv
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
device=0:1
devices=usb ide mmc
disks=0 1 2 3
ethact=egiga0
if_netconsole=ping $serverip
led_error=orange blinking
led_exit=green off
led_init=green blinking
dtb_file=/boot/dts/kirkwood-pogo_e02.dtb
load_dtb_addr=0x1c00000
load_initrd_addr=0x1100000
load_uimage_addr=0x800000
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
mainlineLinux=yes
mtdids=nand0=orion_nand
partition=nand0,2
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_ide "ide reset"; setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=setenv init_usb "usb start"; setenv init_ide "ide reset"; setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in 0; do run uenv_read_disk; done; done;
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read; fi; else if $devtype part $disknum; then run uenv_read; fi; fi
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
usb_ready_retry=15
preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi
preboot=run preboot_nc
serverip=192.168.1.2
ipaddr=192.168.1.100
arcNumber=3542
machid=dd6
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
ethaddr=XX:XX:XX:XX:XX:XX //nic adress is ok

Quote

root@pogo:/tmp# cat /etc/fw_env.config
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000

Quote

root@pogo:/tmp# cat /proc/mtd
dev: size erasesize name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 02000000 00020000 "rootfs"
mtd3: 05b00000 00020000 "data"

Quote

root@pogo:/tmp# dmesg | grep -i 'bad'
[ 5.804078] Scanning device for bad blocks
[ 5.903564] Bad eraseblock 892 at 0x000006f80000
[ 5.914994] Bad eraseblock 956 at 0x000007780000

0x000006f80000 is 116.916.224 (dec)
0x000007780000 is 125.304.832 (dec)

These are all steps i had done today (didnt do steps from A. Flashing Instruction: 1- 8, esp steps 6-7) .


Good to reboot ?



Edited 4 time(s). Last edit at 01/16/2017 07:32AM by jst818.
Re: Rescue system not working after upgrading kernel
January 16, 2017 07:41AM
Do i need to add those envs too ?
http://forum.doozan.com/read.php?4,7915

Quote

fw_setenv set_bootargs_rescue 'setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts'
fw_setenv bootcmd_rescue 'run set_bootargs_rescue; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000'
fw_setenv bootcmd_pogo 'run bootcmd_rescue'
fw_setenv rescue_installed 1



Edited 2 time(s). Last edit at 01/16/2017 07:42AM by jst818.
Re: Rescue system not working after upgrading kernel
January 16, 2017 02:02PM
jst818 Wrote:
-------------------------------------------------------
> Do i need to add those envs too ?
> http://forum.doozan.com/read.php?4,7915
>
>
Quote

> fw_setenv set_bootargs_rescue 'setenv bootargs
> console=$console ubi.mtd=2 root=ubi0:rootfs ro
> rootfstype=ubifs $mtdparts'
> fw_setenv bootcmd_rescue 'run set_bootargs_rescue;
> nand read.e 0x800000 0x100000 0x400000; bootm
> 0x800000'
> fw_setenv bootcmd_pogo 'run bootcmd_rescue'
> fw_setenv rescue_installed 1
>

Yes, you need them and also

fw_setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_rescue'

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: