Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] grimoire function to check minimum kernel ver

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Juuso Alasuutari <iuso AT sourcemage.org>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] grimoire function to check minimum kernel ver
  • Date: Tue, 4 Apr 2006 14:30:44 +0300

I'll send this again because the first time I did I replied to some other
thread and just changed the subject line, and I've since learned that this
might not be the wisest thing to do if one wants others to see the mail...

Also the first version of the function was bloated as hëll because I hadn't
yet realized how well [[ ]] handles variable comparison. Silly me.

So here it is again, this time much slimmer:

function is_kernel_minimum() {
local CUR=`get_kernel_version`
CUR=`expr $CUR : '\(^[^-]*\)'`
if [[ $CUR < $1 ]]; then
return 1
fi
}


On Sunday 02 April 2006 15:22, Juuso Alasuutari wrote:
> I wrote a function that checks if current kernel version is equal or newer
> than a given one. It checks the version in any scale, whether >=2.6 or
>
> >=2.6.15 or >=2.6.15.4, etc., and it strips chars beginning from -
>
> (2.6.16-some_norse_god --> 2.6.16).
>
> It could be used to selectively apply patches that fix kernel update
> issues. At the moment at least two spells do that kind of checking (in a
> rudimentary way), svgalib and nvidia_driver. (They're in diff grimoires,
> though, so I don't know if the definition "needed by several spells" is
> fulfilled for this to go into FUNCTIONS...)
>
> Of course it could also be used to negatively check whether kernel ver is
> too recent.




Archive powered by MHonArc 2.6.24.

Top of Page