[U-Boot] Rewriting fw_{printenv,getenv} to not use fgets

Alex Kiernan alex.kiernan at gmail.com
Wed Jun 6 16:33:16 UTC 2018


The line length limit that fw_{printenv,setenv} impose (1024
characters) has tripped me up twice in as many days, so I figured I'd
rewrite it to use getline as we already have that in tools/.

But in looking how I structure that change, I've immediately run into
questions...

Right now I have a horrid hack that just pulls in ../getline.[ch], but
I'm thinking I should hoist the build of the environment tools, into
tools/Makefile from tools/env/Makefile, move getline.c into tools/lib
and then patch the trivial change in to swap from fgets to getline in
then.

I'm aware this also gets used as a library, so I'm guessing I need to
make linking of getline.c conditional somehow.

Does that make sense? Or should I be attempting it some other way.

-- 
Alex Kiernan


More information about the U-Boot mailing list