[LEDE-DEV] ramips: image validator and board variants

Felix Fietkau nbd at nbd.name
Thu Dec 8 09:16:50 PST 2016


On 2016-12-06 17:54, John Crispin wrote:
> 
> 
> On 05/12/2016 10:17, Mathias Kresin wrote:
>> Hey John, Hey Felix
>> 
>> I'm near to finished with porting the remaining ramips devices to the
>> new image build code. While doing this, I might have spotted a ramips
>> specific issue with the new image validation feature in regard of build
>> variants of boards.
>> 
>> At the moment the build code of for example 4 MByte and 8 MByte flash
>> variants of a single board uses the same SUPPORTED_DEVICES string, to
>> match the name exported in /lib/ramips.sh. Albeit the situation is
>> already way better than without any validation, it would allow to flash
>> a 8 MByte image on a the board version with only 4 MByte flash.
>> 
>> I can only guess this solution/workaround/hack was chosen to avoid
>> touching files which setup led related stuff. No idea why this
>> limitation wasn't mentioned in the commit message.
>> 
>> To de-duplicate stuff on ramips, the LEDs are referenced as
>> $board:color:name, where $board is the name exported by /lib/ramips.sh.
>> In all cases, build variants of a board are sharing the device tree led
>> node, which has the leds named like "asl26555:red:power" for the
>> asl26555-8M and asl26555-16M.
>> 
>> My question is now, how to handle such cases?
>> 
>> a) use a shared SUPPORTED_DEVICES string and life with the 80% solution
>> 
>> b) add an exception for these boards and use the asl26555:color:name
>> pattern instead of $board:color:name at the relevant places
>> 
>> c) there is another solution that I've missed
>> 
>> Mathias
> 
> ideally we can detect the difference between asl26555-8M and
> asl26555-16M for the image flashing only. maybe we can add a third file
> under /tmp/sysinfo/ and use it for the metadata stuff if present. if not
> present fall back to the current code path
I would like to avoid adding yet another file to /tmp/sysinfo, it's
better to adjust the board name.

The LED board.d codepath could do this:
board="${board%-[0-9]*M}"

- Felix



More information about the Lede-dev mailing list