Welcome! Log In Create A New Profile

Advanced

Rescue System for Pogo V4/Mobile using OpenWrt (Install with NetConsole)

Posted by iSKUNK! 
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 02, 2020 11:37PM
:) will take some time to proofread! But I will do that before it's up in the Wiki.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 03, 2020 05:46PM
iSKUNK,

Excellent works!

Two comments:

1. netconsole command

Should use (or add this syntax as another way of starting netconsole):
nc -lup 6666 192.168.100.25 6666

The one you use will connect any box that has netconsole running. So it might interfere wiht this session (rare, but possible there is another one running in the network). Using a specific IP for this will only interact with this box.


2. Where to download the OpenWrt images

Create URL link to OpenWrt release website to tell where each of the images is. Eventhough it might got obsolete in the future, it still helps to give the users some idea that's the place to look for.

Other than that, congrats for a job well done :)

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



Edited 1 time(s). Last edit at 05/03/2020 11:29PM by bodhi.
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 04, 2020 03:52PM
iSKUNK!,

Very clear and easy to follow guide. A couple of questions:

1. Any reason to increase the area for uboot to 2M? bodhi's original partition and the other guide use 1M.

2. In part I
# OpenWRT neither provides nor needs a DTB file, so unset that variable
/tmp # ./tools/fw_setenv dtb_file

Perhaps bodhi will chime in, but can Debian boot without this file?

3. You also modify a few environment vars for net console. Aren't those from bodhi's original environment enough?

4. If one wants to boot Arch Linux (alarm) from a USB drive also, will this work?

Thanks,

-nnSlick
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 04, 2020 04:29PM
nnSlick,

> 1. Any reason to increase the area for uboot to
> 2M? bodhi's original partition and the other guide
> use 1M.

2M is the default Pogo V4 partition size. It is OK.

> 2. In part I
>
> # OpenWRT neither provides nor needs a DTB file,
> so unset that variable
> /tmp # ./tools/fw_setenv dtb_file
>
>
> Perhaps bodhi will chime in, but can Debian boot
> without this file?

That env just tell whether the DTB is separate or already appended to uImage.

>
> 3. You also modify a few environment vars for net
> console. Aren't those from bodhi's original
> environment enough?
>

I've modified it slightly since u-boot was released in 2017. But it basically work the same way. IP addresses must be changed to your specific nework.

> 4. If one wants to boot Arch Linux (alarm) from a
> USB drive also, will this work?

It wont work right away you need to change the envs a little. See the Wiki thread:

Booting Other Linux Distros on Pogoplug

Quote
https://forum.doozan.com/read.php?2,23630

How to boot Arch Linux ARM with bodhi's released u-boot
How to boot Void Linux with bodhi's released u-boot

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 04, 2020 04:34PM
By the way,

I'm going to move this thread to the Rescue Sub-forum. It really should be in there, where all matters related to OpenWrt can be dicussed properly.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 04, 2020 04:58PM
bodhi,

As always really appreciate your quick answers.

Quote

That env just tell whether the DTB is separate or already appended to uImage.
So, if one want to boot from your roots tar ball, this environment variable must be set, correct?

Quote

I've modified it slightly since u-boot was released in 2017. But it basically work the same way. IP addresses must be changed to your specific nework.
Without the changes by iSKUNK, net console still work, right?

Quote

I'm going to move this thread to the Rescue Sub-forum. It really should be in there, where all matters related to OpenWrt can be dicussed properly.

I think it is a good idea.

Thanks again,
-nnSlick
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 04, 2020 06:23PM
> So, if one want to boot from your roots tar ball,
> this environment variable must be set, correct?

That's the preference, to boot with separated DTB file. But in some rare instances, eg. with older u-boots, Debian can be boot with the DTB appended to uImage.

> Without the changes by iSKUNK, net console still
> work, right?

It should work with the u-boot installation default values. What you see is the modification that I've made and posted here a while ago. The changes make netconsole more resilient (i.e. eliminating false positives).

So the netconsole script in this instruction should be used if you have problem connecting netconsole in the future.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 04, 2020 09:59PM
Up in the Wiki thread:

Quote

Rescue Systems

Rescue System V2 (Original)
MacPlug & SMBPLug
Rescue System Pogo V3
Rescue System V4, using a custom LEDE firmware (BETA)
Rescue System for Pogo E02 using LEDE/OpenWrt (Install with Serial Console)
Rescue System for Pogo V4/Mobile using OpenWrt (Install with NetConsole)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 05, 2020 12:59AM
(Apologies for the delay; the day job kept me busy!)

I've added information about the OpenWRT download. I agree, I'd glossed over that part.

Regarding that nc invocation, however...
$ nc -lup 6666 192.168.100.25 6666
usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-M ttl]
	  [-m minttl] [-O length] [-P proxy_username] [-p source_port]
	  [-q seconds] [-s source] [-T keyword] [-V rtable] [-W recvlimit] [-w timeout]
	  [-X proxy_protocol] [-x proxy_address[:port]] 	  [destination] [port]
I appear to have the OpenBSD version of netcat. Which version are you using?

Quote

Up in the Wiki thread:

Ah, lovely! Hope this will be helpful to others :-)

By the way: I'd suggest rolling a new environment image sometime, to reduce the number of fw_setenv calls needed (leave less room for error), and include an fw_setenv symlink in the flashing-utilities tarball (it's a silly thing but it could throw some people off).

Also, it would be good to include a note in the netconsole docs on how to set things up so it can only be activated by an appropriate uEnv.txt setting. I only touched briefly on the security aspect of netconsole, and perhaps with a properly-switched network it's not a big deal, but still. Some folks might want to run their device on a not-so-friendly network...
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 05, 2020 01:30AM
> (Apologies for the delay; the day job kept me
> busy!)

