当前位置: 首页 > news >正文

大兴安岭做网站/百度seo推广是什么

大兴安岭做网站,百度seo推广是什么,吉安网站建设,用JSP做的网站的缺点GitHubCSDNKernelShow知乎掘金NACHENG JianNA3584592006977729781592915999 1 问题描述 最近自己编译内核安装内核的时候, 总是遇到 /lib/modules 下空间不够, 导致内核安装有问题. 所以就想裁剪下. 分析的时候发现, 系统原生内核 /lib/modules/uname -r 目录驱动大小只有 100M…
GitHubCSDNKernelShow知乎掘金
NACHENG JianNA3584592006977729781592915999

1 问题描述


最近自己编译内核安装内核的时候, 总是遇到 /lib/modules 下空间不够, 导致内核安装有问题. 所以就想裁剪下.
分析的时候发现, 系统原生内核 /lib/modules/uname -r` 目录驱动大小只有 100M 左右, 但是我自己编译的驱动目录 1.4G 左右.

2 问题分析


2.1 问题原因


如果我们内核开启了 CONFIG_DEBUG_INFO 选项, 那么我们编译的二进制会带上很多调试信息. 内核镜像 Image 都是经过裁剪和优化的. 但是驱动没有. 所以导致单个 KO 的大小就很大.

因此可以把每个 KO 都 strip 一下子.

make modules_install 安装驱动之后, strip 一下子.

find /lib/modules/XXX -name *.ko | xargs strip -g

2.2 INSTALL_MOD_STRIP 选项


内核难道没有提供现成的选项么:

https://elixir.bootlin.com/linux/v5.3.6/source/Documentation/kbuild/kbuild.rst#182

https://elixir.bootlin.com/linux/v5.3.6/source/Documentation/kbuild/makefiles.rst#L1481

The default kernel configuration is configured to support as many hardware as possible. A non-stripped kernel with default configuration resulted in a size of 1897996 kB (including kernel + modules). When stripping many unnecessary drivers and options, it resulted in a size of 892892 kB which is a size reduction of 53% compared to the stock kernel.When installing the kernel modules, append the INSTALL_MOD_STRIP=1 option. This will strip all debugging symbols and reduced the size by 92% for me (from 892892 kB to 69356 kB). Note this will only affects modules to be installed and not the kernel (vmlinuz) itself.Use the INSTALL_MOD_STRIP option for removing debugging symbols:# make INSTALL_MOD_STRIP=1 modules_install
Similarly, for building the deb packages:
# make INSTALL_MOD_STRIP=1 deb-pkg

2.3 INSTALL_MOD_STRIP 的实现


如果在 build and install ko 的时候(make modules_install) 的时候加上INSTALL_MOD_STRIP =1的话
则build ko的时候 会加上–strip-debug 这样会让build出的ko size大幅缩小.
具体是在 kernel 根目录下面 Makefile 中有对INSTALL_MOD_STRIP=1 进行处理

#
# INSTALL_MOD_STRIP, if defined, will cause modules to be
# stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
# the default option --strip-debug will be used. Otherwise,
# INSTALL_MOD_STRIP value will be used as the options to the strip command.ifdef INSTALL_MOD_STRIP
ifeq ($(INSTALL_MOD_STRIP),1)
mod_strip_cmd = $(STRIP) --strip-debug
else
mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP)
endif # INSTALL_MOD_STRIP=1
else
mod_strip_cmd = true
endif # INSTALL_MOD_STRIP
export mod_strip_cmd

可见

  • 如果设置了 INSTALL_MOD_STRIP 为 1, 那么 mod_strip_cmd = strip --strip-debug
  • 如果设置了 INSTALL_MOD_STRIP 为其他参数, 那么 mod_strip_cmd = strip $(INSTALL_MOD_STRIP)
  • 如果没设置 INSTALL_MOD_STRIP, mod_strip_cmd 只会设置为 true

最终会在 scripts/Makefile.modinst中用到mod_strip_cmd

# Don't stop modules_install if we can't sign external modules.
quiet_cmd_modules_install = INSTALL $@cmd_modules_install = \mkdir -p $(2) ; \cp $@ $(2) ; \$(mod_strip_cmd) $(2)/$(notdir $@) ; \$(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) ; \$(mod_compress_cmd) $(2)/$(notdir $@)
# Modules built outside the kernel source tree go into extra by default
INSTALL_MOD_DIR ?= extra
ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(patsubst %/,%,$(KBUILD_EXTMOD)),,$(@D))modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))$(modules):$(call cmd,modules_install,$(MODLIB)/$(modinst_dir))

modules_install 中会用驱动拷贝到安装目录, 然后用 mod_strip_cmd 处理驱动.
如果设置了 INSTALL_MOD_STRIP, 就会对驱动做 strip, 否则就什么也不做.

3 参考资料


why-is-install-mod-strip-not-on-by-default

如何編譯(Compile) Linux的核心(Kernel)

http://www.lbrq.cn/news/1371583.html

相关文章:

  • 新手如何建立自己网站/无锡网站排名公司
  • 简易个人网站模板/网站宣传推广文案
  • 佛山移动网站建设公司/关于seo的行业岗位有哪些
  • 广州高端网站制作公司哪家好/seo研究中心骗局
  • 官网建设费用怎么算/野狼seo团队
  • 网页制作教程app/优化大师有用吗
  • 唐山哪个公司可以制作网站/2023上海又出现疫情了
  • 贵阳网站制作专业/谷歌seo是做什么的
  • 博网站建设/广州百度网站排名优化
  • 武汉做网站佳/域名服务器ip查询网站
  • 北京b2b网站开发/郑州seo代理公司
  • 哪里有网站建设培训班/国产免费crm系统有哪些在线
  • 网站开发工程师职位概要/seo是什么姓
  • 安卓手机如何做网站/seo优化关键词排名
  • 物流网站制作目的/西安百度网站快速排名
  • 网站建站的技术解决方案/创建网站需要多少资金
  • 用wordpress编写网站/seo自媒体培训
  • 建站还有前途么/推广关键词
  • 网站建设如何不被忽悠/百度电脑端网页版入口
  • wordpress很安全/站长工具seo综合查询
  • 多企业宣传网站建设/湖南靠谱的关键词优化
  • 云空间网站开发/西安seo优化培训
  • 营销型网站建设搭建方法/武汉网站推广很 棒
  • 2019年做网站还有前景吗/搜索引擎seo优化
  • 影城网站设计/长沙网站设计拓谋网络
  • 不成立公司怎么做企业网站/竞价关键词优化软件
  • 网站关键词库/上百度推广的网站要多少钱
  • 沈阳和平三好街做网站/萧山seo
  • 东莞市网络公司/谷歌优化排名哪家强
  • 网站建设总体费用/网页seo
  • FreeRTOS源码分析三:列表数据结构
  • Python切片命名技术详解:提升代码可读性与维护性的专业实践
  • Python Seaborn【数据可视化库】 全面讲解
  • 零基础 “入坑” Java--- 十六、字符串String 异常
  • C++对象访问有访问权限是不是在ide里有效
  • SpringBoot+SpringAI打造智能对话机器人