Pogo E02 Not Starting Without USB

This forum is for topics dealing with problems with software specifically in the ARMv5 repo.

Pogo E02 Not Starting Without USB

Postby dilenjoy » Tue Jul 29, 2014 7:29 pm

Hello all,

I had to re-install the armv5 on my pogo E02 and followed the directions at: http://archlinuxarm.org/platforms/armv5 ... 2-pinkgray. Previously (I used some other directions), when I removed the USB with armv5, I was able to log into default pogoplug OS but not anymore when using these instructions. I'm not very familiar with flashing/u-boot but I believe that ./pogo_e02.sh script modified it such that I can't I can't get back to default pogoplug OS. I went through forums trying to enable default pogoplug by mounting the pogoplug mount but it failed. Following the post at, viewtopic.php?f=53&t=1460, I tried:

[root@alarm ~]# mkdir /tmp/pogoroot
[root@alarm ~]# mount -t jffs2 /dev/mtdblock2 /tmp/pogoroot
mount: special device /dev/mtdblock2 does not exist

Another post got me through this error but then I got:
mount: unknown filesystem type 'jffs2'

Please help how I"d be able to get the pogoplug default OS. Main reason for having the access to the default OS is that if I crash the USB someday I'd have access to the default OS so that I can rebuild armv5. I have another pogoplug so if I need to pull down anything from the other pogoplug and copy in this one I should be able to do.

Thank you,
Dan
dilenjoy
 
Posts: 8
Joined: Tue Jul 29, 2014 6:56 pm

Re: Pogo E02 Not Starting Without USB

Postby WarheadsSE » Tue Jul 29, 2014 8:33 pm

Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6724
Joined: Mon Oct 18, 2010 2:12 pm

Re: Pogo E02 Not Starting Without USB

Postby dilenjoy » Tue Jul 29, 2014 8:47 pm

Thanks WarheadsSE. Would it not be possible to get back to pogoplug default OS though?
dilenjoy
 
Posts: 8
Joined: Tue Jul 29, 2014 6:56 pm

Re: Pogo E02 Not Starting Without USB

Postby hydro » Wed Jul 30, 2014 1:21 pm

To mount the jffs2 filesystem you first have to load the module mtdblock. Directions in the mentioned thread won't help you boot to Pogo OS, but if you updated from an older installation you may find a backup of the original bootloader on mtd2:
Code: Select all
modprobe mtdblock
mount -t jffs2 /dev/mtdblock2 /mnt/
ls -l /mnt/uboot-original-mtd0.kwb

If the file is not present you can get it this way
Code: Select all
wget -O /mnt/uboot-original-mtd0.kwb http://download.doozan.com/uboot/files/uboot/uboot.mtd0.pinkpogo.original.kwb

On the U-Boot prompt (via serial console or netconsole) you can load and execute that bootloader which in turn will boot Pogo OS.

Edit: I just learned that mainline U-Boot is missing the fsload command, so this won't work.

Code: Select all
u-boot>> fsload uboot-original-mtd0.kwb
fsload uboot-original-mtd0.kwb
### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000
Scanning JFFS2 FS: ........ done.
### JFFS2 load complete: 524288 bytes loaded to 0x800000
u-boot>> go 0x800200
go 0x800200
## Starting application at 0x00800200 ...

If you cannot access U-Boot directly you have to permanently modify the environment in some way. In mainline U-Boot (which was installed when you unnecessarily executed pogo_e02.sh) a file /boot/uEnv.txt should be used for that purpose, but obviously you cannot use this approach to achieve that Pogo OS is always started when USB is absent. Instead you will have to change U-Boot's environment on mtd0: Install the package uboot-tools, remove the hash at the beginning of the following line in /etc/fw_env.config
Code: Select all
# /dev/mtd0               0xc0000         0x20000         0x20000

and then change U-Boot's bootcmd (use copy-paste):
Code: Select all
fw_setenv bootcmd 'usb start; setenv letter 9;for type in usb; do for disk in 0 1 2 3; do if ${type} part ${disk};then setexpr letter $letter + 1;run load;fi;done;done;if fsload uboot-original-mtd0.kwb; then go 0x800200; fi'

