Welcome! Log In Create A New Profile

Advanced

Boot stock firmware while no USB/IDE present for Pogoplug V3 OXNAS

Posted by rynax 
Boot stock firmware while no USB/IDE present for Pogoplug V3 OXNAS
August 31, 2016 10:00PM
Hi,

I tried to modify the Uboot env settings to try to boot from USB or IDE first,
if both are not present, then boot from the internal flash/stock firmware.
bootcmd=run bootcmd_uenv; run dt_bootcmd_usb; run bootcmd_stock; reset


the complete system configration:

Stock Pogoplug OS:

 U-Boot (1.1.2 Jul 29 2010)

cat /proc/mtd0

mtd0: 08000000 00020000 "NAND 128MiB 3,3V 8-bit"
mtd1: 00e00000 00020000 "boot"
mtd2: 07200000 00020000 "rootfs

U-boot 2013.10 install per instructions here
http://forum.doozan.com/read.php?3,16017,page=1

The new Uboot env settings:
root@debian:/# fw_printenv
autoload=no
baudrate=115200
bootargs=console=ttyS0,115200n8
bootdelay=10
console=console=ttyS0,115200n8
ethact=mii0
mtdids=nand0=41000000.nand
mtdparts=mtdparts=41000000.nand:14m(boot),-(data)
stderr=serial
stdin=serial
stdout=serial
usb_device=0:1
if_netconsole=ping $serverip
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version
uinitrd_addr=0x60e00000
uimage_addr=0x60500000
dtb_addr=0x62c00000
dt_load_initrd=ext2load usb 0:1 $uinitrd_addr /boot/uInitrd
dt_load_uimage=ext2load usb 0:1 $uimage_addr /boot/uImage
dt_bootm=bootm $uimage_addr $uinitrd_addr $dtb_addr
dt_usb_boot=run dt_load_uimage; run dt_load_initrd; run dt_load_dtb; run dt_bootm
dt_usb_bootcmd=run usb_set_bootargs; run dt_usb_boot
dt_bootcmd_usb=usb start; run dt_usb_bootcmd; usb stop; reset
ipaddr=192.168.1.3
serverip=192.168.1.10
ethaddr=00:25:XX:XX:XX:XX
devices=usb ide
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
uenv_import=echo importing envs ...; env import -t 0x60500000
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 0x60500000 /boot/uEnv.txt; then setenv uenv_loaded 1; fi
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;
dt_load_dtb=ext2load usb 0:1 $dtb_addr /boot/dts/ox820-pogoplug-classic.dtb
rootfstype=ext3
usb_set_bootargs=setenv bootargs console=ttyS0,115200 root=/dev/sda1 rootfstype=$rootfstype rootdelay=10
bootcmd=run bootcmd_uenv; run dt_bootcmd_usb; run bootcmd_stock; reset
bootcmd_stock=setenv autoload n; setenv bootargs_stock "root=ubi0:rootfs ubi.mtd=2,512 rootfstype=ubifs console=ttyS0,115200 elevator=cfq mac_adr=0x00,0x25,0x31,0x02,0x5E,0x91 mem=128M"; setenv poweroutage yes; setenv boot "bootm 60500000"; setenv bootcmd_stock_fw "run set_bootargs_stock; run boot_nand"; setenv boot bootm 60500000; setenv boot_nand "run load_nand boot || run load_nand2 boot"; setenv kernflmode s; setenv load_nand2 "nboot 60500000 0 800000"; setenv load_nand "nboot 60500000 0 200000"; setenv set_bootargs_stock "setenv bootargs $bootargs_stock"; setenv mainlinelinux no; run bootcmd_stock_fw
preboot=run preboot_nc
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


rootfs:Debian-3.17.0-oxnas-tld-1-rootfs-bodhi.tar.bz2 (02 Nov 2014)

however while no usb/ide present, it will try to reboot instead of boot the internal stock firmware:

U-Boot 2013.10-tld-4 (Sep 08 2014 - 19:43:38) for OXNAS
gcc (Debian 4.6.3-14) 4.6.3
GNU ld (GNU Binutils for Debian) 2.22
Hit any key to stop autoboot:  0
(Re)start 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

Reset IDE: SATA PHY not ready for device 0
ide_preinit failed

no USB devices available

no IDE devices available
(Re)start 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
** Bad device usb 0 **
** Bad device usb 0 **
** Bad device usb 0 **
Wrong Image Format for bootm command

Led:    ORANGE (Failed)
ERROR: can't get kernel image!
stopping USB..
resetting ...

I can stop the booting process and have it boot to stock firmware via running
run bootcmd_stock

what should I change here to have it auto boot the stock firmware if no usb/ide present?

Thanks in adavance



Edited 2 time(s). Last edit at 08/31/2016 10:01PM by rynax.
Re: Boot stock firmware while no USB/IDE present for Pogoplug V3 OXNAS
September 01, 2016 12:10AM
Try this:

Stop the booting process in serial console or netconsole:

setenv bootcmd 'run bootcmd_uenv; if run dt_bootcmd_usb; then echo "booting Debian..."; else echo "booting stock..."; run bootcmd_stock; fi;  reset'
boot

If this works, boot with USB or HDD into Debian, and set it for real:

fw_setenv bootcmd 'run bootcmd_uenv; if run dt_bootcmd_usb; then echo "booting Debian..."; else echo "booting stock..."; run bootcmd_stock; fi;  reset'

Please post back if this works for you (I'll modify the instruction to make it more robust).

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



Edited 2 time(s). Last edit at 09/01/2016 12:31AM by bodhi.
Re: Boot stock firmware while no USB/IDE present for Pogoplug V3 OXNAS
September 01, 2016 12:52AM
rynax Wrote:
-------------------------------------------------------
> Hi,
>
> I tried to modify the Uboot env settings to try to
> boot from USB or IDE first,
> if both are not present, then boot from the
> internal flash/stock firmware.
>
> bootcmd=run bootcmd_uenv; run dt_bootcmd_usb; run
> bootcmd_stock; reset
>
>
>
> the complete system configration:
>
<SNIP>
> The new Uboot env settings:
> root@debian:/# fw_printenv
> dt_usb_boot
> dt_bootcmd_usb=usb start; run dt_usb_bootcmd; usb stop; reset
> ipaddr=192.168.1.3
>
> however while no usb/ide present, it will try to
> reboot instead of boot the internal stock
> firmware:
>

Remove the reset command from the end of your dt_bootcmd_usb and it should proceed to run the bootcmd_stock.

Ray
Re: Boot stock firmware while no USB/IDE present for Pogoplug V3 OXNAS
September 01, 2016 01:40AM
> Remove the reset command from the end of your
> dt_bootcmd_usb and it should proceed to run the
> bootcmd_stock.
>
> Ray

Right! there should be only one reset at the end of bootcmd.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Boot stock firmware while no USB/IDE present for Pogoplug V3 OXNAS
September 01, 2016 02:28AM
rayknight Wrote:
-------------------------------------------------------
> rynax Wrote:
> --------------------------------------------------
> -----
> > Hi,
> >
> > I tried to modify the Uboot env settings to try
> to
> > boot from USB or IDE first,
> > if both are not present, then boot from the
> > internal flash/stock firmware.
> >
> > bootcmd=run bootcmd_uenv; run dt_bootcmd_usb;
> run
> > bootcmd_stock; reset
> >
> >
> >
> > the complete system configration:
> >
> <SNIP>
> > The new Uboot env settings:
> > root@debian:/# fw_printenv
> > dt_usb_boot
> > dt_bootcmd_usb=usb start; run dt_usb_bootcmd;
> usb stop; reset
> > ipaddr=192.168.1.3
> >
> > however while no usb/ide present, it will try
> to
> > reboot instead of boot the internal stock
> > firmware:
> >
>
> Remove the reset command from the end of your
> dt_bootcmd_usb and it should proceed to run the
> bootcmd_stock.
>
> Ray

Got it!

Thanks Ray and Bodhi

Originally I copied the booting process settings from this forum, that instruction's booting process ended at trying the usb/ide then do reboot.

I added the 'bootcmd_stock' back but forgot to remove the reset command before this which is in 'dt_bootcmd_usb';



Edited 1 time(s). Last edit at 09/01/2016 02:31AM by rynax.
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: