Welcome! Log In Create A New Profile

Advanced

[Question] How to install Debian on PogoPlug POGO-V4-A3-01 which is currently running Archlinux ARM?

Posted by zeroxia 
Hi I have a PogoPlug POGO-V4-A3-01, and I have installed Archlinux ARM on it using this tutorial:

https://archlinuxarm.org/platforms/armv5/pogoplug-series-4

So I want to run this Debian on it:
https://forum.doozan.com/read.php?2,12096
I downloaded this rootfs pack: Latest released rootfs: Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2 (25 Aug 2019)
I did not use the latest kernel.
I prepared a SD card with that rootfs package (filesystem is ext3 with journaling)

I downloaded this latest U-Boot:
https://forum.doozan.com/read.php?3,12381

I followed this UART boot guide:
https://forum.doozan.com/read.php?3,7852,7852

And I successfully booted into U-Boot with prompt "Pogov4".
I remembered I have to chagne this environment var from:
dtb_file=/boot/dts/kirkwood-pogoplug_v4

To:
dtb_file=/boot/dts/kirkwood-pogoplug_v4.dtb

And the devices starts running Debian now.

So the next step I reckon is to write the U-boot to somewhere in the internal "mtdblock". And I suppose the environment variables to U-Boot need to be updated as well?

In current Debian system, my configuration is as follows:
Are they correct?
# cat /etc/fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000
root@debian: /dev
# 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"

Do I need to change /etc/fw_env.config to the following?
mtd0: 00100000 00020000 "u-boot"

I've seen this error on console for env vars:
# fw_printenv ethaddr
Warning: Bad CRC, using default environment
ethaddr=00:00:11:22:33:44
There may be no need to backup these environment variables in Debian?
Or do I need to boot to the Archlinux U-boot and save output from "printenv"?


So in this running Debian system, I just need to run the following commands?
flash_erase /dev/mtd0 0 4
nandwrite /dev/mtd0 uboot.2017.07-tld-1.pogo_v4.mtd0.kwb
And flash default u-boot envs:
/usr/sbin/flash_erase /dev/mtd0 0xc0000 1
/usr/sbin/nandwrite -s 786432 /dev/mtd0 uboot.2016.05-tld-1.environment.img
And finally update environment vars:
fw_setenv arcNumber 3960
fw_setenv machid f78
fw_setenv mtdparts 'xxxxxxxxx'
(This "mtdparts" var has the following value when I UART booted the U-boot, is it correct?
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
)
fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx'
fw_setenv dtb_file '/boot/dts/kirkwood-pogoplug_v4.dtb'
And also the env vars for utilizing "uEnv.txt".
Is this all?
Thank you.
zeroxia,


> Hi I have a PogoPlug POGO-V4-A3-01, and I have
> installed Archlinux ARM on it using this
> tutorial:
>
> https://archlinuxarm.org/platforms/armv5/pogoplug-series-4
>
> So I want to run this Debian on it:
> https://forum.doozan.com/read.php?2,12096
> I downloaded this rootfs pack: Latest
> released rootfs:
> Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2
> (25 Aug 2019)

> I did not use the latest kernel.
> I prepared a SD card with that rootfs package
> (filesystem is ext3 with journaling)
>
> I downloaded this latest U-Boot:
> https://forum.doozan.com/read.php?3,12381
>
> I followed this UART boot guide:
> https://forum.doozan.com/read.php?3,7852,7852
>
> And I successfully booted into U-Boot with prompt
> "Pogov4".
> I remembered I have to chagne this environment var
> from:
>
> dtb_file=/boot/dts/kirkwood-pogoplug_v4
>
>
> To:
>
> dtb_file=/boot/dts/kirkwood-pogoplug_v4.dtb
>
>
> And the devices starts running Debian now.

Cool! everything you did was by the book. That was the safest way to install Debian from Arch.

>
> So the next step I reckon is to write the U-boot
> to somewhere in the internal "mtdblock". And I
> suppose the environment variables to U-Boot need
> to be updated as well?
>
> In current Debian system, my configuration is as
> follows:
> Are they correct?
>
> # cat /etc/fw_env.config
> # MTD device name       Device offset   Env. size 
>      Flash sector size       Number of sectors
> /dev/mtd0 0xc0000 0x20000 0x20000

