Search Linux Wireless

Re: [PATCH 3/9] compat-wireless: add support for kernel 3.XX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 2 June 2011 18:35, Hauke Mehrtens <hauke@xxxxxxxxxx> wrote:
> --- a/scripts/gen-compat-autoconf.sh
> +++ b/scripts/gen-compat-autoconf.sh
> @@ -155,6 +155,14 @@ for i in $(egrep '^CONFIG_|^ifdef CONFIG_|^ifndef CONFIG_|^endif #CONFIG_|^else
> Â Â Â Â Â Â Â Âecho "#$i" | sed -e 's/+/ /' -e 's/\(ifndef CONFIG_COMPAT_KERNEL_26\)\([0-9]*\)/if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,\2))/' -e 's/\(#ifndef \)\(CONFIG_[^:space:]*\)/#if !defined(\2) && !defined(\2_MODULE)/'
> Â Â Â Â Â Â Â Âcontinue
> Â Â Â Â Â Â Â Â;;
> + Â Â Â 'ifdef+CONFIG_'* )
> + Â Â Â Â Â Â Â echo "#$i" | sed -e 's/+/ /' -e 's/\(ifdef CONFIG_COMPAT_KERNEL_3\)\([0-9]*\)/if (LINUX_VERSION_CODE < KERNEL_VERSION(3,\2,0))/' -e 's/\(#ifdef \)\(CONFIG_[^:space:]*\)/#if defined(\2) || defined(\2_MODULE)/'
> + Â Â Â Â Â Â Â continue
> + Â Â Â Â Â Â Â ;;
> + Â Â Â 'ifndef+CONFIG_'* )
> + Â Â Â Â Â Â Â echo "#$i" | sed -e 's/+/ /' -e 's/\(ifndef CONFIG_COMPAT_KERNEL_3\)\([0-9]*\)/if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,\2,0))/' -e 's/\(#ifndef \)\(CONFIG_[^:space:]*\)/#if !defined(\2) && !defined(\2_MODULE)/'
> + Â Â Â Â Â Â Â continue
> + Â Â Â Â Â Â Â ;;

I admit, I don't have much shell script experience, but I'm surprised
that having the same case multiple times works.
I would probably just add the -e ' ... KERNEL_3\... ' part to the
original sed lines (they are already much too long anyway ;-).

> Â Â Â Â'else+#CONFIG_'* | 'endif+#CONFIG_'* )
> Â Â Â Â Â Â Â Âecho "#$i */" |sed -e 's/+#/ \/* /g'
> Â Â Â Â Â Â Â Âcontinue
> @@ -184,7 +192,12 @@ done
> Â# Deal with special cases. CONFIG_MAC80211_QOS is such a case.
> Â# We handle this specially for different kernels we support.
> Âif [ -f $KLIB_BUILD/Makefile ]; then
> - Â Â Â SUBLEVEL=$(make -C $KLIB_BUILD kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
> + Â Â Â MAJORLEVEL=$(make -C $KLIB_BUILD kernelversion | sed -n 's/^\([0-9]\)\..*/\1/p')
> + Â Â Â if [ $MAJORLEVEL -eq 2 ]; then
> + Â Â Â Â Â Â Â SUBLEVEL=$(make -C $KLIB_BUILD kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
> + Â Â Â else
> + Â Â Â Â Â Â Â SUBLEVEL=99
> + Â Â Â fi

You could drop setting sublevel to 99 by changing

> Â Â Â Âif [ $SUBLEVEL -le 22 ]; then

to

 Â Â Â Âif [ $MAJORLEVEL -eq 2 -a $SUBLEVEL -le 22 ]

this would be a bit cleaner IMHO.


Jonas
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux