Welcome! Log In Create A New Profile

Advanced

Clarification / Pogo-E02

Posted by Adam 
Clarification / Pogo-E02
January 15, 2015 05:35PM
ok, so i bought two more Pogo-E02 units after the two i bought about a month ago, and now that im not as rushed, i want to make sure i do this all properly.

i found a relatively simple way to do things for my second one in the link below, but still had to make some tweaks after to change to ext3
http://forum.doozan.com/read.php?2,18894


Clarification time!

has Jeff abandoned the main debian script he made at http://projects.doozan.com/debian/ ? (it would be nice to know officially that it doesnt actually work anymore)

is there not a guide as simple as Jeff's original to follow anymore? (not that i am not appreciative of your posts bodhi, i just like being able to paste in one set of commands, reboot, and be done!)
Re: Clarification / Pogo-E02
January 15, 2015 11:17PM
Adam,

> has Jeff abandoned the main debian script he made
> at http://projects.doozan.com/debian/ ? (it would
> be nice to know officially that it doesnt actually
> work anymore)

Jeff has stopped maintaining the script. The u-boot part still works fine, but it installs the 2011.x u-boot. The Debian part is not up-to-date anymore so it is problematic.

>
> is there not a guide as simple as Jeff's original
> to follow anymore?

No script that does both U-boot and Debian like Jeff's.

(not that i am not appreciative
> of your posts bodhi, i just like being able to
> paste in one set of commands, reboot, and be
> done!)

Not at all :) I understood the convenience of a script like Jeff's, and has started to update it, but never have enough time to work on it. The script is easy to write, but time consuming to test, because all possible scenarios need to be taken care of (we don't want to let it brick the device automatically :). I am working on updating Jeff's u-boot script, but need to allocate time to finish it.

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



Edited 1 time(s). Last edit at 01/15/2015 11:27PM by bodhi.
Re: Clarification / Pogo-E02
January 19, 2015 03:35PM
OK. im going to read through your posts and try to come up with simple instructions to get a pogo-e02 from stock to the latest u-boot, with debian on an ext4 drive, and you tell me if it should work (if that is ok :)

i naively thought that this was just like my default wheezy server at home, and was quite confused then i couldnt find some logs im used to in /var/log/ Is there a more feature full version of the rootfs that i can use? (i may not be asking the right question, so let me know if i should clarify)
Re: Clarification / Pogo-E02
January 19, 2015 03:50PM
Adam,

Don't try to overthink it. Simply do it in this order:

1. Create new rootfs on new usb stick
2. Update u-boot while in stock Pogo OS
3. Boot with new rootfs usb

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Clarification / Pogo-E02
January 19, 2015 06:59PM
im actually trying to super simplify it by having all the code and instructions in order that i have to execute :)


[EDIT]
got this part! while the instructions say /usr/bin, the tools are actually installed to /usr/sbin

i ended up starting in on the first one by running:
"""
cd /tmp
wget http://projects.doozan.com/uboot/install_uboot_mtd0.sh
chmod +x install_uboot_mtd0.sh
./install_uboot_mtd0.sh
"""
from http://projects.doozan.com/uboot/
(and that went very smoothly)

buuuuut...
It says:
"""
The script will install these utilities in /usr/bin in your Pogoplug environment:

fw_printenv
fw_setenv <param> <value>
"""

but after i ran the scrupt, the commands are not there.... did i miss something?



Edited 1 time(s). Last edit at 01/19/2015 07:05PM by Adam.
Re: Clarification / Pogo-E02
January 19, 2015 08:48PM
ok after reading about the u-boot update process, im not sure i want to go through with it... from what i understand, other users here have no issues with the old u-boot in terms of stability :)

this brings me back to my unanswered question from earlier:
"""
Is there a more feature full version of the rootfs that i can use? (refering partly to the lack of what i think is rsyslog)
"""

thanks
Re: Clarification / Pogo-E02
January 19, 2015 10:14PM
If you want rsyslog, install it yourself. I did.
Re: Clarification / Pogo-E02
January 20, 2015 04:26AM
This basic rootfs is a bare bone system, which serves 2 purposes:

- For beginners to learn Linux by installing whatever packages that are needed to make it a full feature OS. Simply "apt-get install" whatever you need.
- For advance users, who don't like to have to remove stuff that they don't need (it's a pristine, newly created system that has not been used before). I created this rootfs using Debian debootstrap, and then install a minimum number of packages to make it convenience enough to start building your own system, but not bloated.

Quote

Is there a more feature full version of the rootfs that i can use? (refering partly to the lack of what i think is rsyslog)

Either do what Frederick suggested above, or:
http://forum.doozan.com/read.php?2,18606,18632#msg-18632

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Clarification / Pogo-E02
January 21, 2015 09:29AM
for some reason i didnt think it would be as easy as just adding more packages!

i just installed rsyslog and things look more normal. thanks guys!
Re: Clarification / Pogo-E02
January 21, 2015 03:21PM
I used to modify Jeffs script in order to install new uboots on a number of devices, my diffs can be found here

http://forum.doozan.com/read.php?3,14697,16312#msg-16312

Recently I have made my own script based on the same ideas, but much simpler, just a way for me to quickly keep my kirkwoods up-to-date. It requires that you manually download the uboot images, and have the necessary flash-access programs available.

I have a NFS exported directory which i just mount on the unit I am going to upgrade. The content is:
./bin/blparam
./bin/flash_erase
./bin/fw_printenv
./bin/fw_setenv
./bin/nanddump
./bin/nandwrite
./my.environment.img
./uboot.2014.07-tld-2.dockstar.mtd0.kwb
./uboot.2014.07-tld-2.environment.img
./uboot.2014.07-tld-2.pogo_e02.mtd0.kwb
./uboot.2014.07-tld-2.pogo_v4.mtd0.kwb
./update_uboot.sh

If any-body have a similar need, please feel free to use my script for inspiration

If you are only doing a single system, it is better to follow the instructions bodhi supplies.

Best Regards
Peter

here comes the content of update_uboot.sh
#!/bin/sh
#
# Install newest uBoot on mtd0
# ideas and valid-uboot.md5 from Jeff doozan
# using the uboots from bodhi http://forum.doozan.com/read.php?3,12381
#
echo DANGER, only use if you know what to do when things go wrong. comment this line if you do;exit

# md5sums from http://jeff.doozan.com/uboot/valid-uboot.md5
grep -v "^#" >/tmp/valid-uboot.md5 <<EOF
b2d9681ef044e9ab6b058ef442b30b6e dockstar original
5cbbbca7693c5939836349bbd7f270e8 goflexnet original
9b940e0b3b5a523f8b50ef0fa50af97f goflexhome original
c7b77a049725096d83db958f39b2c0c3 pinkpogo original
7e454d6b669ddadf3e97a2bf562653fa pogov1 original
3a6f82e07f89e569d721f1f8b25096c2 dockstar jeff-2010-08-07
76a3ff87a2a2df5ab129319c6cf14089 dockstar jeff-2010-08-23
21196b4c6bf2f7ef94b9ddf7d44f5272 dockstar jeff-2010-08-24
447561d59678984205324463d003311f dockstar jeff-2010-08-25
7acb243fb8c3f131f1a165b3dc64faaf dockstar jeff-2010-08-30
ebd566de30c6521e65fb1255415c037f dockstar jeff-2010-10-23
ebd566de30c6521e65fb1255415c037f pogov1 jeff-2010-10-23
2774216e13c4e46bb7e554b9a3eb1dfb goflexnet jeff-2010-10-23
0eb4684426a96efd12574c1ea9b52b6f pinkpogo jeff-2010-10-23
e18a2c7e308c249bc16f55bbaad31f50 dockstar davygravy-2012-02-12-current
e18a2c7e308c249bc16f55bbaad31f50 pogov1 davygravy-2012-02-12-current
e84a5fd0a0205bb79aed07c3c6fbd145 pinkpogo davygravy-2012-02-20-current
77ce1df732843774e5257b615ba8a9db goflexnet davygravy-2012-04-19-current
77ce1df732843774e5257b615ba8a9db goflexhome davygravy-2012-04-19-current
#  md5sums below added_by_peter_lorenzen
ec62667e96e893c77f163f31b8d268cf pogo_v4 original
b96574b1ee60d525be7e3c8bceeb6fda pogo_v4 ebbes-2014-03-19-current
ef326d50277b6fa8cba02bc0032875ed dockstar uboot.2014.07-tld-2.dockstar.mtd0.kwb
5b9a551516d177ed716cd8b64f84beea pogo_e02 uboot.2014.07-tld-2.pogo_e02.mtd0.kwb
8f8e8cf2e0f18462fe881988e3e7b3e1 pogo_v4 uboot.2014.07-tld-2.pogo_v4.mtd0.kwb
f2ca69d5ad1147244aabb5da3381bb14 environment uboot.2014.07-tld-2.environment.img
# 142fc6ce939f918622e1fc1b3887de80 environment my.environment.img
EOF
# to use your own custom environment, adjust the last line
# NOTE pogo_e02 == pinkpogo
# when newer version appear, add them to the end of the above list, keep the old ones too.

usage()
{
	echo "$*"
	echo "update_uboot <-u> <-e> <-n> <-s>"
	echo "  -u update uboot  DANGER no further questions asked"
	echo "  -e update environment DANGER no further questions asked"
	echo "  -n setup boot from nfs, last priority"
	echo "  -s just check status of uboot (default)"
	exit
}
error()
{
	echo $* -- please FIX
	exit
}
version()
{
	strings $1 |awk '/^U-Boot/ { if (length($0) > length(string)) string=$0} END {print string}'
}
install_uboot()
{
	NEW=`grep " $PLATFORM " /tmp/valid-uboot.md5 | tail -1`
	NEW_MD5=`echo $NEW | cut -f1 -d' '`
	NEW_UBOOT=`echo $NEW | cut -f3 -d' '`
	if [ x$MD5 = $NEW_MD5 ]; then
		echo "  already on newest"
		return
	fi
	if [ ! -f $NEW_UBOOT ]; then
		error "download and unpack $NEW_UBOOT, from http://forum.doozan.com/read.php?3,12381";
	fi
	MD5=`md5sum $NEW_UBOOT | cut -f1 -d' '`
	grep $MD5 /tmp/valid-uboot.md5 >/dev/null
	if [ $? != 0 ]; then
		error Current uBoot unknown
	fi
	echo "INSTALL -- `version $NEW_UBOOT` -- $NEW_UBOOT --"
	if [ xYES != x$DO_INSTALL_UBOOT_WITHOUT_ASKING ]; then
		echo "no harm done to uboot"
		return
	fi
	flash_erase /dev/mtd0 0 4	# Erase the first 4 blocks (512k)
	nandwrite /dev/mtd0 $NEW_UBOOT
	nanddump --noecc --omitoob -l 0x80000 -f /tmp/mtd0-dump /dev/mtd0
	MD5=`md5sum /tmp/mtd0-dump | cut -f1 -d' '`
	if [ $MD5 != $NEW_MD5 ]; then
		error "checksum failed - DO NOT POWEROFF"
	fi
	echo "uBoot Succesfully installed -- `version /tmp/mtd0-dump`"
}
install_env()
{
	echo "	 uBoot environment"
	if [ xYES = x$ON_NEVER_UBOOT ]; then
		echo allready on newer uboot, env update is not strictly necessarry
	fi 
	if [ xYES = x$DO_INSTALL_UBOOT_WITHOUT_ASKING -a  xYES != x$DO_INSTALL_U_ENV_WITHOUT_ASKING ]; then
		usage upgrade of original uboot, new env MUST be installed
	fi
	NEW=`grep " environment " /tmp/valid-uboot.md5 | tail -1`
	NEW_MD5=`echo $NEW | cut -f1 -d' '`
	NEW_ENV=`echo $NEW | cut -f3 -d' '`
	if [ ! -f $NEW_ENV ]; then
		error "download and unpack $NEW_ENV, from http://forum.doozan.com/read.php?3,12381";
	fi
	echo "INSTALL -- Environment -- $NEW_ENV"
	MD5=`md5sum $NEW_ENV | cut -f1 -d' '`
	if [ $MD5 != $NEW_MD5 ]; then
		error "  md5 on $NEW_ENV does not match"
	fi
	echo "ENV arcNumber=$arcNumber machid=$machid ethaddr=$ethaddr"
	if [ xYES != x$DO_INSTALL_U_ENV_WITHOUT_ASKING ]; then
		echo "no harm done to uboot env"
		return
	fi
	flash_erase /dev/mtd0 0xc0000 1
	nandwrite -s 786432 /dev/mtd0 $NEW_ENV
	nanddump --noecc --omitoob -f /tmp/mtd0-dump -s 0xc0000 -l 0x20000 /dev/mtd0
	MD5=`md5sum /tmp/mtd0-dump | cut -f1 -d' '`
	if [ $MD5 != $NEW_MD5 ]; then
		error "checksum failed after flash of environment - DO NOT POWEROFF"
	fi
	fw_setenv ethaddr $ethaddr
	fw_setenv arcNumber $arcNumber
	fw_setenv machid $machid
	echo "uBoot ENV from \"$NEW_ENV\" Succesfully installed --- $NEW_ENV arc=$arcNumber ($ethaddr)"
}
install_nfs_boot()
{
	if [ xYES != x$DO_INSTALL_U_NFS_WITHOUT_ASKING ]; then
		echo "nfs_boot not installed into env"
		return;
	fi
	fw_setenv ipaddr
	fw_setenv serverip
	fw_setenv nfs_init 'setenv autoload no; dhcp; setenv options root=/dev/nfs rootfstype=nfs rootwait nfsroot=$rootpath ip=$ipaddr:$serverip:$gatewayip:$n
etmask:$hostname:eth0:off'
	fw_setenv nfs_load 'nfs $addr $rootpath/boot/$file'
	fw_setenv set_bootargs 'setenv bootargs console=$console $options $mtdparts'
	fw_setenv boot 'run ${dev}_init; run set_bootargs; echo ** ${dev} Booting -- $bootargs; mw 0x800000 0 1; addr=0x800000; file=uImage; run ${dev}_load; addr=0x1100000; file=uInitrd; if run ${dev}_load; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'
	fw_setenv bootcmd_nfs 'dev=nfs;run boot'
	BOOTCMD=`fw_printenv bootcmd | sed -e 's/^[^=]*=//' -e 's/; run bootcmd_nfs//' -e 's/; reset//'`
	fw_setenv bootcmd "$BOOTCMD; run bootcmd_nfs; reset"
}
#### Main script starts here ####
while getopts "uens" o; do
	case "${o}" in
	u) DO_INSTALL_UBOOT_WITHOUT_ASKING=YES;;
	e) DO_INSTALL_U_ENV_WITHOUT_ASKING=YES;;
	n) DO_INSTALL_U_NFS_WITHOUT_ASKING=YES;;
	s) DO_STATUS;;
	*) usage wrong options;;
	esac
