r1940 - in profiles/LFS/branches/cross-lfs: . chroot skeleton/etc

thomasp at linuxfromscratch.org thomasp at linuxfromscratch.org
Thu Jul 14 12:15:51 PDT 2005


Author: thomasp
Date: 2005-07-14 13:15:51 -0600 (Thu, 14 Jul 2005)
New Revision: 1940

Added:
   profiles/LFS/branches/cross-lfs/chroot/changingownership.xml
   profiles/LFS/branches/cross-lfs/chroot/creatingdirs.xml
   profiles/LFS/branches/cross-lfs/chroot/creatingsymlinks.xml
   profiles/LFS/branches/cross-lfs/chroot/kernfs.xml
   profiles/LFS/branches/cross-lfs/chroot/populate-dev.xml
   profiles/LFS/branches/cross-lfs/chroot/pwdgroup.xml
   profiles/LFS/branches/cross-lfs/chroot/util-linux.xml
Modified:
   profiles/LFS/branches/cross-lfs/LFS.xml
   profiles/LFS/branches/cross-lfs/skeleton/etc/group
   profiles/LFS/branches/cross-lfs/skeleton/etc/passwd
Log:
Added chroot set-up section


Modified: profiles/LFS/branches/cross-lfs/LFS.xml
===================================================================
--- profiles/LFS/branches/cross-lfs/LFS.xml	2005-07-14 18:51:55 UTC (rev 1939)
+++ profiles/LFS/branches/cross-lfs/LFS.xml	2005-07-14 19:15:51 UTC (rev 1940)
@@ -82,5 +82,47 @@
       <xi:include href="temp-system/tar.xml" />
       <xi:include href="temp-system/bash.xml" />
     </stage>
+    <stage name="Chroot Prep">
+      <stageinfo>
+	<root>/</root>
+	<environment>
+	  <variable name="LFS">&LFS;</variable>
+	  <variable name="LC_ALL">POSIX</variable>
+	  <variable name="PATH">/cross-tools/bin:/bin:/usr/bin</variable>
+	  <variable name="CFLAGS" />
+	  <variable name="CXXFLAGS" />
+	  <variable name="TERM">&TERM;</variable>
+	  <variable name="HOME">&lfs-user-dir;</variable>
+	  <variable name="LFS_HOST">&lfs-host;</variable>
+	  <variable name="LFS_TARGET">&lfs-target;</variable>
+	  <variable name="CC">&lfs-target;-gcc</variable>
+	  <variable name="CXX">&lfs-target;-g++</variable>
+	  <variable name="AR">&lfs-target;-ar</variable>
+	  <variable name="AS">&lfs-target;-as</variable>
+	  <variable name="RANLIB">&lfs-target;-ranlib</variable>
+	  <variable name="LD">&lfs-target;-ld</variable>
+	  <variable name="STRIP">&lfs-target;-strip</variable>
+	</environment>
+      </stageinfo>
+      <xi:include href="chroot/util-linux.xml" />
+      <xi:include href="chroot/kernfs.xml" />
+    </stage>
+    <stage name="Setting up the Chroot Environment">
+      <stageinfo>
+	<root>&LFS;</root>
+	<environment>
+	  <variable name="HOME">/root</variable>
+	  <variable name="TERM">&TERM;</variable>
+	  <variable name="PATH">/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin</variable>
+	  <variable name="CFLAGS" />
+	  <variable name="CXXFLAGS" />
+	</environment>
+      </stageinfo>
+      <xi:include href="chroot/changingownership.xml" />
+      <xi:include href="chroot/creatingdirs.xml" />
+      <xi:include href="chroot/creatingsymlinks.xml" />
+      <xi:include href="chroot/pwdgroup.xml" />
+      <xi:include href="chroot/populate-dev.xml" />
+    </stage>
   </stage>
 </alfs>

Copied: profiles/LFS/branches/cross-lfs/chroot/changingownership.xml (from rev 1939, profiles/LFS/trunk/chapter06/changingowner.xml)

Copied: profiles/LFS/branches/cross-lfs/chroot/creatingdirs.xml (from rev 1939, profiles/LFS/trunk/chapter06/creatingdirs.xml)

Copied: profiles/LFS/branches/cross-lfs/chroot/creatingsymlinks.xml (from rev 1939, profiles/LFS/trunk/chapter06/createfiles.xml)

