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包 有 21,956 条回应

  1. [url=http://sildenafil30.com/]sildenafil[/url] [url=http://colchicine100.com/]cheapest colchicine generic no prescription[/url] [url=http://metformin365.com/]metformin[/url] [url=http://doxycycline3.com/]medication doxycycline 100mg[/url]

    回复
  2. wos [url=https://cbdoil33.com/#]cbd oil side effects[/url]

    回复
  3. [url=http://tadalafilf5h.com/]tadalafil generic[/url] [url=http://lisinoprild6j.com/]lisinopril generic[/url] [url=http://cialiso0o.com/]cialis buy[/url] [url=http://sildenafilg8.com/]buy sildenafil[/url] [url=http://cialiso0.com/]cialis online[/url]

    回复
  4. [url=http://motilium2019.com/]buy motilium uk[/url] [url=http://atenolol911.com/]atenolol 50 mg online[/url] [url=http://tadalafil8.com/]tadalafil 20 mg[/url] [url=http://retina100.com/]retin a[/url] [url=http://viagra250.com/]cheap canadian generic viagra[/url]

    回复
  5. rgsezv french dude gjkjga vaporizer store uk

    回复
  6. [url=https://sildenafil10.com/]sildenafil prescription uk[/url] [url=https://viagra250.com/]cheap viagra online[/url] [url=https://prednisone100.com/]medicine prednisone 5mg[/url] [url=https://atenolol911.com/]atenolol[/url] [url=https://cialis500.com/]cialis coupon[/url]

    回复

Intoppytenlylem进行回复 取消回复

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