done
PATH=`pwd`/bin:$PATH # newer fw_setenv will not set ethaddr, use ours
export PATH
for i in blparam flash_erase fw_printenv fw_setenv nanddump nandwrite strings md5sum;do
	if ! type $i; then
		usage $i not found, please install f.ex in ./bin
	fi
done

echo "	 Validating existing uBoot"
nanddump --noecc --omitoob -l 0x80000 -f /tmp/mtd0-dump /dev/mtd0 2>/dev/null
if [ $? != 0 ]; then error nanddump failed; fi

MD5=`md5sum /tmp/mtd0-dump | cut -f1 -d' '`
LINE=`grep $MD5 /tmp/valid-uboot.md5`
if [ $? != 0 ]; then
	error "Unknown current uBoot: `version /tmp/mtd0-dump`"
fi
PLATFORM=`echo $LINE | cut -f2 -d' '`
UBOOT=`echo $LINE | cut -f3 -d' '`

echo Current --  `version /tmp/mtd0-dump` -- $UBOOT -- $PLATFORM


if [ -f /proc/board_type -o $UBOOT = original ]; then
	killall hbwd
	mount -o remount,rw /
	echo "/dev/mtd0 0xc0000 0x20000 0x20000" > /etc/fw_env.config  # fw_setenv requires it
	eval `blparam | grep ethaddr`
	eval `blparam | grep ceboardver`
	case $ceboardver in
	REDSTONE:1.0)	arcNumber=2998; machid=; PLATFORM=dockstar ;;
	PPV2)		arcNumber=3542; machid=dd6; PLATFORM=pogo_e02 ;;
	PPV4A1)		arcNumber=3960; machid=f78; PLATFORM=pogo_v4 ;;
	*) error unknown ceboardver=$ceboardver;;
	esac
else
	ON_NEVER_UBOOT=YES
	eval `fw_printenv ethaddr`
	eval `fw_printenv arcNumber`
	eval `fw_printenv machid`
	case $arcNumber in
	2998) PLATFORM=dockstar ;;
	3542) PLATFORM=pogo_e02 ;;
	3960) PLATFORM=pogo_v4 ;;
	*) error unknown arcNumber=$arcNumber;;
	esac
fi
if [ x$ethaddr = x ]; then error ethaddr not set in uboot environment - FIX; fi

install_uboot

install_env

install_nfs_boot

echo "Done"



Edited 1 time(s). Last edit at 01/22/2015 10:08AM by storepeter.
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: