從無到有構建一個Mini Linux(2)


6.重新編譯內核使其識別ext4文件系統

7.第二次測試啓動

8.使用bash程序模擬init

9.第三次測試啓動



6.重新編譯內核使其識別ext4文件系統

[root@centos6 ~]# cd /usr/src/linux
[root@centos6 linux]# make menuconfig

//選擇ext4文件驅動
File systems  --->
	<*> The Extended 4 (ext4) filesystem
	[*]   Ext4 POSIX Access Control Lists 
Executable file formats / Emulations  --->
	[*] Kernel support for ELF binaries 支持的可執行文件的格式
	<*> Kernel support for scripts starting with #!
	

[root@centos6 linux]# make bzImage

//覆蓋原來的內核文件
[root@centos6 linux]# cp arch/x86/boot/bzImage /mnt/boot/vmlinuz 
cp: overwrite '/mnt/boot/vmlinuz'? y



7.第二次測試啓動


wKioL1hL3tvjsHkjAABS1c9mW3Y238.png-wh_50


 

8.用bash程序模擬init

[root@centos6 ~]# ./copycmd.sh   
//命令複製程序(複製命令和對應的庫文件 我們這裏複製/bin/bash測試)
[root@centos6 ~]# vim /mnt/boot/grub/grub.conf
default=0
timeout=5
hiddenmenu
title sxj Minu
        root (hd0,0)
        kernel /vmlinuz root=/dev/sda2 init=/bin/bash


9.第三次測試啓動


wKiom1hL3yKwvmptAAArz8y9wZQ299.png-wh_50




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章