> root@debian: /dev
> # 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"
>
>
> Do I need to change /etc/fw_env.config to the
> following?
>
> mtd0: 00100000 00020000 "u-boot"
>

No. The one you have is already correct for the new u-boot.

/dev/mtd0 0xc0000 0x20000 0x20000


>
> I've seen this error on console for env vars:
>
> # fw_printenv ethaddr
> Warning: Bad CRC, using default environment
> ethaddr=00:00:11:22:33:44
>
> There may be no need to backup these environment
> variables in Debian?

No need to. If you have the envs saved somewhere before, then that would be enough. Even if you don't, it's OK, you can adjust them later.

> Or do I need to boot to the Archlinux U-boot and
> save output from "printenv"?

No need to. But if you are very careful, you could do that.

>
>
> So in this running Debian system, I just need to
> run the following commands?
>
> flash_erase /dev/mtd0 0 4
> nandwrite /dev/mtd0
> uboot.2017.07-tld-1.pogo_v4.mtd0.kwb
>
> And flash default u-boot envs:
>
> /usr/sbin/flash_erase /dev/mtd0 0xc0000 1
> /usr/sbin/nandwrite -s 786432 /dev/mtd0
> uboot.2016.05-tld-1.environment.img
>

Yes. Basically these 2 commands. But you need to check bad blocks, as the instruction stated.


> And finally update environment vars:

> (This "mtdparts" var has the following value when
> I UART booted the U-boot, is it correct?
> mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
> )

Exactly. That's the mtdparts.


> fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx'
> fw_setenv dtb_file
> '/boot/dts/kirkwood-pogoplug_v4.dtb'
> [/code]

> And also the env vars for utilizing "uEnv.txt".

Don't use uEnv.txt yet. That only for future when you want to experiment with other booting scheme.

> Is this all?

Also don't do Step 10 (Set up netconsole). You have serial console.


You got it :)

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

It is very of you to answer my questions in detail.

I've written the u-boot to the device and it can boot to Debian directly now, thank you very much for everything presented in this site.

For the record, after writing the u-boot image and the env image, the "mtdparts" env var became this:
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
And I changed it back to this:
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)

Not sure about this, but the box booted and I'm running in Debian.

Then I followed this thread to upgrade the kernel:
https://forum.doozan.com/read.php?2,12096

The result is I now have kernel version 5.5.1:
# uname -a
Linux debian 5.5.1-kirkwood-tld-1 #1.0 PREEMPT Sat Feb 1 22:28:36 PST 2020 armv5tel GNU/Linux

I did not follow the instruction to update u-boot env, the variables were kept like below:

# fw_printenv dtb_file load_dtb load_initrd load_uimage usb_boot
dtb_file=/boot/dts/kirkwood-pogoplug_v4.dtb
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
## Error: "usb_boot" not defined


Now I suppose if I eject my SD card and put it to my computer, and make a tar ball of all those files as backup, I can restore the Debian system with the tar ball any time?

Another question, "apt list --upgradable" now shows a lot of packages, can I simply run "apt upgrade" to do the upgrade?
zeroxia,

> I did not follow the instruction to update u-boot
> env, the variables were kept like below:
>
>
> # fw_printenv dtb_file load_dtb load_initrd
> load_uimage usb_boot
> dtb_file=/boot/dts/kirkwood-pogoplug_v4.dtb
> 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
> ## Error: "usb_boot" not defined
>

Correct. You are running new u-boot so no change in envs is needed.

> Now I suppose if I eject my SD card and put it to
> my computer, and make a tar ball of all those
> files as backup, I can restore the Debian system
> with the tar ball any time?

Right. Shutdown the Pogo. Take the SD card to another Linux box. See here for how to backup and restore:

https://forum.doozan.com/read.php?2,12096,24034#msg-24034

> Another question, "apt list --upgradable" now
> shows a lot of packages, can I simply run "apt
> upgrade" to do the upgrade?

I use:
apt-get update
apt-get upgrade

-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: