Pogoplug V4 - uBoot with Debian
April 16, 2017 11:02AM
Dear Friends,

I have successfully installed uBoot and Debian is running smoothly on my Seagate Dockstar. I used this url http://projects.doozan.com/uboot for uBoot flash.

Now i want to setup the uboot and Debian on my New Pogoplug Series 4. I have few queries before i proceed.

1.Uboot Script : Does this script http://projects.doozan.com/uboot will pick up the latest Uboot or should i need to use a different Url. Because bodhi has mentioned to use the latest uBoot package for a better Modern NAS support.

2.Does anyone has experience in using Debian on micro SD card with class 4 in Pogoplug V4. is that stable?

Thanks
Nirmal
Re: Pogoplug V4 - uBoot with Debian
April 16, 2017 03:24PM
Nirmal_Kumar,


Quote

1.Uboot Script : Does this script http://projects.doozan.com/uboot will pick up the latest Uboot

No, it will install Jeff/davygravy older u-boot.

Quote

should i need to use a different Url. Because bodhi has mentioned to use the latest uBoot package for a better Modern NAS support

Currently, the procedure to install new u-boot for Pogo V4 is a manual procedure:
http://forum.doozan.com/read.php?3,12381

Quote

2.Does anyone has experience in using Debian on micro SD card with class 4 in Pogoplug V4. is that stable?

It is stable. But you need a good SD card brand, such as Sandisk. And make sure to back up your rootfs often.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogoplug V4 - uBoot with Debian
April 20, 2017 12:05AM
Thanks Bodhi.

While flashing the UBoot in Pogo V4, i am getting an error in the SSH, can't fork. How to resolve this?
Re: Pogoplug V4 - uBoot with Debian
April 20, 2017 12:47AM
Nirmal_Kumar Wrote:
-------------------------------------------------------
> Thanks Bodhi.
>
> While flashing the UBoot in Pogo V4, i am getting
> an error in the SSH, can't fork. How to resolve th
> is?

I need to see the log of the teminal session to know what error you have encountered. Please post the log of how you flash u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogoplug V4 - uBoot with Debian
April 20, 2017 05:34AM
It looks like RAM got low in my Pogo due to some process running behind. I cannot even run basic commands like ls or cp.

Then i resolved by using killall commands smbd and other ftp services running on pogov4. I also faced segmentation fault when running fw_setenv. Then later i resolved it by using the fw_setenv tools from https://github.com/pepaslabs/pogoplug-v4-bodhi-rootfs-debian

Finally, i have installed uboot successfully.

Few Queries :
1.I used your latest instructions on UBoot and also used chainboot loader concept from another blog. It used a different mtdparts which has one additional value called "failsafe".Whats is this for?

2.Is there a way i can confirm my u-boot is installed in the right way. How do i verify this?

3.When i used dmesg it outputs a long list. <3>[36631.420000] uncorrectable error : Is this a known issue?


FYI
- I can able to login to SSH using the old username & password



Edited 1 time(s). Last edit at 04/20/2017 11:27AM by Nirmal_Kumar.
Re: Pogoplug V4 - uBoot with Debian
April 20, 2017 12:08PM
This is the output i got from Netconsole



U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:41:47 -0700)
Pogoplug V4
gcc (Debian 4.9.2-10) 4.9.2
GNU ld (GNU Binutils for Debian) 2.25
Hit any key to stop autoboot: 0
## Error: "bootcmd_mmc" not defined
## Error: "bootcmd_usb" not defined
## Error: "bootcmd_sata" not defined
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=4", size 112 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 896, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 18/8, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 0, total reserved PEBs: 896, PEBs reserved for bad PEB handling: 8
Loading file 'uboot.mtd0.dockstar.original.kwb' to addr 0x00800000...
Done
Re: Pogoplug V4 - uBoot with Debian
April 20, 2017 08:13PM
Nirmal_Kumar Wrote:
-------------------------------------------------------
> This is the output i got from Netconsole
>
>
>
> U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:41:47 -0700
> )
> Pogoplug V4
> gcc (Debian 4.9.2-10) 4.9.2
> GNU ld (GNU Binutils for Debian) 2.25
> Hit any key to stop autoboot: 0
> ## Error: "bootcmd_mmc" not defined
> ## Error: "bootcmd_usb" not defined
> ## Error: "bootcmd_sata" not defined
> ubi0: attaching mtd1
> ubi0: scanning is finished
> ubi0: attached mtd1 (name "mtd=4", size 112 MiB)
> ubi0: PEB size: 131072 bytes (128 KiB), LEB size:
> 126976 bytes
> ubi0: min./max. I/O unit sizes: 2048/2048, sub-pag
> e size 512
> ubi0: VID header offset: 2048 (aligned 2048), data
> offset: 4096
> ubi0: good PEBs: 896, bad PEBs: 0, corrupted PEBs:
> 0
> ubi0: user volume: 1, internal volumes: 1, max. vo
> lumes count: 128
> ubi0: max/mean erase counter: 18/8, WL threshold:
> 4096, image sequence number: 0
> ubi0: available PEBs: 0, total reserved PEBs: 896,
> PEBs reserved for bad PEB handling: 8
> Loading file 'uboot.mtd0.dockstar.original.kwb' to
> addr 0x00800000...
> Done

It looks like you did not flash the detault envs image in Step 8.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogoplug V4 - uBoot with Debian
April 20, 2017 08:57PM
Thanks Bodhi.

I flashed and i also verified the output mentioned in Step 8. Now the issue i am facing is the default Pogo OS in not detecting the SATA (top port) drive.

Here the output i got from ptintenv. Should i need to reflash the default env image again?

Pogov4> printenv
printenv
arcNumber=3960
bootcmd=run bootcmd_mmc; run bootcmd_usb; run bootcmd_sata; run bootcmd_pogo; reset
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_pogo=if ubi part root 2048 && ubifsmount ubi:rootfs && ubifsload 0x800000 uboot.mtd0.dockstar.original.kwb ; then go 0x800200; 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_v4.dtb
ethact=egiga0
ethaddr=00:25:31:05:ec:22
if_netconsole=ping $serverip
ipaddr=192.168.1.5
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
machid=f78
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
nc_ready=1
ncip=192.168.1.11
partition=nand0,2
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
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
serverip=192.168.1.11
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_$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=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_ready_retry=15
usb_rootfstype=ext3
Re: Pogoplug V4 - uBoot with Debian
April 21, 2017 07:22PM
Nirmal_Kumar Wrote:
-------------------------------------------------------
> Thanks Bodhi.
>
> I flashed and i also verified the output mentioned
> in Step 8. Now the issue i am facing is the defaul
> t Pogo OS in not detecting the SATA (top port) dri
> ve.
>
> Here the output i got from ptintenv. Should i need
> to reflash the default env image again?
>
> Pogov4> printenv
> printenv
> arcNumber=3960
> bootcmd=run bootcmd_mmc; run bootcmd_usb; run boot
> cmd_sata; run bootcmd_pogo; reset
> 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 lo
> ad_dtb; then bootm $load_uimage_addr - $load_dtb_a
> ddr; else bootm $load_uimage_addr; fi; fi
> bootcmd_pogo=if ubi part root 2048 && ubifsmount u
> bi:rootfs && ubifsload 0x800000 uboot.mtd0.docksta
> r.original.kwb ; then go 0x800200; 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_v4.dtb
> ethact=egiga0
> ethaddr=00:25:31:05:ec:22
> if_netconsole=ping $serverip
> ipaddr=192.168.1.5
> led_error=orange blinking
> led_exit=green off
> led_init=green blinking
> load_dtb=echo loading DTB $dtb_file ...; load $boo
> tdev $device $load_dtb_addr $dtb_file
> load_dtb_addr=0x1c00000
> load_initrd=echo loading uInitrd ...; load $bootde
> v $device $load_initrd_addr /boot/uInitrd
> load_initrd_addr=0x1100000
> load_uimage=echo loading uImage ...; load $bootdev
> $device $load_uimage_addr /boot/uImage
> load_uimage_addr=0x800000
> machid=f78
> mainlineLinux=yes
> mtdids=nand0=orion_nand
> mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage)
> ,3M(uImage2),8M(failsafe),112M(root)
> nc_ready=1
> ncip=192.168.1.11
> partition=nand0,2
> 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 set
> env nc_ready 1; fi; done; if test $nc_ready -eq 1;
> then run start_netconsole; fi
> 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 S
> can device $dev; run scan_$dev; for disknum in $di
> sks; do if test $scan_done -eq 0; then echo device
> $dev $disknum:1; if load $dev $disknum:1 $load_uim
> age_addr /boot/uImage 1; then scan_done=1; echo Fo
> und bootable drive on $dev $disknum; setenv device
> $disknum:1; setenv bootdev $dev; fi; fi; done; fi;
> done
> serverip=192.168.1.11
> set_bootargs=setenv bootargs console=ttyS0,115200
> root=LABEL=rootfs rootdelay=10 $mtdparts $custom_p
> arams
> start_netconsole=setenv ncip $serverip; setenv boo
> tdelay 10; setenv stdin nc; setenv stdout nc; sete
> nv 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"; se
> tenv init_ide "ide reset"; setenv init_mmc "mmc r
> escan"; for devtype in $devices; do run init_$devt
> ype; done;
> uenv_load=run uenv_init_devices; setenv uenv_loade
> d 0; for devtype in $devices; do for disknum in 0
> ; do run uenv_read_disk; done; done;
> 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 $de
> vtype part $disknum; then run uenv_read; fi; fi
> usb_ready_retry=15
> usb_rootfstype=ext3

