kernel

compilation linux kernel openssl/opensslv.h error

China☆狼群 提交于 2020-02-06 08:29:25
问题 I am trying to compile a Linux kernel without selecting the TCP/IP protocol in menuconfig but I face this error when I try to compile: scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h: No such file or directory To compile I use this command: fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers I'm working with linux-4.10.1's kernel 回答1: As make-kpkg is a Debian-specific tool, I assume you are using a Debian distribution; you mentioned it is Ubuntu. It

compilation linux kernel openssl/opensslv.h error

半城伤御伤魂 提交于 2020-02-06 08:29:04
问题 I am trying to compile a Linux kernel without selecting the TCP/IP protocol in menuconfig but I face this error when I try to compile: scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h: No such file or directory To compile I use this command: fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers I'm working with linux-4.10.1's kernel 回答1: As make-kpkg is a Debian-specific tool, I assume you are using a Debian distribution; you mentioned it is Ubuntu. It

Ubuntu 配置安卓5.1编译环境

早过忘川 提交于 2020-02-05 13:10:03
输入指令时一定要注意当前路径 1、编译之前需要安装JDK7,并配置JAVA环境变量。 xxx@build:~/RK3288$ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 xxx@build:~/RK3288$ export PATH=$JAVA_HOME/bin:$PATH xxx@build:~/RK3288$ export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar 2、uboot编译,编译完成后,u-boot根目录下会生成RK3288UbootLoader_Vx.xx.xx.bin文件。 rk3288_defconfig 要参照 Z:\RK3288\u-boot\configs目录下此项目的defconfig文件 xxx@build:~/RK3288$ cd u-boot/ xxx@build:~/RK3288/u-boot$ make rk3288_defconfig xxx@build:~/RK3288/u-boot$ make 3、kernel编译,编译完成后,kernel根目录下会生成kernel.img和resource.img文件。 rockchip_defconfig要参照Z:\RK3288\kernel\arch\arm\configs目录下

ASP.NET MVC学前篇之Ninject的初步了解

青春壹個敷衍的年華 提交于 2020-02-04 04:18:16
ASP.NET MVC学前篇之Ninject的初步了解 1.介绍 废话几句,Ninject是一种轻量级的、基础.NET的一个开源IoC框架,在对于MVC框架的学习中会用到IoC框架的,因为这种IoC开源框架有很多,本篇的主题只有一个,就是让阅读过本篇幅的朋友逗知道IoC框架在项目中的作用,以及它的重要性。 这样做的目的是以便在以后的学习工作中选择自己中意的一个IoC框架来学习、使用,或者是自己去实现一个。好了,不废话了。 2.环境准备 1.新建个4.0Framework的一个控制台应用程序项目,名称为IoCDemo 2.在 http://www.ninject.org/download 网页中,下载Version 2.2版本的Ninject程序集(之前版本的不支持4.0库),下载完成解压后会看到如图1里的几个文件,在这里你只需要关心名称为Ninject的文件,其它的忽略掉。 图1 3.在项目中新建个Lib文件夹,并把Ninject.dll、Ninject.pdb和Ninject.xml三个文件拷贝到文件目录下,并且添加引用到项目中。如图2: 图2 环境准备工作做好了,可以安心的来看示例了。捎带一句Ninject.xml文件是程序集文件的注释,不过都是英文的,对于姿势水平不高的屌丝来说这并不算是福利,当然也包括本人。(ps:谷歌翻译什么的很好用) 3.初步认识、了解 从上一篇的文章中

[zz]Improve KVM performance

二次信任 提交于 2020-02-04 03:58:20
In this post I would like to share two tips I have found that greatly improve the performance of KVM guests. Both tips work with Linux guests, although only the second tip will work with windows or BSD guests. With these tips you should notice an immediate improvement in performance including boot times, general performance, and responsiveness to inputs (mouse / keyboard). Kernel option noop With this tip we will use the kernel (boot) option elevator=noop to optimize your virtual hard drive I/O. For a technical discussion of this option, see this link . If you want a more detailed discussion

Why are segfaults called faults (and not aborts) if they are not recoverable?

微笑、不失礼 提交于 2020-02-04 01:20:13
问题 My following understanding of the terminology is this 1) An interrupt is "a notification" that is initiated by the hardware to call the OS to run its handlers 2) A trap is "a notification" that is initiated by the software to call the OS to run its handlers 3) A fault is an exception that is raised by the processor if an error has occurred but it is recoverable 4) An abort is an exception that is raised by the processor if an error has occurred but it is non-recoverable Why do we call it a

