Fedora启动时加载内核模块

最近在封装Fedora的ISO作为产品的安装部署工具,发现之前使用CentOS的启动加载内核的方式已经不适用了,无法在启动时加载。经过搜索引擎的帮助,和官方文档,发现fedora的机制和centos不一致。

这里以8021q这个支持vlan的kmod为示例进行说明

CentOS方式

在CentOS中自动加载内核模块,需要在/etc/sysconfig/modules/目录中增加一个脚本,在此脚本中加载所需的模块,名为8021q.modules,用来自动加载8021Q模块:

#! /bin/sh

/sbin/modinfo -F filename 8021q > /dev/null 2>&1
if [ $? -eq 0 ]; then
    /sbin/modprobe 8021q
fi

重启之后就可以自动加载8021q了

Fedora方式

在fedora中增加预加载内核模块8021q,需要创建文件/etc/modules-load.d/8021q.conf,内容如下:

# Load 8021q.ko at boot
8021q

重启之后发现kmod已经成功加载

[root@server211 ~]# lsmod |grep 8021
cfg80211              851968  0
rfkill                 28672  2 cfg80211
8021q                  40960  0
garp                   16384  1 8021q
mrp                    20480  1 8021q

Fedora Working with Kernel Modules 详细文档

About the author

liuyuhang

View all posts

35 Comments

  • Link exchange is nothing else except it is just placing the other person’s webpage link on your page
    at suitable place and other person will also do same for you.

  • That is really attention-grabbing, You’re an excessively
    skilled blogger. I have joined your rss feed and sit up for in quest of extra of your wonderful post.
    Also, I’ve shared your website in my social networks

  • Good way of explaining, and nice post to obtain information on the topic of my presentation topic, which i am going to deliver in college.| Hedvige Otho Thora

  • I think the problem for me is the energistically benchmark focused growth strategies via superior supply chains. Compellingly reintermediate mission-critical potentialities whereas cross functional scenarios. Phosfluorescently re-engineer distributed processes without standardized supply chains. Quickly initiate efficient initiatives without wireless web services. Interactively underwhelm turnkey initiatives before high-payoff relationships. Roanne Whitaker Hansiain

  • Hi, I think your web site could be having browser compatibility problems. Whenever I take a look at your web site in Safari, it looks fine however when opening in IE, it has some overlapping issues. I simply wanted to provide you with a quick heads up! Aside from that, fantastic site! Laural Jule Kassandra

  • I am genuinely pleased to glance at this web site posts which consists of plenty of helpful data, thanks for providing these statistics.| Janela Kerby Dawkins

  • 548227 591203I very glad to find this site on bing, just what I was looking for : D as well saved to favorites . 116684 Suki Valentijn Sterling

  • I have been examinating out many of your stories and i can state pretty clever stuff. I will surely bookmark your website. Johna Wes Anna-Diana Ondrea Norbie Sommers

  • Awesome post. I am a normal visitor of your web site and appreciate you taking the time to maintain the nice site. I will be a regular visitor for a really long time. Faye Bank Rosel

  • I think this is one of the most significant info for me. And i am glad reading your article. But should remark on few general things, The web site style is wonderful, the articles is really great : D. Good job, cheers| Lainey Wiatt Kobylak

  • I am sure this article has touched all the internet visitors, its really really pleasant post on building up new web site. Corny Ellswerth Gebhardt

  • Everything is very open with a really clear description of the issues. It was really informative. Your website is extremely helpful. Thanks for sharing! Florance Quincey Taddeo

  • Nice blog here! Also your website loads up fast! What host are you using? Can I get your affiliate link to your host? I wish my website loaded up as fast as yours lol Belinda Clem Appledorf

  • Hello my loved one! I want to say that this article is amazing, great written and include almost all significant infos. I would like to look extra posts like this . Jobye Judd Phip

  • I was suggested this website by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my trouble. You are wonderful! Thanks! Lindi Denys Herb

  • If you are going for most excellent contents like I do, just pay a quick visit this site all the time for the reason that it gives quality contents, thanks Ermentrude Sheffield Hoo

  • As I website possessor I believe the content material here is rattling great , appreciate it for your hard work. You should keep it up forever! Good Luck. Agnella Toiboid Ruben

  • Aute mi ut suspendisse velit leo, vel risus ac. Amet dui dignissim fermentum malesuada auctor volutpat, vestibulum ipsum nulla. Ofella Nestor Laband

  • You made some decent factors there. I searched the internet for the concern and also found most people will support with your site. Eloise Lorens Lunnete

  • For newest news you have to go to see the web and on web I found this web site as a finest website for most recent updates. Charisse Cointon Rebe

发表评论

电子邮件地址不会被公开。 必填项已用*标注