No you can't boot the stock OS in NAND without further changes in uboot envs. It is set up to boot with USB, HDD, or SD card rootfs.

The reason that we want to use the new uboot : to make it easier booting to Linux on any type of external devices. So I would suggest you create a new rootfs on USB or SD card and boot with it.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 04/21/2017 07:23PM by bodhi.
Re: Pogoplug V4 - uBoot with Debian
April 22, 2017 12:14AM
Hi Bodhi,

Thanks for your inputs. Now i was successfully able to install Debian and running smoothly.

Here the details:
1.Earlier i ran fw_setenv and altered the bootcmd from a different tutorial. Then i changed it based on new uBoot Image envionment properties
2.I used Kingston 4 GB class 4 Memory card in the MMC drive in pogoplug series 4

Few Queries :
1.How do i backup rootfs automtaically instead of ejecting and backing up?
2.What is the objective of setting init=/bin/systemd in bootargs. Should i use usb_boot_args or boot_args property?
3.Is there any post in this forum which explains how to set samba configuration to get good speed in the LAN?

Bodhi, Thanks for all your support to the community. I wish i document all my learning and share the same back to the community with respect to this embedded device pogoplu/dockstar experience.

~ Nirmal, India
Re: Pogoplug V4 - uBoot with Debian
April 22, 2017 02:19AM
Hi Nirmal,

> Thanks for your inputs. Now i was successfully abl
> e to install Debian and running smoothly.

Cool!

> 1.How do i backup rootfs automtaically instead of
> ejecting and backing up?

You need to use rsync to back up a live rootfs to a USB drive, or to a NFS share folder. If you can't find a tutorial how to do that then post back and I'll post some instruction.

> 2.What is the objective of setting init=/bin/syste
> md in bootargs. Should i use usb_boot_args or boot
> _args property?

If you want to boot with systemd as the Linux init system. Set custom_params, because you are booting with the default envs, where custom_params is a extra option in bootargs:

set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params

> 3.Is there any post in this forum which explains h
> ow to set samba configuration to get good speed in
> the LAN?
>

Yes. Look in the Wiki thread:

Quote

Samba

Samba smb.conf for a simple set up
HowTo setup Samba/CIFS shares

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogoplug V4 - uBoot with Debian
April 23, 2017 11:08AM
Hi Bodhi,

I cam across the following tutorial for backing up the rootfs. Could you please let me know is this the apt one to go.?

https://wiki.archlinux.org/index.php/full_system_backup_with_rsync
https://wiki.debian.org/Backup/Clone

Queries :
1.Is it possible to backup the live system or should i need to shutdown and clone the rootfs

Thanks again..
Re: Pogoplug V4 - uBoot with Debian
April 23, 2017 04:18PM
Nirmal,

> https://wiki.archlinux.org/index.php/full_system_b
> ackup_with_rsync

The above is a good tutorial to back up live rootfs.

> Queries :
> 1.Is it possible to backup the live system or shou
> ld i need to shutdown and clone the rootfs
>

The best way to back up is to clone the rootfs. This Debian link is a good one.
https://wiki.debian.org/Backup/Clone

But it is easier to use tar command like I wrote:
http://forum.doozan.com/read.php?2,12096,24034#msg-24034

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 04/23/2017 04:19PM by bodhi.
Re: Pogoplug V4 - uBoot with Debian
April 02, 2018 11:48AM
Hi Bodhi,

For the last one year my Pogo V4 working great with 4.4.0. Last week i accidently pulled the sata disk and the os crashed (Starting Kernel from NC). I need your help in resolving this. I managed to reload the latest 4.12 to a MMC card and i booted again.

Now, Here my queries

1.I have installed multiple apps in SATA disk and can able to see the files and folders. Looks like the files in the sata disk/boot has corrupted. Is there a way i can fix this and boot from SATA HDD without losing my program data?

2.Whats the syntax to control the boot priority from uEnvs.txt. Is there any link/manual on the supported variables which can be used in uEnvs.txt?

3.Do you recommend "System Tar and restore Library" for backup restore as a safety measure in the future?.
https://github.com/tritonas00/system-tar-and-restore
https://www.tecmint.com/system-tar-and-restore-a-linux-backup-script/

Here the env variables from fw_printenv

*******************************************************************
arcNumber=3960
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_pogo; reset
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_pogo=if ubi part root 2048 && ubifsmount ubi:rootfs && ubifsload 0x800000 uboot.mtd0.dockstar.original.kwb ; then go 0x800200; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
custom_params=init=/bin/systemd
device=0:1
devices=usb ide mmc
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-pogoplug_v4.dtb
ethact=egiga0
ethaddr=00:25:31:05:ec:22
if_netconsole=ping $serverip
ipaddr=192.168.1.5
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
machid=f78
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
nc_ready=1
ncip=192.168.1.11
partition=nand0,2
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
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
serverip=192.168.1.11
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_$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=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_ready_retry=15
usb_rootfstype=ext3

*******************************************************************

----------------
moderator: please used code tags to post logs (the Formatted Code button is the right most one on top of your editing box).



Edited 1 time(s). Last edit at 04/03/2018 05:28PM by bodhi.
Re: Pogoplug V4 - uBoot with Debian
April 02, 2018 01:48PM
Nirmal_Kumar Wrote:
-------------------------------------------------------
> Hi Bodhi,
>
> Last week i accidently pulled the sata disk and the os crashed (Starting Kernel from NC).
>
Once your Pogo V4 has booted from other storage, plug the SATA HDD back and run dmesg from the console to see what is shown in the last few lines. Chances are there is a message indicating one of the SATA partitions is dirty. Make a note on that partition, i.e. /dev/sda1, etc. Then, run df on the same console to see if such a partition has already been mounted. If so, run umount /dev/sdaX (where sdaX is the partition). Then, run fsck -fy /dev/sdaX to clean your partition and hope fsck will be able to clean up your SATA partition.
Re: Pogoplug V4 - uBoot with Debian
April 03, 2018 05:34PM
Quote

1.I have installed multiple apps in SATA disk and can able to see the files and folders. Looks like the files in the sata disk/boot has corrupted. Is there a way i can fix this and boot from SATA HDD without losing my program data?

As habibie suggested, boot with USB first and plug in the HDD. Run checkdisk to see if any error and fix them. For example,

e2fsck /dev/sdb1


Quote

2.Whats the syntax to control the boot priority from uEnvs.txt. Is there any link/manual on the supported variables which can be used in uEnvs.txt?

Look at the u-boot envs tarball that you have downloaded before:

uboot.2016.05-tld-1.environment (the content of the default envs in text format)

Every env in this file can be modified, except the bootcmd and bootcmd_uenv envs.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogoplug V4 - uBoot with Debian
January 18, 2020 08:47PM
Hi Bodhi,
I have a spare fresh (Not activate) pogo V4. Thought of installing uboot.
Today i tried to connect and its says the ssh password failed with root@IP and PWD : cedamin.

Am i missing something?

Regards
Nirmal
Re: Pogoplug V4 - uBoot with Debian
January 18, 2020 10:28PM
No Worries. Looks like i changed the ssh password few years back on this device and i was able to login now.
Re: Pogoplug V4 - uBoot with Debian
January 19, 2020 10:13PM
Hi Bodhi,

I was trying to setup the Debian & UBoot on this new Pogo V4 Device. When i flashed and rebooted using the MMC card the NetConsole is showing "Starting Kernel"..

Here the Environment Variables. Could you please show some lights what i am missing.


arcNumber=3960
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_pogo=if ubi part root 2048 && ubifsmount ubi:rootfs && ubifsload 0x800000 uboot.mtd0.dockstar.original.kwb ; then go 0x800200; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootcmd=run bootcmd_uenv; sleep 2; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_pogo; reset
bootdelay=10
bootdev=usb
custom_params=init=/bin/systemd
device=0:1
devices=usb ide mmc
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-pogoplug_v4.dtb
ethact=egiga0
ethaddr=00:25:31:05:1d:41
if_netconsole=ping $serverip
ipaddr=192.168.1.16
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb_addr=0x1c00000
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_initrd_addr=0x1100000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_uimage_addr=0x800000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
machid=f78
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
nc_ready=1
ncip=192.168.1.18
partition=nand0,2
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
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
serverip=192.168.1.18
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=echo Initializing 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 $disks; do if test $uenv_loaded -eq 0; then setenv device_type $devtype; setenv disk_number $disknum; run uenv_read; fi; done; done;
uenv_read=echo Loading envs from $device_type $disk_number...; if load $device_type  $disk_number:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; echo ... envs loaded; fi
usb_ready_retry=15



Regards
Nirmal
India
Re: Pogoplug V4 - uBoot with Debian
January 19, 2020 10:46PM
Looks like i missed a env variable. Now i added them and things working good.

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
Re: Pogoplug V4 - uBoot with Debian
September 18, 2020 11:39AM
Hi Bodhi,

I am back again with another PogoPlug V4 Device.

I was successfully installed Debian on this Device and also installed debian in another seagate Dockstar. Both worked well.

After few months i tried connecting the Pogoplug device using a different adapter (12V) and then i tried connecting the ethernet. From then on, the device is not recognized on my network. (unable to see the clients in my router DHCP). The same thing happened for the Segate Dockstar also.

Now the device is simply blinking and not booting from the sd card. (both devices). I even tried with the native adapter which came with the device. No difference.

My query is, does using a different 12V adpater will damage the device ethernet or does it corrupted the uboot inside the NAND ?

What's the best way to recover these 2 devices. I don't have JTAG or UART expertise. I do have 1 raspberry pi sitting on my desk.

Regards
Nirmal
Re: Pogoplug V4 - uBoot with Debian
September 18, 2020 05:00PM
Nirmal,

>
> Now the device is simply blinking and not booting
> from the sd card. (both devices). I even tried
> with the native adapter which came with the
> device. No difference.
>
> My query is, does using a different 12V adpater
> will damage the device ethernet or does it
> corrupted the uboot inside the NAND ?

Not likely that will corrupt anything.

> What's the best way to recover these 2 devices.

When you replaced the power supply, did you remember to shutdown the systems cleanly? or did you just turn off the power?

1. The first thing to do without serial console is to take the SD/USB rootfs to another Linux box and check for errors (using e2fsck), and then look at the kernel files in /boot.

Assuming it is assigned /dev/sdb1

e2fsck /dev/sdb1
mount /dev/sdb1 /media/sdb1
ls -lart /media/boot

2. If you have set up netconsole while you installed u-boot on these 2 devices a while back, then you can use netconsole to interact with these boxes during boot and recover easily.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogoplug V4 - uBoot with Debian
September 26, 2020 12:38AM
Hi Bodhi,

Thanks for the details.

While powering down i didn't did a clean shutdown. Just pulled off the power adapter. Morever, i created a new sd card with the old kernel 4.12 but i am still unable to boot.