轻量级IOC框架:Ninject

帅比萌擦擦* 提交于 2020-02-04 01:17:17
Ninject通过NinjectModule来配置依赖注入(不知道有没有文件配置,在官方教程里没找到相关资料),这里自定义自己的Module: internal class MyModule : Ninject.Modules.NinjectModule  {    public override void Load()    {      Bind<ILogger>().To<FlatFileLogger>();      Bind<ILogger>().To<DatabaseLogger>();    }  }   具体调用方法: private static IKernel kernel = new StandardKernel(new MyModule());  static void Main(string[] args)  {    ILogger logger = kernel.Get<ILogger>();    logger.Write("Bruce Say: Hello Ninject!");    Console.WriteLine("continues..");    Console.Read();  }   通过 kernel.Get<ILogger>() 来获取ILogger的实例,之前在MyModule里先后对ILogger

轻量级IOC框架:Ninject (上)

邮差的信 提交于 2020-02-04 01:15:38
前言 前段时间看Mvc最佳实践时,认识了一个轻量级的IOC框架: Ninject 。通过google搜索发现它是一个开源项目,最新源代码地址是: http://github.com/enkari/ninject/tree/master 用户向导: http://ninject.codeplex.com/wikipage?title=User%20Guide&referringTitle=Home 建议新手请先看看Ninject的介绍: What Is Ninject Why Use Ninject 我节选其中关于Ninject的好处,并翻译如下: Ninject是一个快如闪电、超轻量级的基于.Net平台的依赖注入框架。它能够帮助你把应用程序分离成一个个松耦合、高内聚的模块,然后用一种灵活的方式组装起来。通过使用Ninject配套你的软件架构,那么代码将会变得更加容易编写、重用性强、易于测试和修改。 搜索博客园尚未找到关于Ninject的使用,因此本文发布一个示例作入门级教程。 Ninject入门级示例 像以前的IOC教程那样,拿日志记录做示例应该是非常直观的。 首先编写一个日志记录的接口: public interface ILogger { void Write(string message); } 以及 FlatFileLogger, DatabaseLogger

linux的jiffies

邮差的信 提交于 2020-02-02 12:56:15
在看libvirt如何获取虚拟机的cpu占用率这个问题。计算cpu占用率不可避免的需要直到jiffies的概念。 jiffies是内核中的一个全局变量,用来记录自系统启动一来产生的节拍数。简单描述,就是1s内,内核发起的时钟中断次数。kernel中就使用这个来对程序的运行时间进行统计。这个值实在编译内核时进行设置的。一般有100,250,1000。CONFIG_HZ这个参数就是用来设置1s中的中断次数的。 查看 /proc/stat 可以看到kernel对cpu使用的各项时间进行的统计。 cat /proc/statcpu 1776 10 9610 35061503 4272 0 122 0 0 0cpu0 359 0 1820 8767364 1812 0 40 0 0 0cpu1 398 0 1578 8764789 688 0 18 0 0 0cpu2 593 3 1646 8768085 1076 0 8 0 0 0cpu3 425 6 4564 8761263 694 0 56 0 0 0 cpu的使用率一般包含 user ( 1776 ) 从系统启动开始累计到当前时刻,处于用户态的运行时间,不包含 nice值为负进程。 nice (10) 从系统启动开始累计到当前时刻,nice值为负的进程所占用的CPU时间 system (35061503)

OpenCV学习C++接口:图像锐化

痴心易碎 提交于 2020-02-02 04:54:52
利用拉普拉斯算子进行图像锐化是数字图像处理里比较简单的处理手段,下面的例子参考opencv 2 computer vision application programming cookbook,采用两种方法对输入图像进行拉普拉斯锐化,原理比较简单,故不赘述了。 编译环境:VS2010+OpenCV2.3.1 编程细节: 函数的形参表中,为了防止修改输入图像image,故形参传递为 pass by conference-const ,同时函数体中 指向输入图像的指针 也必须声明为 指向const对象的指针 ,如const uchar *next = image.ptr<const uchar>(j); cv::Mat::row()返回由单行或者单列组成的特定的cv::Mat实例,cv::Scalar(a,b,c)指定每个通道的特定值; 第二种方法中,利用函数cv::filter2D(),需先创建一个核cv::Mat,并对核进行初始化。 code: 1 /*************************************************************** 2 * 3 * 内容摘要:分别用两种方法对输入图像进行拉普拉斯算子锐化,并比较 4 * 两种方法的执行效率,从运行结果来看,第二种方法的效率 5 * 更高。 6 * 作 者:刘军(Jacky Liu) 7 *