aboutsummaryrefslogtreecommitdiffstats
path: root/chapter03
diff options
context:
space:
mode:
Diffstat (limited to 'chapter03')
-rw-r--r--chapter03/chapter4.sgml10
-rw-r--r--chapter03/creatingdirs.sgml66
-rw-r--r--chapter03/creatingfs.sgml18
-rw-r--r--chapter03/creatingpart.sgml26
-rw-r--r--chapter03/introduction.sgml13
-rw-r--r--chapter03/mounting.sgml47
6 files changed, 180 insertions, 0 deletions
diff --git a/chapter03/chapter4.sgml b/chapter03/chapter4.sgml
new file mode 100644
index 000000000..afba440da
--- /dev/null
+++ b/chapter03/chapter4.sgml
@@ -0,0 +1,10 @@
+<chapter id="chapter04">
+<title>Preparing a new partition</title>
+
+&c4-introduction;
+&c4-creatingpart;
+&c4-creatingfs;
+&c4-mounting;
+&c4-creatingdirs;
+
+</chapter>
diff --git a/chapter03/creatingdirs.sgml b/chapter03/creatingdirs.sgml
new file mode 100644
index 000000000..4bc44e3e9
--- /dev/null
+++ b/chapter03/creatingdirs.sgml
@@ -0,0 +1,66 @@
+<sect1 id="ch04-creatingdirs">
+<title>Creating directories</title>
+
+<para>
+Let's create the directory tree on the LFS partition according to the FHS
+standard which can be found at <ulink
+url="http://www.pathname.com/fhs/">http://www.pathname.com/fhs/</ulink>.
+Issuing the following commands will create the necessary directories:
+</para>
+
+<blockquote><literallayout>
+
+ <userinput>cd $LFS</userinput>
+ <userinput>mkdir bin boot dev dev/pts etc home lib mnt proc root sbin tmp
+ var</userinput>
+ <userinput>for dirname in $LFS/usr $LFS/usr/local</userinput>
+ <userinput><literal>&nbsp;&nbsp;&nbsp;do</literal></userinput>
+ <userinput>&nbsp;&nbsp;&nbsp;mkdir $dirname</userinput>
+ <userinput>&nbsp;&nbsp;&nbsp;cd $dirname</userinput>
+ <userinput>&nbsp;&nbsp;&nbsp;mkdir bin etc include lib sbin share
+ src tmp var</userinput>
+ <userinput>&nbsp;&nbsp;&nbsp;ln -s share/man man</userinput>
+ <userinput>&nbsp;&nbsp;&nbsp;ln -s share/doc doc</userinput>
+ <userinput>&nbsp;&nbsp;&nbsp;ln -s share/info info</userinput>
+ <userinput>&nbsp;&nbsp;&nbsp;cd $dirname/share</userinput>
+ <userinput>&nbsp;&nbsp;&nbsp;mkdir dict doc info locale man nls misc
+ terminfo zoneinfo</userinput>
+ <userinput>&nbsp;&nbsp;&nbsp;cd $dirname/share/man</userinput>
+ <userinput>&nbsp;&nbsp;&nbsp;mkdir man1 man2 man3 man4 man5 man6 man7
+ man8</userinput>
+ <userinput>done</userinput>
+ <userinput>cd $LFS/var</userinput>
+ <userinput>mkdir lock log mail run spool tmp</userinput>
+
+</literallayout></blockquote>
+
+<para>
+Normally directories are created with permission mode 755, which isn't
+desired for all directories. I haven't checked the FHS if they suggest
+default modes for certain directories, so I'll just change the modes for
+a few directories that make sense to change. The first change is a mode
+0750 for the $LFS/root directory. This is to make sure that not just
+everybody can enter the /root directory (the same you would do with
+/home/username directories). The second change is a mode 1777 for the tmp
+directories. This way every user can write stuff to the /tmp directory if
+they need to. The sticky (1) bit makes sure users can't delete other
+user's file which they normally can do because the directory is set in
+such a way that every body (owner, group, world) can write to that directory.
+</para>
+
+<blockquote><literallayout>
+
+ <userinput>cd $LFS &amp;&amp;</userinput>
+ <userinput>chmod 0750 root &amp;&amp;</userinput>
+ <userinput>chmod 1777 tmp usr/tmp var/tmp</userinput>
+
+</literallayout></blockquote>
+
+<para>
+Now that the directories are created, copy the source files you have
+downloaded in chapter 3 to some subdirectory under $LFS/usr/src (you will
+need to create this subdirectory yourself).
+</para>
+
+</sect1>
+
diff --git a/chapter03/creatingfs.sgml b/chapter03/creatingfs.sgml
new file mode 100644
index 000000000..76bbe247f
--- /dev/null
+++ b/chapter03/creatingfs.sgml
@@ -0,0 +1,18 @@
+<sect1 id="ch04-creatingfs">
+<title>Creating a ext2 file system on the new partition</title>
+
+<para>
+Once the partition is created, we have to create a new ext2 file system on
+that partition. To create a new ext2 file system we use the mke2fs command.
+Enter the new partition as the only option and the file system will be
+created. If your partition is hda11, you would run:
+</para>
+
+<blockquote><literallayout>
+
+ <userinput>mke2fs /dev/hda11</userinput>
+
+</literallayout></blockquote>
+
+</sect1>
+
diff --git a/chapter03/creatingpart.sgml b/chapter03/creatingpart.sgml
new file mode 100644
index 000000000..7cd7c9ea6
--- /dev/null
+++ b/chapter03/creatingpart.sgml
@@ -0,0 +1,26 @@
+<sect1 id="ch04-creatingpart">
+<title>Creating a new partition</title>
+
+<para>
+Before we can build our new Linux system, we need to have an empty Linux
+partition on which we can build our new system. I recommend a partition size
+of around 750 MB. This gives you enough space to store all the tarballs and
+to compile all packages without worrying running out of the necessary
+temporary disk space. If you already have a Linux Native partition available,
+you can skip this subsection.
+</para>
+
+<para>
+Start the fdisk program (or another fdisk program you prefer) 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 fdisk program. If you get
+the message that you need to reboot your system to ensure that the partition
+table is updated, then please reboot your system now before continuing.
+Remember what your new partition's designation is. It could be something
+like hda11 (as it is in my case). This newly created partition will be
+referred to as the LFS partition in this book.
+</para>
+
+</sect1>
+
diff --git a/chapter03/introduction.sgml b/chapter03/introduction.sgml
new file mode 100644
index 000000000..b19076cf8
--- /dev/null
+++ b/chapter03/introduction.sgml
@@ -0,0 +1,13 @@
+<sect1 id="ch04-introduction">
+<title>Introduction</title>
+
+<para>
+In this chapter the partition that is going to host the LFS system is
+going to be prepared. A new partition will be created, an ext2 file
+system will be created on it and the directory structure will be
+created. When this is done, we can move on to the next chapter and start
+building a new Linux system from scratch.
+</para>
+
+</sect1>
+
diff --git a/chapter03/mounting.sgml b/chapter03/mounting.sgml
new file mode 100644
index 000000000..00b836156
--- /dev/null
+++ b/chapter03/mounting.sgml
@@ -0,0 +1,47 @@
+<sect1 id="ch04-mountingpart">
+<title>Mounting the new partition</title>
+
+<para>
+Now that we have created the ext2 file system, it is ready for use. All we have
+to do to be able to access it (as in reading from and writing date to it) is
+mounting it. If you mount it under /mnt/lfs, you can access this partition
+by going to the /mnt/lfs directory and then do whatever you need to do. This
+book will assume that you have mounted the partition on a subdirectory
+under /mnt. It doesn't matter which directory you choose, just make sure
+you remember what you chose.
+</para>
+
+<para>
+Create the /mnt/lfs directory by runnning:
+</para>
+
+<blockquote><literallayout>
+
+ <userinput>mkdir -p /mnt/lfs</userinput>
+
+</literallayout></blockquote>
+
+<para>
+Now mount the LFS partition by running:
+</para>
+
+<blockquote><literallayout>
+
+ <userinput>mount /dev/xxx /mnt/lfs</userinput>
+
+</literallayout></blockquote>
+
+<para>
+Replace <quote>xxx</quote> by your partition's designation.
+</para>
+
+<para>
+This directory (/mnt/lfs) is the $LFS variable you have read about earlier.
+So if you read somewhere to "cp inittab $LFS/etc" you actually will type
+<quote>cp inittab /mnt/lfs/etc</quote>. Or if you want to use the $LFS
+environment variable, execute <userinput>export LFS=/mnt/lfs</userinput>
+now.
+</para>
+
+</sect1>
+