On 10/17/2013 05:40 PM, chrono wrote:
> Ahoi everyone,
> 
> it was requested on IRC that I send my solution to the entropy problem
> with the current
> kernel (e.g. having 0 available entropy):
> 
> root@OpenWrt:/# cat /proc/sys/kernel/random/entropy_avail
> 0
> 
> In the build root I've patched
> 
> build_dir/linux-ar71xx_nand/linux-3.3.8/arch/mips/include/asm/timex.h
> 
> --- timex.h?id=refs%2Ftags%2Fv3.3.8     2013-10-17 17:23:12.000000000 +0200
> +++ timex.h     2013-10-17 17:07:59.888938183 +0200
> @@ -35,7 +35,13 @@
> 
>  static inline cycles_t get_cycles(void)
>  {
> -       return 0;
> +
> +       if (cpu_has_counter) {
> +               return read_c0_count();
> +       }
> +       else {
> +               return 0;       /* no usable counter */
> +       }
>  }
> 
>  #endif /* __KERNEL__ */
> 
> After applying and rebuilding the kernel:
> 
> root@OpenWrt:/# cat /proc/sys/kernel/random/entropy_avail
> 162
> 
> This was tested on mips32r2/24kc (Mikrotik Routerboard 450G) but it
> might work
> for others as well. Until this is fixed upstream and openwrt follows up
> with
> the kernel, it might be an easy fix for some people in order to have better
> entropy for SSL/VPN.
> 
> Hopefully it will be useful to someone,
> 
> chrono

A similar patch was applied to trunk in r38834.

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to