LSX-blog

Feed Rss

【原创】打包内核为RPM包

05.31.2015, Linux, by .

下载内核包

1
https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.16.7.tar.gz

安装依赖包

1
yum install gcc rpm-build redhat-rpm-config ncurses-devel patchutils bc xmlto asciidoc elfutils-libelf-devel zlib-devel binutils-devel newt-devel python-devel perl-ExtUtils-Embed hmaccalc kernel-firmware -y

解压内核压缩包

1
tar zxvf linux-3.16.7.tar.gz

复制本机内核配置到新内核目录

1
2
cd linux-3.16.7
cp /boot/config-2.6.32-504.8.1.el6.x86_64 .config

增加内核安装后默认启动

1
2
cd linux-3.16.7
vim scripts/package/mkspec

在%post最后面增加如下行

1
echo "/sbin/grubby --set-default 0"

在%post段后面添加%preun段

1
2
3
echo "%preun"
echo "new-kernel-pkg --rminitrd --rmmoddep --remove $KERNELRELEASE"
echo ""

简单设置config

1
make menuconfig

General setup —> Local version – append to kernel release
输入
.el6.x86_64
保存
创建RPM包
make rpm-pkg

等待完成
~/rpmbuild/RPMS/x86_64 即可看到。

【原创】打包内核为RPM包 有 103,611 条回应

  1. Have you ever considered about adding a little bit more
    than just your articles? I mean, what you say is fundamental
    and everything. But just imagine if you added some great photos or videos to give
    your posts more, “pop”! Your content is excellent but with
    pics and clips, this website could definitely be one of the best in its niche.
    Fantastic blog!

    回复
  2. Los usuarios de Energy BI tienen más opciones.

    回复
  3. [url=http://lexaporo.com/]lexapro pharmacy[/url]

    回复
  4. Hello to every , as I am in fact keen of reading
    this blog’s post to be updated daily. It consists of pleasant data.

    回复
  5. I am sure this article has touched all the internet people, its really really pleasant paragraph on building up new website.

    回复
  6. Heya just wanted to give you a quick heads up and let you know a few of the pictures aren’t loading correctly.
    I’m not sure why but I think its a linking issue.
    I’ve tried it in two different internet browsers and both show the same outcome.

    回复

EvaWed进行回复 取消回复

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