I don't want to be a pain, but I think there might be a bug (sort of) in this very same function.

Here's what I assume is the intended behavior of the function:If you have a boot option foo=bar, you use getbootparam("foo=") and it will return "bar".If you have the boot option "foo", you use getbootparam("foo") and it will return foo. Maybe I'm wrong about this second one, but it seems to (sort of) work this way.

However, depending on how you have written your boot line, it may not return what you expect. If you have a boot option "foobar=bar" or "bar=foo" or "foobar", and you use getbootparam("foo"), it will return "foo".

Of course the more I think about it, the more I wonder if it is actually not intended to be used without "=" as part of the function parameter. In that case, I apologize for bringing this up. If it wasn't intended to be used this way, I think it *could* possibly be fixed to do so, and then you could use the same function to grab either "foo" or "foo=bar" type of boot parameters.

No problem to discuss to all. My intended use was with the "=" sign.At the time, I was writing hundreds of lines of Lua code and probably rushed somethings to work as I wanted, at the moment and likely not the most general or best of breed.

You do bring up good ideas to reflect upon for further improvement.

Your presentation made me think of Klaus' bash functions, checkbootparam and getbootparam. The checkbootparam function behaves as in one of your examples, which would likely not be what would be intended, i.e., foobar=bar, checkbootparam(foo) returns sucess. I have had to always be wary of this, as it has tripped me on occasion.

But I think with all things code, there is always room for improvement especially when revisted.