Do this at your own risk, I have not tested it on a Pogo E02, because I don't use mainline U-Boot on it. But if it does not work it shouldn't harm: I tested it on the GoFlex Home with mainline U-Boot and it still boots to SATA (compared to the Pogo there are some extra commands regarding ide)
Code: Select all
GoFlexHome> setenv bootcmd 'ide reset; usb start; setenv letter 9;for type in ide usb; do for disk in 0; do if ${type} part ${disk};then setexpr letter $letter + 1;run load;fi;done;done;if fsload uboot-original-mtd0.kwb; then go 0x800200; fi'
setenv bootcmd 'ide reset; usb start; setenv letter 9;for type in ide usb; do for disk in 0; do if ${type} part ${disk};then setexpr letter $letter + 1;run load;fi;done;done;if fsload uboot-original-mtd0.kwb; then go 0x800200; fi'
GoFlexHome> boot
boot

Reset IDE: Bus 0: OK Bus 1: not available 
  Device 0: Model: ST31000528AS Firm: CC3E Ser#: 6VP4TDBD
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Partition Map for IDE device 0  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00000800      0x028007ff      "Linux filesystem"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   8e9c64c0-c11c-40c0-b823-3c47bdbdcb69
  2     0x02800800      0x74706d8e      "Linux filesystem"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   40a7fa17-6deb-47a9-ae72-27b359be70a5
Attempting to boot from ide 0:1...
89 bytes read in 64 ms (1000 Bytes/s)
Importing environment (uEnv.txt)...
Checking if uenvcmd is set ...
Running default loadzimage ...
** File not found /boot/zImage **
Running default loaduimage ...
3977208 bytes read in 789 ms (4.8 MiB/s)
Booting from 0 ...
## Booting kernel from Legacy Image at 00810000 ...
   Image Name:   Linux-3.15.6-1-ARCH
   Created:      2014-07-18  20:10:56 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3977144 Bytes = 3.8 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK

Btw. on the GoFlex Home the fsload command would't work, because ubifs is used instead of jffs2, see my HowTo for more details. Another approach is to load the original bootloader from a TFTP server.
Code: Select all
GoFlexHome> tftpboot 0x800000 192.168.2.1:uboot.mtd0.dockstar.original.kwb
tftpboot 0x800000 192.168.2.1:uboot.mtd0.dockstar.original.kwb
Using egiga0 device
TFTP from server 192.168.2.1; our IP address is 192.168.2.250
Filename 'uboot.mtd0.dockstar.original.kwb'.
Load address: 0x800000
Loading: ####################################
         3.1 MiB/s
done
Bytes transferred = 524288 (80000 hex)
GoFlexHome> go 0x800200
go 0x800200
## Starting application at 0x00800200 ...

I wonder if it is possible to boot stock OS without chainloading the original bootloader.
Last edited by hydro on Tue Aug 05, 2014 5:45 pm, edited 3 times in total.
VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany

Re: Pogo E02 Not Starting Without USB

Postby grayman4hire » Wed Jul 30, 2014 4:32 pm

Wow. Excellent post @hydro. I was looking into how to boot the Pogoplug OS on the Pogoplug V4 using the mainline uBoot - viewtopic.php?f=23&t=7560.

I wonder the same thing, is it possible to boot the Pogoplug OS directly without chainloading the original bootloader? My guess is yes, but not sure about the env parameters. When chainloading the original bootloader it uses the blparam parameters making it seamless.

OP, another solution you may want to look into is using Jeff's or Davy's Rescue System:
http://forum.doozan.com/read.php?4,7915
http://forum.doozan.com/read.php?4,3896
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA

Re: Pogo E02 Not Starting Without USB

Postby dilenjoy » Sun Aug 03, 2014 4:58 pm

Hi @hydro,

Thanks for the information. I'm not very familiar with how the OS loads i.e. what NAND is, how nandump, fwenv and uboot work together (more of a programmer background than sys admin) but I followed your instructions and couldn't get it to run successfully. I got Jeff's uboot-original-mtd0.kwb on /mnt but I was not able to get to the u-boot prompt. I guess the fsload command would instruct the OS to look at the /mnt for pogoplug OS. My /etc/fw_env.config is as you had specified and I went ahead and ran the fw_setenv command to point to uboot-original-mtd0.kwb in absence of USBs.

fw_env.config contains:
<code>
[root@alarm ~]# cat /etc/fw_env.config
/dev/mtd0 0xc0000 0x20000 0x20000
</code>

I was able to download uboot-utils using pacman -S uboot-utils at: /var/lib/pacman/local/uboot-tools-2014.04-1/

there is no file like fsload or u-boot
<code>
[root@alarm ~]# find / -name fsload
[root@alarm ~]# find / -name "*u*boot*"
</code>

I think the missing piece is to get fsload to load the original-mtd0 to some area (NAND?) Could you please tell me how to get that working? Also, if you could give a brief intro into what these commands are doing that'd be great. I couldn't find an online resource on "how does pogoplug OS load". I'm still able to boot using USB but not without.

Appreciate your help.

Thanks,
Dan
dilenjoy
 
Posts: 8
Joined: Tue Jul 29, 2014 6:56 pm

Re: Pogo E02 Not Starting Without USB

Postby hydro » Sun Aug 03, 2014 5:35 pm

You cannot get to the U-boot prompt while running Arch Linux. Only if you have a serial connection or enable netconsole then you can access Pogoplug's U-Boot prompt from another computer. Netconsole currently requires a recompilation of U-Boot.

The good news is that you do not need to get to the U-boot prompt, it's good for testing and rescue purposes, but in general U-Boot settings are stored on the NAND. On the U-Boot prompt you would use setenv to make changes and saveenv to save them permanently. On Arch Linux ARM's console fw_setenv does the same thing. setenv, saveenv and also fsload are U-Boot specific commands, on a Linux console they don't exist or have a different purpuse.

So if you have run the specified fw_setenv command, then shutdown your Pogoplug with systemctl poweroff, remove the USB drive, power on/off and it should boot to Pogoplug OS.
VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany

Re: Pogo E02 Not Starting Without USB

Postby dilenjoy » Sun Aug 03, 2014 6:14 pm

Thanks. I tried systemctl poweroff but still wasn't able to boot to pogoplug. I think the problem is that I'm not able to run the mount command. Commands:

[root@alarm ~]# modprobe mtdblock
[root@alarm ~]# mount -t jffs2 /dev/mtdblock2 /mnt/
mount: special device /dev/mtdblock2 does not exist

mtdblock0 and mtdblock1 exists but not mtdblock2.
[root@alarm ~]# lt /dev/mtd0 /dev/mtdblock0 /dev/mtd1 /dev/mtdblock1
crw------- 1 root root 90, 0 Dec 31 1969 /dev/mtd0
crw------- 1 root root 90, 2 Dec 31 1969 /dev/mtd1
brw-rw---- 1 root disk 31, 0 Aug 3 11:57 /dev/mtdblock0
brw-rw---- 1 root disk 31, 1 Aug 3 11:57 /dev/mtdblock1

I do have uboot-original-mtd0.kwb in /mnt/ directory:
[root@alarm ~]# lt /mnt/uboot-original-mtd0.kwb
-rw-r--r-- 1 root root 524288 Aug 2 16:43 /mnt/uboot-original-mtd0.kwb

In past I have also seen "mount: unknown filesystem type 'jffs2'".

Thank you
dilenjoy
 
Posts: 8
Joined: Tue Jul 29, 2014 6:56 pm

Re: Pogo E02 Not Starting Without USB

Postby hydro » Sun Aug 03, 2014 6:39 pm

Oh, that's another problem with the default U-Boot settings I forgot to take into account, sorry. Please follow grayman4hire's instructions in the following thread
viewtopic.php?f=53&t=7573
After that, reboot and try again to mount /dev/mtdblock2 on /mnt. It must be mounted before uboot-original-mtd0.kwb is placed on /mnt, otherwise that file is saved on your USB device instead of the NAND (where U-Boot will try to chainload it from using fsload).
VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany

Re: Pogo E02 Not Starting Without USB

Postby dilenjoy » Tue Aug 05, 2014 11:13 pm

Hi @hydro,

Thanks for pointing to the post. I was able to get back mtdblock2. However, it is still not booting up to PogoPlug OS when I reboot. Perhaps it is not able to read the original loader from /mnt?

/mnt/ directory has the following:

Code: Select all
[root@alarm ~]# lt /mnt
total 513
drwxr-xr-x 2 root root      0 Dec 31  1999 tmp
drwxr-xr-x 2 root root      0 Dec 31  1999 sys
drwxr-xr-x 2 root root      0 Feb 26  2008 proc
drwxr-xr-x 5 root root      0 Feb 26  2008 dev
drwxr-xr-x 2 root root      0 Dec 18  2008 mnt
lrwxrwxrwx 1 root root     11 Nov  3  2009 linuxrc -> bin/busybox
drwxr-xr-x 2 root root      0 Nov  3  2009 bin
lrwxrwxrwx 1 root root      8 Nov  3  2009 var -> /tmp/var
drwxr-xr-x 2 root root      0 Nov  3  2009 sbin
drwxr-xr-x 2 root root      0 Nov  3  2009 lib
drwxr-xr-x 7 root root      0 Apr  9  2012 usr
drwxr-xr-x 5 root root      0 May 18  2013 etc
drwxr-xr-x 2 root root      0 May 18  2013 root
-rw-r--r-- 1 root root 524288 Aug  5 17:07 uboot-original-mtd0.kwb



fw_env.config has the following:

Code: Select all
[root@alarm ~]# cat /etc/fw_env.config
/dev/mtd0               0xc0000         0x20000         0x20000



and fw_printenv prints the following (bootcmd has your command):

Code: Select all
[root@alarm ~]# fw_printenv
baudrate=115200
bootdelay=3
bootm=echo Booting from ${disk} ...; run setargs; bootm ${loadaddr};
bootz=echo Booting from ${disk} ...; run setargs; bootz ${loadaddr} - ${fdt_addr};
console=ttyS0
fdt_addr=0x800000
fdt_file=/boot/dtbs/kirkwood-pogo_e02.dtb
importbootenv=echo Importing environment (uEnv.txt)...; env import -t $loadaddr $filesize
load=echo Attempting to boot from ${type} ${disk}:1...;if run loadbootenv; then run importbootenv;fi;echo Checking if uenvcmd is set ...;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;echo Running default loadzimage ...;if run loadzimage; then run loadfdt;run bootz;fi;echo Running default loaduimage ...;if run loaduimage; then run bootm;fi;
loadaddr=0x810000
loadbootenv=load ${type} ${disk}:1 ${loadaddr} /boot/uEnv.txt
loadfdt=load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}
loaduimage=load ${type} ${disk}:1 ${loadaddr} ${uimage}
loadzimage=load ${type} ${disk}:1 ${loadaddr} ${zimage}
mtdids=nand0=orion_nand
setargs=setenv bootargs console=${console},${baudrate} ${optargs} root=/dev/sd${letter}1 rw rootwait ${mtdparts}
uimage=/boot/uImage
zimage=/boot/zImage
ethaddr=xx:xx:xx:xx:xx:xx
bootcmd=usb start; setenv letter 9;for type in usb; do for disk in 0 1 2 3; do if ${type} part ${disk};then setexpr letter $letter + 1;run load;fi;done;done;if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)


Is the below right statement in bootcmd?:

Code: Select all
if fsload uboot-original-mtd0.kwb; then go 0x800200; fi


Thanks for your help
Last edited by dilenjoy on Wed Aug 06, 2014 4:45 pm, edited 1 time in total.
dilenjoy
 
Posts: 8
Joined: Tue Jul 29, 2014 6:56 pm

Next

Return to ARMv5

Who is online

Users browsing this forum: No registered users and 1 guest