On Jan  4, 2011, Richard Stallman <[email protected]> wrote:

>     That the kernel would include a session, build or release id as part of
>     the hashed string, and it would provide userland with that string so
>     that it would be included in the computation that searches for the
>     firmware.

> How could this be useful?  I just don't get it at all.

Varying the string would make it harder for people to publish “cheat
sheets” that would render the mangling obsolete, while still enabling
firmware to be found if it is installed.

Say, kernel driver used to request_firmware("foobar/blobname.fw"...)

We compute the hash of "`uname -r`/foobar/blobname.fw", and ask the
userland hotplug script for %x of that hash number.

Userland hotplug script runs e.g.

find /lib/firmware ! -type d -print |
sed "s,^/lib/firmware/,," |
{
  requested=`cat /sys/...`
  pfx=`uname -r`/ # could be /sys/.../hashprefix instead
  found=
  while read file; do
    if test `echo -n $pfx$file | md5sum` = "$requested  -"; then
      found=$f
      break
    fi
  done
  if test -n "$found"; then
    cat /lib/firmware/$found > /sys/...
  else
    ...
  fi
}


-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

Reply via email to