Copied: profiles/LFS/branches/cross-lfs/chroot/kernfs.xml (from rev 1939, profiles/LFS/trunk/chapter06/kernfs.xml)
===================================================================
--- profiles/LFS/trunk/chapter06/kernfs.xml	2005-07-14 18:51:55 UTC (rev 1939)
+++ profiles/LFS/branches/cross-lfs/chroot/kernfs.xml	2005-07-14 19:15:51 UTC (rev 1940)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE alfs SYSTEM "../DTD/ALFS.dtd"
+[
+<!ENTITY % general_entities SYSTEM "../config/general.ent">
+<!ENTITY % config_entities SYSTEM "../config/config.ent">
+
+%general_entities;
+%config_entities;
+]>
+<alfs>
+  <stage name="Mounting Virtual Kernel File Systems">
+    <mkdir base="&LFS;">
+      <option>parents</option>
+      <name>proc</name>
+      <name>sys</name>
+    </mkdir>
+    <execute command="mount">
+      <param>-t proc</param>
+      <param>proc</param>
+      <param>&LFS;/proc</param>
+    </execute>
+    <execute command="mount">
+      <param>-t sysfs</param>
+      <param>sysfs</param>
+      <param>&LFS;/sys</param>
+    </execute>
+    <execute command="mount">
+      <param>-f</param>
+      <param>-t tmpfs</param>
+      <param>tmpfs</param>
+      <param>&LFS;/dev</param>
+    </execute>
+    <execute command="mount">
+      <param>-f</param>
+      <param>-t tmpfs</param>
+      <param>tmpfs</param>
+      <param>&LFS;/dev/shm</param>
+    </execute>
+    <execute command="mount">
+      <param>-f</param>
+      <param>-t devpts</param>
+      <param>-o gid=4,mode=620</param>
+      <param>devpts</param>
+      <param>&LFS;/dev/pts</param>
+    </execute>
+  </stage>
+</alfs>

Copied: profiles/LFS/branches/cross-lfs/chroot/populate-dev.xml (from rev 1939, profiles/LFS/trunk/chapter06/basic-dev.xml)
===================================================================
--- profiles/LFS/trunk/chapter06/basic-dev.xml	2005-07-14 18:51:55 UTC (rev 1939)
+++ profiles/LFS/branches/cross-lfs/chroot/populate-dev.xml	2005-07-14 19:15:51 UTC (rev 1940)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE alfs SYSTEM "../DTD/ALFS.dtd"
+[]>
+<alfs>
+  <stage name="Populating /dev">
+    <stage name="Creating Initial Device Nodes">
+      <execute command="mknod">
+        <param>-m 600</param>
+        <param>/dev/console</param>
+        <param>c 5 1</param>
+      </execute>
+      <execute command="mknod">
+        <param>-m 666</param>
+        <param>/dev/null</param>
+        <param>c 1 3</param>
+      </execute>
+    </stage>
+    <stage name="Mounting tmpfs and Populating /dev">
+      <execute command="mount">
+        <param>-n</param>
+        <param>-t tmpfs</param>
+        <param>none</param>
+        <param>/dev</param>
+      </execute>
+      <execute command="mknod">
+        <param>-m 622</param>
+        <param>/dev/console</param>
+        <param>c 5 1</param>
+      </execute>
+      <execute command="mknod">
+        <param>-m 666</param>
+        <param>/dev/null</param>
+        <param>c 1 3</param>
+      </execute>
+      <execute command="mknod">
+        <param>-m 666</param>
+        <param>/dev/zero</param>
+        <param>c 1 5</param>
+      </execute>
+      <execute command="mknod">
+        <param>-m 666</param>
+        <param>/dev/ptmx</param>
+        <param>c 5 2</param>
+      </execute>
+      <execute command="mknod">
+        <param>-m 666</param>
+        <param>/dev/tty</param>
+        <param>c 5 0</param>
+      </execute>
+      <execute command="mknod">
+        <param>-m 444</param>
+        <param>/dev/random</param>
+        <param>c 1 8</param>
+      </execute>
+      <execute command="mknod">
+        <param>-m 444</param>
+        <param>/dev/urandom</param>
+        <param>c 1 9</param>
+      </execute>
+      <ownership base="/dev" user="root" group="tty">
+        <name>console</name>
+        <name>ptmx</name>
+        <name>tty</name>
+      </ownership>
+      <link>
+        <target>/proc/self/fd</target>
+        <name>/dev/fd</name>
+      </link>
+      <link>
+        <target>/proc/self/fd/0</target>
+        <name>/dev/stdin</name>
+      </link>
+      <link>
+        <target>/proc/self/fd/1</target>
+        <name>/dev/stdout</name>
+      </link>
+      <link>
+        <target>/proc/self/fd/2</target>
+        <name>/dev/stderr</name>
+      </link>
+      <link>
+        <target>/proc/kcore</target>
+        <name>/dev/core</name>
+      </link>
+      <mkdir>
+        <name>/dev/shm</name>
+        <name>/dev/pts</name>
+      </mkdir>
+      <execute command="mount">
+        <param>-t devpts</param>
+        <param>-o gid=4,mode=620</param>
+        <param>none</param>
+        <param>/dev/pts</param>
+      </execute>
+      <execute command="mount">
+        <param>-t tmpfs</param>
+        <param>none</param>
+        <param>/dev/shm</param>
+      </execute>
+    </stage>
+  </stage>
+</alfs>

