Skip to contentSkip to conversation

Determining barebox version from linux

DISCUSSION Marc Reilly 3 participants 3 messages Dec 23, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

I want to be able to determine what version of barebox I have on my NOR flash, after booting into linux.

The easiest way I thought of is something like:
cat /dev/mtd0 | grep "barebox 2010"

Another way to do this is to have the version_string (or other version info) at a fixed location in the barebox image. This feels like a overly rigid solution, and may be a pain to put into the build system.

Does anybody else accomplish this in a better way? (I don't want to pass the barebox version as an arg when booting the kernel - I'd rather it be more "standalone").

Cheers
Marc

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

Hi Marc,

Quoted 2 lines · Marc Reilly

I want to be able to determine what version of barebox I have on my NOR flash, after booting into linux.

[snip]

Quoted 3 lines

Does anybody else accomplish this in a better way? (I don't want to pass the barebox version as an arg when booting the kernel - I'd rather it be more "standalone").

I set the board revision number, using armlinux_set_revision(), to pass the version of the bootloader to the kernel, and then extract it from the 'Revision' field in /proc/cpuinfo. This solution is ARM specific, though.

baruch

Signature · 8 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email protected] - tel: +972.2.679.5364, http://www.tkos.co.il -

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw
Quoted 8 lines · Baruch Siach

Hi Marc,

Quoted 2 lines · Marc Reilly

I want to be able to determine what version of barebox I have on my NOR flash, after booting into linux.

[snip]

Quoted 7 lines
Quoted 3 lines

Does anybody else accomplish this in a better way? (I don't want to pass the barebox version as an arg when booting the kernel - I'd rather it be more "standalone").

I set the board revision number, using armlinux_set_revision(), to pass the version of the bootloader to the kernel, and then extract it from the 'Revision' field in /proc/cpuinfo. This solution is ARM specific, though.

It will be better to have a std way as you mqy ise the system_rev for other stuff as example on some at91

I sync we could generate a /etc/version in the env and then export it in linux via the fs

I think we could do like this

in barebox itself we keep a default read only fs (default env) that we merge the same way as a unionfs in barebox to avoid duplication and allow non modifable file with the rw env

and we will do it in linux also

so linux can get the data from barebox and modify it

Best Regards,
J.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox