Embedded 版 (精华区)
发信人: embeddedsys (选择·喜欢), 信区: Embedded_system
标 题: Embedded Linux Howto (4) Zzz
发信站: 哈工大紫丁香 (2003年03月27日09:31:08 星期四), 站内信件
发信人: turbolinux (hoho~神啊,救救我吧...), 信区: Embedded
标 题: Embedded Linux Howto (4)
发信站: BBS 水木清华站 (Thu Jul 12 00:31:33 2001)
4. Creating a root file system
4.1 Creating a new partition
Quoted from the LFS-HOWTO at http://huizen.dds.nl/~glb/
Before we can build our new Linux system, we need to have an empty Linux
partition on which we can build our new system. If you already have a
Linux Native partition available, you can skip this subsection and the
following one.
Start the fdisk program (or cfdisk if you prefer that program) with
the appropriate hard disk as the option (like /dev/hda if you want to
create a new partition on the primary master IDE disk). Create a Linux
Native partition, write the partition table and exit the (c)fdisk
program. If you get the message that you need to reboot your system to
ensure that that partition table is updated, then please reboot your
system now before continuing.
4.2 Creating an ext2 file system on the new partition
Quoted from the LFS-HOWTO at http://huizen.dds.nl/~glb/
To create a new ext2 file system we use the mke2fs command. Give $LFS as
the only option and the file system will be created.
From now on I'll refer to this newly created partition as $EMBPART.
$EMBPART should be substituted with the partition you have created.
4.3 Mounting the partition
To access the newly created filesystem, you have to mount it. For this
create a /mnt/hda? directory and type at shell prompt:
mkdir /mnt/hda?
mount $EMBPART /mnt/hda?
If you created your partition on /dev/hda4, and you mounted it on
/mnt/hda4, when this document will tell you to copy a file to $dollar;
EMBPART/usr/bin then you will need to copy that file to
/mnt/hda4/usr/bin.
4.4 Populating the filesystem
The root filesystem must contain everything needed to support a full
Linux system. We will build a directory structure not that far from
the File Hierarchy Standard
Directories
Directories are made by using the mkdir fonction in the new mounted
filesystem.
/proc
Directory stub required by the proc filesystem.
/etc
System configuration file
/sbin
Critical System binaries
/bin
Basic binaries considered part of the system
/lib
Shared Libraries to provide run time support
/mnt
Mount point for maintenance
/usr
Additional utilities and applications
cd /mnt/hda?
mkdir bin dev home proc sbin usr boot etc liv mnt root tmp var
mkdir -p usr/bin usr/sbin usr/share usr/lib
mkdir -p etc/config etc/default etc/init.d etc/rc.boot
mkdir -p etc/rc0.d etc/rc1.d etc/rc2.d etc/rc3.d etc/rc4.d etc/rc5.d
etc/rc6.d etc/rcS.d
the /dev directory
The dev directory is the stub required to perform devices input /
output. Each file in this directory may be created using the mknod
function. You may avoid losing time by directly copying the required dev
entries from your desktop Linux.
cp -av /dev/???? /mnt/hda?
--
Welcome to http://www.EnjoySmart.com
-->Dedicated to Smart Home & Network Appliances
--
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.118.250.5]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.040毫秒