I also configured netconsole on these devices. But forgot the IP which i configured. Let me identify a way to figure out the netconsole server IP and will keep you posted.

Regards
Nirmal
Re: Pogoplug V4 - uBoot with Debian
October 04, 2020 12:48AM
Hi Bodhi,


Here the output of UART on Dockstar

...... done.
read_nand_cached: error reading nand off 0x5a6000 size 8192 bytes
off = 0x5a5de0 magic 0x1985 type 0xe002 node.totlen = 2797
read_nand_cached: error reading nand off 0x6f0000 size 8192 bytes
### JFFS2 load complete: 188925 bytes loaded to 0x800000
## Starting application at 0x00800200 ...

Is anything corrupted in the NAND ?
Re: Pogoplug V4 - uBoot with Debian
October 04, 2020 04:03PM
Nirmal_Kumar,

> Here the output of UART on Dockstar
>
> ...... done.
> read_nand_cached: error reading nand off 0x5a6000
> size 8192 bytes
> off = 0x5a5de0 magic 0x1985 type 0xe002
> node.totlen = 2797
> read_nand_cached: error reading nand off 0x6f0000
> size 8192 bytes
> ### JFFS2 load complete: 188925 bytes loaded to
> 0x800000
> ## Starting application at 0x00800200 ...
>

Is that all you see in serial console? if there is more, please post the entire serial log.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogoplug V4 - uBoot with Debian
October 05, 2020 04:35AM
Hi Bodhi,

This is for DOCKSTAR

Here the output of serial console. Its stuck at Uncompressing Linux... done, booting the kernel.

Tried 4.12 and also 5.29 Debian Images on SANDisk on Strontium SD Cards.

U-Boot 2011.12 (Feb 12 2012 - 21:33:07)
Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 3 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
Loading file "/rescueme" from usb device 0:1 (usbda1)
** File not found /rescueme
reading /rescueme.txt

** Unable to read "/rescueme.txt" from usb 0:1 **
Creating 1 MTD partitions on "nand0":
0x000002500000-0x000010000000 : "mtd=3"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=3"
UBI: MTD device size:            219 MiB
UBI: number of good PEBs:        1751
UBI: number of bad PEBs:         1
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             1730
UBI: total number of reserved PEBs: 21
UBI: number of PEBs reserved for bad PEB handling: 17
UBI: max/mean erase counter: 1/1
UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:rootfs", error -19
Error reading superblock on volume 'ubi:rootfs'!
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
1 bytes read
Found bootable drive on usb 0:1
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
4975125 bytes read
Loading file "/boot/uInitrd" from usb device 0:1 (usbda1)
9713936 bytes read
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-5.2.9-kirkwood-tld-1
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4975061 Bytes = 4.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-5.2.9-kirkwood-tld-1
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9713872 Bytes = 9.3 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Can i know what i am missing?

Regards
Nirmal
Re: Pogoplug V4 - uBoot with Debian
October 05, 2020 11:31PM
Nirmal,

Because you are booting with an old u-boot, when creating the rootfs, you need to do Step 4.


Quote

4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Do not do this step if you have installed the latest U-Boot for Kirkwood (or are installing this u-boot at the same time).

Please replace kirkwood-goflexnet.dtb below with the correct DTB name for your box (see the folder /media/sdb1/boot/dts for the exact spelling of your Kirkwood box name).

Generate the uImage with DTB embedded inside:
cd /media/sdb1/boot
cp -a zImage-5.2.9-kirkwood-tld-1 zImage.fdt
cat dts/kirkwood-goflexnet.dtb >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.2.9-kirkwood-tld-1 -d zImage.fdt uImage
sync

And the DTB that you need to use is

kirkwood-dockstar.dtb

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogoplug V4 - uBoot with Debian
October 06, 2020 10:33AM
Hi Bodhi

I am aware of the old UBoot versions. I also created uImage with embedded DTB using dockstar.

Should i need to run ramdisk also. I did only the kernel mkimage ?

mkimage -A arm -O linux -T ramdisk -C ...

btw, The serial console doesn't support interactive commands to type like netconsole?

Regards
Nirmal
Re: Pogoplug V4 - uBoot with Debian
October 07, 2020 09:32PM
Nirmal_Kumar,

> I am aware of the old UBoot versions. I also
> created uImage with embedded DTB using dockstar.
>
> Should i need to run ramdisk also. I did only the
> kernel mkimage ?

Not needed to do that. The existing uInitrd is good for all boxes.


> btw, The serial console doesn't support
> interactive commands to type like netconsole?

Serial console is much better than netconsole. All interactive commands and output are supported.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogoplug V4 - uBoot with Debian
October 08, 2020 03:47AM
ok Bodhi,

FYI : I am using Dockstar side USB port for booting earlier.


Output of boot directory

pi@berry:/media/usb0 $ ls boot -l
total 55980
-rw------- 1 root root 3101889 Aug 18  2019 System.map-5.2.9-kirkwood-tld-1
-rw-r--r-- 1 root root  165790 Aug 18  2019 config-5.2.9-kirkwood-tld-1
drwxr-xr-x 2 root root    4096 Aug 17  2019 dts
-rw-r--r-- 1 root root 9713872 Aug 25  2019 initrd.img-5.2.9-kirkwood-tld-1
-rw-r--r-- 1 root root 9649570 Aug 18  2019 linux-headers-5.2.9-kirkwood-tld-1_1.0_armel.deb
-rw-r--r-- 1 root root 4973738 Oct  8 13:40 uImage
-rw-r--r-- 1 root root 4963680 Aug 25  2019 uImage.orig
-rw-r--r-- 1 root root 9713936 Aug 25  2019 uInitrd
-rw------- 1 root root 4963616 Aug 18  2019 vmlinuz-5.2.9-kirkwood-tld-1
-rwxr-xr-x 1 root root 4963616 Aug 18  2019 zImage-5.2.9-kirkwood-tld-1
-rwxr-xr-x 1 root root 4973674 Oct  8 13:40 zImage.fdt




I used minicom and screen. Keyboard inputs are not responding.

Here the output which i got without any attached USB Drive


Creating 1 MTD partitions on "nand0":                            
0x000002500000-0x000010000000 : "mtd=3"                          
UBI: attaching mtd1 to ubi0                                      
UBI: physical eraseblock size:   131072 bytes (128 KiB)          
UBI: logical eraseblock size:    129024 bytes                    
UBI: smallest flash I/O unit:    2048                            
UBI: sub-page size:              512                             
UBI: VID header offset:          512 (aligned 512)               
UBI: data offset:                2048                            
UBI: attached mtd1 to ubi0                                       
UBI: MTD device name:            "mtd=3"                         
UBI: MTD device size:            219 MiB                         
UBI: number of good PEBs:        1751                            
UBI: number of bad PEBs:         1                               
UBI: max. allowed volumes:       128                             
UBI: wear-leveling threshold:    4096                            
UBI: number of internal volumes: 1                               
UBI: number of user volumes:     0                               
UBI: available PEBs:             1730                            
UBI: total number of reserved PEBs: 21                           
UBI: number of PEBs reserved for bad PEB handling: 17            
UBI: max/mean erase counter: 1/1                                 
UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:rootfs", err9
Error reading superblock on volume 'ubi:rootfs'!                 
** Block device usb 0 not supported                              
** Block device usb 1 not supported                              
** Block device usb 2 not supported                              
** Block device usb 3 not supported                              
** Block device usb 0 not supported                              
** Block device usb 0 not supported                              
Wrong Image Format for bootm command                             
ERROR: can't get kernel image!                                   
stopping USB..                                                   
### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000          
Scanning JFFS2 FS:   read_nand_cached: error reading nand off 0xs
.  read_nand_cached: error reading nand off 0x6ef600 size 8192 bs
........ done.                                                   
read_nand_cached: error reading nand off 0x5a6000 size 8192 bytes
off = 0x5a5de0 magic 0x1985 type 0xe002 node.totlen = 2797       
read_nand_cached: error reading nand off 0x6f0000 size 8192 bytes
### JFFS2 load complete: 188925 bytes loaded to 0x800000         
## Starting application at 0x00800200 ... 
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: