Previous commit added an environment file with command substitution,
which is not possible. This commit fixes that by generating the file
during build. This solution should be reasonably robust, because for
every image there is only a single kernel version.