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包 有 67,407 条回应

  1. I like looking through a post that can make people think.
    Also, thank you for permitting me to comment!

    回复
  2. hidden apartment sex cams [url=https://sexcams00.website]live streaming sex cams [/url] free video cams sex.

    回复
  3. sex cams couples [url=https://sexcams00.website]sexcams00[/url] homemade cams small teenage girl having sex with her dog.
    voyeur sex cams [url=https://sexcams00.work]women sex cams [/url] live one on one sex cams.
    private live sex cams [url=https://sexcams00.online]sexcams00[/url] free live sex cams no log ins.
    lice sex cams [url=https://sexcams00.work]free live teen sex cams [/url] freeweb sex cams.
    young sex cams [url=https://sexcams00.xyz]free live asian sex cams [/url] hott sex chat with studs no cams.
    girls live sex cams [url=https://sexcams00.work]sexcams00[/url] camjolive sex cams.
    free live hd sex cams [url=https://sexcams00.club]free live hd sex cams [/url] hidden cams used by priests who have sex with altar boys.
    live mobile sex cams [url=https://sexcams00.website]sexcams00[/url] new york sex cuckold cams.

    回复
  4. a number of the major casino game web sites will credit you totally free cash to
    help you start, i turned 35 into 240 the last few days this page shows
    the best sites PLAY83.COMSaya menulis bukan hanya untuk dunia,
    tetapi juga demi akhirat saya.

    回复
  5. Hey there, You have done a great job. I will certainly digg it and
    personally recommend to my friends. I am sure they will be benefited from this website.

    回复
  6. You’re so awesome! I don’t think I’ve truly read through a single thing like this before.
    So nice to discover somebody with some unique
    thoughts on this subject. Really.. thank you for starting this up.
    This site is one thing that is required on the web, someone with some originality!

    回复
  7. Hi, I do believe this is a great web site. I stumbledupon it 😉 I am
    going to return once again since i have bookmarked it.
    Money and freedom is the best way to change, may you be rich and continue to
    help other people.

    回复

pymmelvecychody进行回复 取消回复

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