From: <ch...@su...> - 2013-06-19 10:51:53
|
Hi! > >>> +if [[ -n "$LINUX_VERSION_MAJOR" -a -n "$LINUX_PATCHLEVEL" ]]; then > >>> + WITH_MODULES="yes" > >> If there is Makefile and it contains reasonable content, proceed > >> with module build, ok. > >> > >>> +else > >>> + WITH_MODULES="no" > >>> + if test -n "$LINUX_VERSION"; then > >>> + LINUX_VERSION_MAJOR=`echo "$LINUX_VERSION" | \ > >>> +sed -n 's/\([[0-9]]\).*$/\1/p'` > >>> + LINUX_PATCHLEVEL=`echo "$LINUX_VERSION" | \ > >>> +sed -n 's/^[[0-9]]*.\([[0-9]]\).*$/\1/p'` > >>> + fi > >> Here we set the MAJOR and PATCHLEVEL even if WITH_MODULES is set to no. > >> Is this useful? (Maybe I overlooked something but when WITH_MODULES is > >> set to no, the kernel version is not needed. Or is this here just in > >> case we will need that someday?) > >> > > Yes, it is true, those variables won't be used if WITH_MODULES is set > > to "no". > > My thought was that they might be of use in the future, so far as we > > have something > > in LINUX_VERSION, why not to get MAJOR & PATCHLEVEL from it. But for > > now they're > > useless. > Should I remove it? Well I personally don't tend to add anything that is not used or is not planned to be used in the near future. > One more thing, would it be better to use LINUX_VERSION_MAJOR & > LINUX_VERSION_PATCH? Either one is fine. -- Cyril Hrubis ch...@su... |