[Original] Using busybox and extlinux to build a Linux system (on) on the computer compactflash (CF card)

Source: Internet
Author: User

 

Article 1: Installing the CF card partition and extlinux

Part 2: Build a root file system

Part II: 2.6 kernel tailoring and busybox compilation configuration and Analysis

 

 

 

 

Hardware Platform: Yanhua 3355

Software: busybox-1.13.3, extlinux 3.63, linux-2.6.32

Development Environment: Ubuntu 9.10

 

(1) Partition and format of the CF card:

The PC uses a multi-port card reader to connect to the CF card,

Fdisk-l view the CF card partition. For example, my CF card corresponds to/dev/sdb;

Fdisk/dev/SDB, enter the fdisk partition command prompt, a brief introduction to the fdisk partition Process

M print prompt;

P prints partition information;

D. Delete the partition. If/dev/sdb1 already exists, press d and enter 1 to delete the partition;

N Add a partition. Here, only one P (primary) is added and all the storage space is occupied;

A. Set a partition as the boot partition to boot the partition;

W writes the changes and releases fdisk. Before entering W, use P to view the current partition;

Q. Exit without modification;

 

Format the partition to ext2:Mkfs. ext2/dev/sdb1 

Ext2 format:E2fsck-A/dev/sdb1

NOTE: If e2fsck is not running, the system will report "EXT2-fs warning: mounting unchecked FS, running e2fsck is recommended"

 

 

 

(2) create bootloader on the CF card

Common examples include grub, Lilo, syslinux, and extlinux, which are more suitable for USB flash drives and CF cards,

Syslinux is applicable to DoS partitions, while extlinux is applicable to ext2 partitions ,:

Http://syslinux.zytor.com/wiki/index.php/SYSLINUX

Http://syslinux.zytor.com/wiki/index.php/EXTLINUX

 

Ubuntu 9.10 is installed with APT-Get install extlinux. The device name is/dev/sdb1 and mounted to/mnt/Cf: Mount/dev/sdb1/mnt/Cf.

Extlinux-I/mnt/CF

Note the differences between syslinux and extlinux:

The configuration file of syslinux is syslinux. cfg. You must first install syslinux and then mount the partition, for example, syslinux/dev/sdb1;

Extlinux configuration file extlinux. conf: First mount the partition and then install extlinux, for example, extlinux-I/mnt/CF;

Create the configuration file extlinux. conf in/mnt/CF and edit the file as follows:

 

DEfault emblinux
Timeout 10
Prompt 0
Label emblinux
Kernel bzimage
Append noinitrd root =/dev/sda1 RW init =/linuxrc ide = nodma

 

 

 

Note that CF is recognized as SDA on the industrial computer rather than hda. noinitrd indicates that initrd. IMG is not mounted,

 

Similar to Linux on the embedded ARM platform, "noinitrd root =/dev/mtdblock2 init =/linuxrc console = ttysac0"

For more information, see the following link:

Http://www.sudu.cn/info/html/edu/20080407/262839.html

 

 

(3) copy the kernel to the CF card

 

Kernel tailoring and configuration, see http://blog.csdn.net/dos5gw/archive/2010/10/26/5965992.aspx

 

Make mrproper # Clear the. O files left during previous kernel Compilation

Make menuconfig

Make Dep # (ensure that key files are in the correct location)

Make clean # (make sure all related files are in the latest version)

Make bzimage

Then copy the generated/linux-2.6.32/ARCH/x86/boot/bzimage to the CF card partition/dev/sdb1.

 

 

//-----------------------------------------------

// -- General Linux Startup Process -------------------------

Grub (BL)-> kernel-> initrd. IMG-> rootfs-> sbin/INIT (linuxrc, only for busybox)

Explanation:

Kernel: generally vmlinuz files, or zimage and bzimage files in desktop OS;

Initrd. IMG: The full name of the temporary root file system image is initial RAM disk (produced by Google keywords initrd). It is uninstalled after use and then transferred to the real root file, of course, in some embedded systems, you can continue to use as the root file system without detaching initrd;

Rootfs: not explained;

Sbin/init: see http://hi.baidu.com/tcxx05/blog/item/15cfc7fc0cd0d089b801a0d8.html

 

 

 

 

 

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.