Build a mini Linux from scratch (5)

Source: Internet
Author: User
Tags network function

Tag: Build Linux from scratch build Linux


20. Edit the/etc/fstab file to further refine the rc.sysinit and Inittab files

21. The first Test starts

22. Compile kernel use to support network function (directly compile as core)

23. Ninth Test start

24. Compile the kernel to enable it to support network functions (compile as module)

25. Tenth Test Start



20. Edit/etc/fstab, perfect Rc.sysinit, Inittab

[[Email protected] sysroot]# vim etc/fstabsysfs /sys sysfs defaults 0  0proc /proc proc defaults 0 0/dev/sda1 /boot ext4 defaults  0 0/dev/sda2 / ext4 defaults 0 0[[email protected] sysroot]# vim  etc/rc.d/rc.sysinitecho -e  "\twelcome to ++++ \033[32mmini\033[0m linux" Mount -n -t proc proc /procmount -n -t sysfs sysfs /sysecho   "Scan /sys and to populate to /dev ..." mdev -smount -o remount,rw /dev/sda2 /echo  "Mounting all filesystems ... "mount -a      //mount the device in the/etc/fstab [[email protected] sysroot]#  vim etc/inittab::sysinit:/etc/rc.d/rc.sysinittty1::askfirst:/bin/sh  //implementation of 3 terminal Tty2:: Askfirst:/bin/shtty3::askfirst:/bin/sh::ctrlaltdel:/sbin/rebOot::shutdown:/bin/umount -a -r 



21. The first Test starts


650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8B/70/wKiom1hOVLTR16QVAAAPLMDXnLM629.png-wh_500x0-wm_3 -wmp_4-s_1678949981.png "style=" Float:none; "title=" 1.png "alt=" Wkiom1hovltr16qvaaaplmdxnlm629.png-wh_50 "/>


650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8B/6C/wKioL1hOVLWSnPh9AAAQyak4sXI114.png-wh_500x0-wm_3 -wmp_4-s_3565732785.png "style=" Float:none; "title=" 2.png "alt=" Wkiol1hovlwsnph9aaaqyak4sxi114.png-wh_50 "/>


650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/8B/70/wKiom1hOVLWhQpqBAAAO1XfnqAE029.png-wh_500x0-wm_3 -wmp_4-s_4152168598.png "style=" Float:none; "title=" 3.png "alt=" Wkiom1hovlwhqpqbaaao1xfnqae029.png-wh_50 "/>



22. Compile kernel use to support network function (directly compile as core)


[[Email protected] ~]# cd /usr/src/linux[[email protected] linux]# make  menuconfig[*] Networking support  --->    Networking  options  --->         [*] TCP/IP  Networking (Driver network card: The first implementation  -->  compilation as the core)//compile the NIC driver into the kernel core [[email protected] ~]# cd /usr/ src/linux[[email protected] linux]# make menuconfig//driver Nic device drivers  -- ->[*] network device support  --->[*]   ethernet driver  support  (NEW)   --->[*]   Intel devices<*>      intel (R)  PRO/1000 Gigabit Ethernet support  compile as core [[email protected]  linux]# make bzimage[[email protected] linux]# cp arch/x86/boot/bzimage  /mnt/boot/vmlinuz cp: overwrite  '/mnt/boot/vmlinuz '?  y 


23. Ninth Test start


650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/8B/70/wKiom1hOVYqTGKKVAAAtPeyEdaA275.png-wh_500x0-wm_3 -wmp_4-s_637863895.png "style=" Float:none; "title=" 1.png "alt=" Wkiom1hovyqtgkkvaaatpeyedaa275.png-wh_50 "/>


650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/8B/6D/wKioL1hOVYrSs6N7AAApyclXBMg919.png-wh_500x0-wm_3 -wmp_4-s_136151818.png "style=" Float:none; "title=" 2.png "alt=" Wkiol1hovyrss6n7aaapyclxbmg919.png-wh_50 "/>


650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8B/70/wKiom1hOVY3hlZvuAAAebTkgVsM280.png-wh_500x0-wm_3 -wmp_4-s_4100476048.png "style=" Float:none; "title=" 3.png "alt=" Wkiom1hovy3hlzvuaaaebtkgvsm280.png-wh_50 "/>



24. Compile the kernel to enable it to support network functions (compile as module)


[[Email protected] ~]# cd /usr/src/linux[[email protected] linux]# make  menuconfigDevice Drivers  --->[*] Network device support  --- >[*]   Ethernet driver support  (NEW)   --->[*]    Intel devices<m>     intel (R)  pro/1000 gigabit ethernet  support  compile as module [[email protected] linux]# make bzimage[[email protected]  linux]# cp arch/x86/boot/bzImage /mnt/boot/vmlinuz cp: overwrite  '/mnt/ Boot/vmlinuz '?  y   //This core does not include a NIC driver//separate compilation module [[Email protected] linux]# make  m=drivers/net/ethernet/intel/e1000//Copy the module to the target host [[EMAIL&NBSP;PROTECTED]&NBSP;LINUX]#&NBSP;MKDIR&NBSP;-PV  /mnt/sysroot/lib/modules[[email protected] linux]# cp drivers/net/ethernet/intel/ E1000/e1000.ko /mnt/sysroot/lib/modules[[email protected] linux]# ls /mnt/sysroot/lib/modulese1000.ko 


25. Tenth Test Start


650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8B/6D/wKioL1hOVhmwuGDcAAAWChVSOUE281.png-wh_500x0-wm_3 -wmp_4-s_1932143142.png "style=" Float:none; "title=" 1.png "alt=" Wkiol1hovhmwugdcaaawchvsoue281.png-wh_50 "/>


650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8B/71/wKiom1hOVhnhje7rAAA58gIhr28627.png-wh_500x0-wm_3 -wmp_4-s_3894845334.png "style=" Float:none; "title=" 2.png "alt=" Wkiom1hovhnhje7raaa58gihr28627.png-wh_50 "/>



This article is from the "Homecoming" blog, make sure to keep this source http://sixijie123.blog.51cto.com/11880770/1881964

Build a mini Linux from scratch (5)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.