New IT forum
26 June 2022, 05:56:26 pm *
Welcome, %1$s. Please login or register.

: CubieBoard 2 and Cubietruck both now in stock.
 
Pages: [1]

Author Topic: Get u-boot version & envir vars from linux  (Read 13474 times)

maisondouf

  • Jr. Member
  • **
  • Posts: 68
  • Crazy hacker's family since 1982
Get u-boot version & envir vars from linux
« on: 12 June 2010, 07:14:58 pm »

if your mtd partitions are well defined in uboot envirenment, you can see the uboot nand partition as this

Quote
[email protected]:~#cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "uboot"
mtd1: 00400000 00020000 "uImage"
mtd2: 1ef00000 00020000 "rootfs"
mtd3: 00c00000 00020000 "debian"
[email protected]:~#

The important thing is to see if a "uboot" named partition exists and its position is "0" (Sizes and addresses are not relevant)

If yes, type this :
Quote
[email protected]:~#grep -a --null-data U-Boot /dev/mtd0ro | cut -d'I' -f1 | grep -a Marvell
U-Boot 1.1.4 (Jul 14 2009 - 06:46:57) Marvell version: 3.4.16
[email protected]:~#
« Last Edit: 16 June 2010, 01:04:37 pm by maisondouf »
Logged
NSLU2 owner since 4 years...
Very new owner of a black eSata Sheevaplug.
(Wiki en fran├žais http://plug.maisondouf.fr)

maisondouf

  • Jr. Member
  • **
  • Posts: 68
  • Crazy hacker's family since 1982
Re: Get u-boot version from linux
« Reply #1 on: 12 June 2010, 07:44:41 pm »

As well, you can save your environment with this script:

Quote
#! /bin/sh
dd if=/dev/mtd0ro of=uboot-current-env bs=65536 count=4 skip=10
cat uboot-current-env | sed -e 's/\xFF//g' | sed -e 's/\x00\x00//g' | sed -e 's/\x00/\n/g' | dd of=tt bs=1 skip=4
echo "`cat tt`" >envir
rm tt

then you have a file named "envir" with a copy of u-boot evironment.
« Last Edit: 16 June 2010, 09:28:14 pm by maisondouf »
Logged
NSLU2 owner since 4 years...
Very new owner of a black eSata Sheevaplug.
(Wiki en fran├žais http://plug.maisondouf.fr)
Pages: [1]
 
 

Powered by MySQL Powered by PHP SMF 2.0.10 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!