Copied: profiles/LFS/branches/cross-lfs/chroot/pwdgroup.xml (from rev 1939, profiles/LFS/trunk/chapter06/pwdgroup.xml)
===================================================================
--- profiles/LFS/trunk/chapter06/pwdgroup.xml	2005-07-14 18:51:55 UTC (rev 1939)
+++ profiles/LFS/branches/cross-lfs/chroot/pwdgroup.xml	2005-07-14 19:15:51 UTC (rev 1940)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE alfs SYSTEM "../DTD/ALFS.dtd"
+[
+<!ENTITY % general_entities SYSTEM "../config/general.ent">
+<!ENTITY % config_entities SYSTEM "../config/config.ent">
+
+%general_entities;
+%config_entities;
+]>
+<alfs>
+  <stage name="Creating the passwd, group, and log Files">
+    <copy>
+      <source>&skeleton_dir;/etc/passwd</source>
+      <source>&skeleton_dir;/etc/group</source>
+      <destination>/etc</destination>
+    </copy>
+    <execute command="touch">
+      <param>/var/run/utmp</param>
+      <param>/var/log/{btmp,lastlog,wtmp}</param>
+    </execute>
+    <ownership base="/var" group="utmp">
+      <name>run/utmp</name>
+      <name>log/lastlog</name>
+    </ownership>
+    <permissions base="/var" mode="664">
+      <name>run/utmp</name>
+      <name>log/lastlog</name>
+    </permissions>
+  </stage>
+</alfs>

Added: profiles/LFS/branches/cross-lfs/chroot/util-linux.xml
===================================================================
--- profiles/LFS/branches/cross-lfs/chroot/util-linux.xml	2005-07-14 18:51:55 UTC (rev 1939)
+++ profiles/LFS/branches/cross-lfs/chroot/util-linux.xml	2005-07-14 19:15:51 UTC (rev 1940)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE alfs SYSTEM "../DTD/ALFS.dtd"
+[
+<!ENTITY % general_entities SYSTEM "../config/general.ent">
+<!ENTITY % package_entities SYSTEM "../config/package.ent">
+<!ENTITY % config_entities SYSTEM "../config/config.ent">
+
+%general_entities;
+%package_entities;
+%config_entities;
+]>
+<alfs>
+  <package name="util-linux" version="&util-linux-version;">
+    <stage name="Unpacking">
+      <stageinfo>
+	<user>&lfs-user;</user>
+      </stageinfo>
+      <unpack>
+        <digest>&util-linux-md5;</digest>
+        <archive>&packages_dir;/&util-linux-package;</archive>
+        <destination>&build_dir;</destination>
+      </unpack>
+    </stage>
+    <stage name="Installing">
+      <stageinfo>
+	<user>&lfs-user;</user>
+        <base>&build_dir;/&util-linux-directory;</base>
+      </stageinfo>
+      <copy>
+	<option>preserve</option>
+	<source>configure</source>
+	<destination>configure.orig</destination>
+      </copy>
+      <search_replace>
+        <file>configure</file>
+        <find>/usr/include</find>
+        <replace>/tools/include</replace>
+      </search_replace>
+      <configure />
+      <make>
+	<param>ARCH=""</param>
+	<param>CPU=""</param>
+	<param>-C lib</param>
+      </make>
+      <make>
+	<param>ARCH=""</param>
+	<param>CPU=""</param>
+	<param>-C mount</param>
+	<param>mount umount</param>
+      </make>
+      <make>
+	<param>ARCH=""</param>
+	<param>CPU=""</param>
+	<param>-C text-utils</param>
+	<param>more</param>
+      </make>
+      <copy>
+	<source>mount/mount</source>
+	<source>mount/umount</source>
+	<source>text-utils/more</source>
+	<destination>/tools/bin</destination>
+      </copy>
+    </stage>
+    <stage name="Cleanup">
+      <stageinfo>
+	<user>&lfs-user;</user>
+      </stageinfo>
+      <remove>&build_dir;/&util-linux-directory;</remove>
+    </stage>
+  </package>
+</alfs>

Modified: profiles/LFS/branches/cross-lfs/skeleton/etc/group
===================================================================
--- profiles/LFS/branches/cross-lfs/skeleton/etc/group	2005-07-14 18:51:55 UTC (rev 1939)
+++ profiles/LFS/branches/cross-lfs/skeleton/etc/group	2005-07-14 19:15:51 UTC (rev 1940)
@@ -1,15 +1,7 @@
 root:x:0:
-bin:x:1:
-sys:x:2:
+console:x:1:
+tty:x:2:
 kmem:x:3:
-tty:x:4:
-tape:x:5:
-daemon:x:6:
-floppy:x:7:
-disk:x:8:
-lp:x:9:
-dialout:x:10:
-audio:x:11:
-video:x:12:
-utmp:x:13:
-usb:x:14:
+disk:x:4:
+utmp:x:5:
+nogroup:x:65534:

Modified: profiles/LFS/branches/cross-lfs/skeleton/etc/passwd
===================================================================
--- profiles/LFS/branches/cross-lfs/skeleton/etc/passwd	2005-07-14 18:51:55 UTC (rev 1939)
+++ profiles/LFS/branches/cross-lfs/skeleton/etc/passwd	2005-07-14 19:15:51 UTC (rev 1940)
@@ -1 +1,2 @@
 root:x:0:0:root:/root:/bin/bash
+nobody:x:65534:65534:Nobody:/:/sbin/nologin




More information about the alfs-log mailing list