Busy is good to hear in time like this :) things we do here is not important, it can wait as long as needed!


> Regarding that nc invocation, however...
>
> $ nc -lup 6666 192.168.100.25 6666
> usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i
> interval] [-M ttl]
> 	  [-m minttl] [-O length] [-P proxy_username] [-p
> source_port]
> 	  [-q seconds] [-s source] [-T keyword] [-V
> rtable] [-W recvlimit] [-w timeout]
> 	  [-X proxy_protocol] [-x proxy_address[:port]] 	
>  [destination] [port]
>
> I appear to have the OpenBSD version of
> netcat. Which version are you using?

Ah. Any Debian-based distro would work with:
nc -lup 6666 192.168.100.25 6666

So It might be good to mention different syntax flavor, especially one that Debian users use.

> By the way: I'd suggest rolling a new environment
> image sometime, to reduce the number of fw_setenv
> calls needed (leave less room for error), and
> include an fw_setenv symlink in the
> flashing-utilities tarball (it's a silly thing but
> it could throw some people off).

That's something I have on my list. Since I don't see a need to release new u-boot anytime soon, an updated env image would be good to correct some mistakes (typo) I had before.


> Also, it would be good to include a note in the
> netconsole docs on how to set things up so it can
> only be activated by an appropriate uEnv.txt
> setting.

I've intentionally avoided this in the instruction. uEnv.txt could be used to activate netconsole with some change in envs. But it will be an unsafe thing to do for everybody, people could be locked out of the box with a simple typo. So I'd rather live with the limitation, and not making it a normal setup in the installation.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 05, 2020 02:31AM
All right, I've added a note about the two different nc invocations.

(Note that I'm running Ubuntu, by the way :-] I just have the "netcat-openbsd" package installed instead of "netcat-traditional". The latter is probably the more common one, in any event.)

Quote
bodhi
I've intentionally avoided this in the instruction. uEnv.txt could be used to activate netconsole with some change in envs. But it will be an unsafe thing to do for everybody, people could be locked out of the box with a simple typo. So I'd rather live with the limitation, and not making it a normal setup in the installation.
It would be best left as an optional step, for users with greater security needs (but not enough familiarity with U-Boot to navigate the setup themselves). An important part of this would be to recommend keeping the uEnv.txt file on removable storage, to help prevent the possibility of getting locked out. This way, the USB drive / SD card can serve as a sort of "access key" that can easily be recreated if necessary.
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 05, 2020 03:57AM
> This way, the USB drive / SD
> card can serve as a sort of "access key" that can
> easily be recreated if necessary.

You got it. That was the reason I always have usb on the device list.
devices=usb ide mmc

Even when your netconsole does not work, and your NAND or SATA drive is corrupted, you can just create a new UBS rootfs and it will boot so you can gain access to the box.

OTOH, uEnv.txt is a way to play with your u-boot envs when you are trying to set up different configuration, before you commit it to NAND. It should not be used as a permanent way of booting (i.e. the disk that hosts uEnv.txt might be offline or corrupted too).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 05, 2020 07:20AM
iSKUNK! and bodhi,

Great guide and good timing! I just found a Pogoplug V4 (version A3) and plan to use it as my NFS server. I use this guide to flash the new uboot and uenvironment, and was able to boot into openwrt from the uImage, but run into a road block. After booting into openwrt for the first time, my mtd looks different and I could not do any fw_setenv:
root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 001c0000 00020000 "uboot"
mtd1: 00040000 00020000 "uboot_env"
mtd2: 07e00000 00020000 "ubi"
root@OpenWrt:~# fw_setenv partition 'nand0,0'
Can't open /dev/mtd0: Permission denied
Error: can't write fw_env to flash
root@OpenWrt:~# fw_printenv mtdparts
mtdparts=mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x200000(ubi)

I guess this is due to the fact that it was hacked previously to run other rescue system. How can I fix this to continue?

Thanks in advance!
-nnSlick



Edited 1 time(s). Last edit at 05/05/2020 07:26AM by nnSlick.
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 05, 2020 08:46PM
Hi All,

Please disregard my previous post about mtd0's permission denied error. Turns out it was my mistake: did not run the setenv bootargs step before booting into Openwrt the first time.

I now has a rescue system on my V4 plug that I plan to use as a NFS server. Thanks go to bodhi and iSKUNK for this excellent guide.

By the way, it appears that V4 Mobile (not A3 version) plugs are still available on Amazon for 10 bucks (sold by Adorama) for those who are interested.

-nnSlick
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 05, 2020 10:59PM
Well, you can buy two for $15 from Adorama directly or Adorama via eBay with free shipping -- keep one as a backup. :P
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 05, 2020 11:38PM
FYI, I've changed the thread title to make it easier for people to find.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 07, 2020 01:19PM
For the command to restore the MAC address:

Quote

# Restore original MAC address from the stock U-Boot environment
# (actual value redacted)
/tmp # ./tools/fw_setenv ethaddr '00:25:XX:XX:XX:XX'

I found this command from another blog:
fw_setenv ethaddr "$(cat /sys/class/net/eth0/address)"

With this command the MAC address will be set automatically without the need to be jotted down and type in later.

nnSlick
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT?
May 07, 2020 04:53PM
nnSlick,

> fw_setenv ethaddr "$(cat
> /sys/class/net/eth0/address)"

This works only in this box, as this stock OS sees it. In some instances, it will not work to do this when you install new u-boot from a different box. Therefore, in general, it is always best to set it explicitly using the MAC address on the case sticker, or you have saved it in your notes.

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