Welcome! Log In Create A New Profile

Advanced

Flashing from stock - question on process

Posted by Biohead 
Flashing from stock - question on process
March 12, 2022 04:14AM
Wow, it's been some time since I have frequented here. It also looks to have changed an awful lot since the days I really got involved!

I have dug out a Pogo V4. It looks to be in stock form, with the exception of it running optware. I'd previously enabled SSH, but couldn't remember the password - some playing around in the url command interface got me back in using passwd and deleting the existing shadow file. But, i'm in! From what I remember, the stock OS is fairly restrictive - so most of the files/tools have been copied over via USB as the built in wget is struggling with the SSL of modern sites.
Out of my E02, GoFlexNet and V4 - the V4 is the one that remained stock.

I've got almost all the way through the instructions, but I'm not sure what I need to enter for step e2 - set the mtdparts with setenv.
e.2 Box specific envs:

Then for all boxes, restore these 2 envs using the saved envs text in step c (replace xxx with the real saved values)
fw_setenv mtdparts 'xxxxxxxxx'
fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx

This was my mtd output when checking it earlier:
[root@Pogoplug /opt]# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00200000 00020000 "u-boot"
mtd1: 00300000 00020000 "uImage"
mtd2: 00300000 00020000 "uImage2"
mtd3: 00800000 00020000 "failsafe"
mtd4: 07000000 00020000 "root"

And this is what was created in the current_envs text file earlier in the process:
bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=5
baudrate=115200
Which I think isn't useful as it's from a stock uboot, so I don't know what to enter for e2, nor what format to enter it in.
I've not progressed any further on the instructions yet as I thought it better to check.



The end goal is for me to get debian on the SD card (just started looking at that, I do have a few questions), and possibly put a recovery system on NAND - I have no use for the stock OS anymore. I've left the device powered up just incase.

For interest, here is the output of print_env:
arcNumber=2097
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
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
machid=0x831
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
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
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
ethaddr=00:25:31:xx:xx:xx
serverip=10.11.10.15
ipaddr=10.11.10.248
if_netconsole=ping $serverip
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
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



Edited 1 time(s). Last edit at 03/12/2022 04:15AM by Biohead.
Re: Flashing from stock - question on process
March 12, 2022 03:46PM
Biohead,

> e.2 Box specific envs:
>
> Then for all boxes, restore these 2 envs using the
> saved envs text in step c (replace xxx with the
> real saved values)
> fw_setenv mtdparts 'xxxxxxxxx'
> fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx
> [/code]

If you have kept a boot log for this box somewhere these info are in that log.

fw_setenv mtdparts 'mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)'

For ethaddr the MAC address xx:xx:xx:xx:xx:xx can be found on the box case label. Looks like you already have it set? are the x's in 00:25:31:xx:xx:xx just to blank it out for privacy?

ethaddr=00:25:31:xx:xx:xx

======

Note that mtdparts is really not important for booting. It can be adjust after booted.

The MAC address (ethaddr) should be set to the correct MAC so to avoid problem with the router assigning IP. Since you only have netconsole, that is also important. If you have serial console, then you don't need to use netconsole.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Flashing from stock - question on process
March 13, 2022 04:59AM
Unfortunately I have no stock bootlog to go through, the only info I have is from this in the stock OS:
[root@Pogoplug /opt]# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00200000 00020000 "u-boot"
mtd1: 00300000 00020000 "uImage"
mtd2: 00300000 00020000 "uImage2"
mtd3: 00800000 00020000 "failsafe"
mtd4: 07000000 00020000 "root"

I guess using that info, I could assume:
fw_setenv mtdparts 'mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),70M(root)'
Although, as I'm going to load from SD - does it serve a useful purpose if I don't do anything further with the NAND (ignoring rescue system potential)?


I have already set the ethaddr (you correctly assumed the last part blanked out).
I have rebooted now and confirm its boots the new uboot fine as well as with successful netconsole access (doesn't load stock OS, just defaults to prompt, but not an issue).
A quick change to the dtb_file (as well as machid and arcNumber for nostalgia) and now I'm looking at the rootfs.


As cool as Raspberry Pi's have been, there's something to be said about the V4s form factor with SATA for me - I couldn't resist digging it back out!
Re: Flashing from stock - question on process
March 13, 2022 04:20PM
Biohead,

> I guess using that info, I could assume:
>
> fw_setenv mtdparts
> 'mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),70M(root)'
>

No, it is
fw_setenv mtdparts 'mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)'

But we only care about mtd0, the other mtds don't matter since you don't use stock OS.


> Although, as I'm going to load from SD - does it
> serve a useful purpose if I don't do anything
> further with the NAND (ignoring rescue system
> potential)?

Netconsole can be a rescue console aready. In the future, you can install rescue system on NAND. And that will repartition the rest of NAND space after mtd0.

> As cool as Raspberry Pi's have been, there's
> something to be said about the V4s form factor
> with SATA for me - I couldn't resist digging it
> back out!

It's a very nice little box. The best form factor among all the plugs of its time!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Flashing from stock - question on process
March 16, 2022 09:03AM
Whilst I remember (and unrelated to the initial question) - these are the commands I followed to reset the SSH password I'd set all those years ago and then completely forgot what it was. Saved me having to dig out a serial cable (and possibly soldering required).

I've just followed these instructions on a spare GoFlex Net still running Pogo OS.
I used a variant on my V4 where I deleted the shadow file - however that only works if the filesystem is already in RW. By default, PogoOS should be set to RO, so this should be a better option.

This is ONLY for stock PogoOS scenarios.

These commands were all run using the web interface found at https://root:ceadmin@IP-OF-POGOPLUG/sqdiag/HBPlug?action=command
mount -o remount,rw /dev/root /
echo "root:ceadmin" | chpasswd
sync
reboot
This will reset the SSH password for user root to ceadmin
Step 1 mounts the filesystem to RW
Step 2 changes the password in one command by piping the data in
Steps 3 and 4 just keep it clean.
Author:

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: