00000014.htm
来自「水木社区 embeded 版精华区 下载」· HTM 代码 · 共 114 行
HTM
114 行
<?xml version="1.0" encoding="gb2312"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"/><title>Embedded Linux Howto (4) turbolinux </title></head><body><center><h1>BBS 水木清华站∶精华区</h1></center><a name="top"></a>发信人: turbolinux (hoho~神啊,救救我吧...), 信区: Embedded <br />标 题: Embedded Linux Howto (4) <br />发信站: BBS 水木清华站 (Thu Jul 12 00:31:33 2001) <br /> <br />4. Creating a root file system <br />4.1 Creating a new partition <br />Quoted from the LFS-HOWTO at <a href="http://huizen.dds.nl/~glb/">http://huizen.dds.nl/~glb/</a> <br /> <br />Before we can build our new Linux system, we need to have an empty Linux <br /> partition on which we can build our new system. If you already have a <br />Linux Native partition available, you can skip this subsection and the <br />following one. <br /> <br />Start the fdisk program (or cfdisk if you prefer that program) with <br />the appropriate hard disk as the option (like /dev/hda if you want to <br />create a new partition on the primary master IDE disk). Create a Linux <br />Native partition, write the partition table and exit the (c)fdisk <br />program. If you get the message that you need to reboot your system to <br />ensure that that partition table is updated, then please reboot your <br />system now before continuing. <br /> <br />4.2 Creating an ext2 file system on the new partition <br />Quoted from the LFS-HOWTO at <a href="http://huizen.dds.nl/~glb/">http://huizen.dds.nl/~glb/</a> <br /> <br />To create a new ext2 file system we use the mke2fs command. Give $LFS as <br /> the only option and the file system will be created. <br /> <br />From now on I'll refer to this newly created partition as $EMBPART. <br />$EMBPART should be substituted with the partition you have created. <br /> <br />4.3 Mounting the partition <br />To access the newly created filesystem, you have to mount it. For this <br />create a /mnt/hda? directory and type at shell prompt: <br /> <br />mkdir /mnt/hda? <br />mount $EMBPART /mnt/hda? <br />If you created your partition on /dev/hda4, and you mounted it on <br />/mnt/hda4, when this document will tell you to copy a file to $dollar; <br />EMBPART/usr/bin then you will need to copy that file to <br />/mnt/hda4/usr/bin. <br /> <br /> <br /> <br /> <br />4.4 Populating the filesystem <br />The root filesystem must contain everything needed to support a full <br />Linux system. We will build a directory structure not that far from <br />the File Hierarchy Standard <br /> <br />Directories <br />Directories are made by using the mkdir fonction in the new mounted <br />filesystem. <br /> <br />/proc <br />Directory stub required by the proc filesystem. <br /> <br />/etc <br />System configuration file <br /> <br />/sbin <br />Critical System binaries <br /> <br />/bin <br />Basic binaries considered part of the system <br /> <br />/lib <br />Shared Libraries to provide run time support <br /> <br />/mnt <br />Mount point for maintenance <br /> <br />/usr <br />Additional utilities and applications <br /> <br /> <br />cd /mnt/hda? <br />mkdir bin dev home proc sbin usr boot etc liv mnt root tmp var <br />mkdir -p usr/bin usr/sbin usr/share usr/lib <br />mkdir -p etc/config etc/default etc/init.d etc/rc.boot <br />mkdir -p etc/rc0.d etc/rc1.d etc/rc2.d etc/rc3.d etc/rc4.d etc/rc5.d <br />etc/rc6.d etc/rcS.d <br />the /dev directory <br />The dev directory is the stub required to perform devices input / <br />output. Each file in this directory may be created using the mknod <br />function. You may avoid losing time by directly copying the required dev <br /> entries from your desktop Linux. <br /> <br />cp -av /dev/???? /mnt/hda? <br /> <br /> <br />-- <br />Welcome to <a href="http://www.EnjoySmart.com">http://www.EnjoySmart.com</a> <br /> -->Dedicated to Smart Home & Network Appliances <br /> <br /> <br />※ 来源:·BBS 水木清华站 smth.org·[FROM: 166.111.174.125] <br /><a href="00000013.htm">上一篇</a><a href="javascript:history.go(-1)">返回上一页</a><a href="index.htm">回到目录</a><a href="#top">回到页首</a><a href="00000015.htm">下一篇</a></h1></center><center><h1>BBS 水木清华站∶精华区</h1></center></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?