自己手工编译了一下 linux 内核和ramfilesystem,
首先安装了一下centos 7,
发现centos 添加内核真是麻烦
首先copy内核到/boot目录下,必须是bzImage的
scp arch/x86/boot/bzImage root@172.18.10.79:/boot/vmlinuz-foo
scp initramfs-busybox-x86.cpio.gz root@172.18.10.78:/boot/initramfs-foo.img
centos要求名称必须这样命名
生成配置 这个不需要编辑/etc/grub.d的
40_custom 文件
grub2-mkconfig -o /boot/grub2/grub.cfg
输出
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img
Found linux image: /boot/vmlinuz-foo
Found initrd image: /boot/initramfs-foo.img
Found linux image: /boot/vmlinuz-0-rescue-e4354532a81d415aa5391c9db2341ae8
Found initrd image: /boot/initramfs-0-rescue-e4354532a81d415aa5391c9db2341ae8.img
done
grep "^menuentry" /boot/grub2/grub.cfg | cut -d "'" -f2
CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)
CentOS Linux (foo) 7 (Core)
CentOS Linux (0-rescue-e4354532a81d415aa5391c9db2341ae8) 7 (Core)
下一步要做的就是加载xfs分区,因为centos7 默认的分区是xfs
阅读(2454) | 评论(0) | 转发(0) |