Self-made Linux and kernel compilation

Source: Internet
Author: User

Self-made Linux and kernel compilation 1, partitioning and creating file systems

Fdisk/dev/sdb
Divided into two necessary partitions
/DEV/SDB1 corresponding/boot/dev/sdb2 corresponding to the root/
Mkfs.ext4/dev/sdb1
Mkfs.ext4/dev/sdb2
650) this.width=650; "src=" Http://i.imgur.com/f7HGYyB.png "/>

2. Mount Boot

Mkdir/mnt/boot
Mount/dev/sdb1/mnt/boot

3. Installing GRUB

Grub-install--root-directory=/mnt/dev/sdb
650) this.width=650; "src=" Http://i.imgur.com/ziLMB81.png "/>

4, Establish grub.conf:

Vim/mnt/boot/grub/grub.conf

Title Qzxlinuxroot (hd0,0) kernel/vmlinuz-2.6.32-642.el6.x86_64 root=/dev/sda2 selinux=0 INIT=/BIN/BASHINITRD/ Initramfs-2.6.32-642.el6.x86_64.img
5. Restore kernel and Initramfs files

cp/boot/vmlinuz-2.6.32-642.el6.x86_64/mnt/boot/
Cp/boot/initramfs-2.6.32-642.el6.x86_64.img/mnt/boot

6. Create a level directory

Mkdir/mnt/sysroot
Mount/dev/sdb2/mnt/sysroot
Mkdir–pv/mnt/sysroot/{etc,lib,lib64,bin,sbin,tmp,var,usr,sys,proc,opt,home,root,boot,dev,mnt,media}
650) this.width=650; "src=" Http://i.imgur.com/l19hkMP.png "/>

7, Vim/mnt/sysroot/etc/fstab
/dev/sda1/boot ext4 Defaults 1 1/DEV/SDA2/EXT4 defaults 1 2
8. Copy bash and related library files 9, copy related commands and related library files

such as: Ls,cat,vim,reboot,hostname, etc.

650) this.width=650; "src=" Http://i.imgur.com/O1u2Kql.png "/>

Success


Self-made Linux and kernel compilation

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.