/[gentoo]/xml/htdocs/doc/en/uml.xml
Gentoo

Diff of /xml/htdocs/doc/en/uml.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.12
1<?xml version='1.0'?> 1<?xml version='1.0' encoding="UTF-8"?>
2<?xml-stylesheet href="/xsl/guide.xsl" type="text/xsl"?> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/uml.xml,v 1.12 2004/01/16 08:21:57 swift Exp $ -->
3 3
4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5 5
6<guide link="/doc/uml.html"> 6<guide link="/doc/en/uml.xml">
7<title>Gentoo Linux Developer's guide to system testing with User-Mode Linux</title> 7<title>Gentoo Linux Developer's guide to system testing with User-Mode Linux</title>
8<author title="Editor"><mail link="g2boojum@gentoo.org">Grant Goodyear</mail></author> 8<author title="Editor"><mail link="g2boojum@gentoo.org">Grant Goodyear</mail></author>
9<author title="Editor"><!-- zhen@gentoo.org -->
10 John Davis
11</author>
12
13<author title="Editor">
14 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
15</author>
16<author title="Editor">
17 <mail link="bennyc@gentoo.org">Benny Chuang</mail>
18</author>
9 19
10<abstract> 20<abstract>
11 This guide shows Gentoo Linux developers how to set up and use 21 This guide shows Gentoo Linux developers how to set up and use
12 user-mode linux for testing potentially system-breaking changes. 22 user-mode linux for testing potentially system-breaking changes.
13</abstract> 23</abstract>
14 24
25<license/>
26
15<version>0.05</version> 27<version>0.3</version>
16<date>5 Mar 2002</date> 28<date>January 16, 2004</date>
17 29
18<chapter> 30<chapter>
19<title>Obtaining User-Mode Linux</title> 31<title>Obtaining User-Mode Linux</title>
20<section> 32<section>
21<body> 33<body>
85To generate this file you will need to have Loopback device 97To generate this file you will need to have Loopback device
86support enabled in the host (non-user-mode) kernel. 98support enabled in the host (non-user-mode) kernel.
87</p> 99</p>
88<p>Generating the <path>root_fs</path> file itself will be 100<p>Generating the <path>root_fs</path> file itself will be
89our last step. First we will generate a Gentoo filesystem in 101our last step. First we will generate a Gentoo filesystem in
90an ordinary chroot. We need the build tarball available, which 102an ordinary chroot. We need the stage tarball available, which
91could be downloaded separately, extracted from a build cd, or 103could be downloaded separately, extracted from a liveCD, or
92extracted from a build .iso. 104extracted from a liveCD .iso.
93</p> 105</p>
94<pre caption="Mounting a build .iso"> 106<pre caption="Mounting a liveCD .iso">
95# <i>mkdir /mnt/loop</i> 107# <i>mkdir /mnt/loop</i>
96# <i>mount -o loop /path/to/build-&lt;TAB&gt;.iso /mnt/loop</i> 108# <i>mount -o loop /path/to/build-&lt;TAB&gt;.iso /mnt/loop</i>
97</pre> 109</pre>
98<p> 110<p>
99Setting up the chroot is essentially identical to an ordinary Gentoo 111Setting up the chroot is essentially identical to an ordinary Gentoo
113# <i>mkdir -p /mnt/gentoo/usr/portage/distfiles</i> 125# <i>mkdir -p /mnt/gentoo/usr/portage/distfiles</i>
114# <i>mkdir -p /mnt/gentoo/usr/portage/packages</i> 126# <i>mkdir -p /mnt/gentoo/usr/portage/packages</i>
115# <i>mount -o bind /usr/portage/distfiles /mnt/gentoo/usr/portage/distfiles</i> 127# <i>mount -o bind /usr/portage/distfiles /mnt/gentoo/usr/portage/distfiles</i>
116# <i>mount -o bind /usr/portage/packages /mnt/gentoo/usr/portage/packages</i> 128# <i>mount -o bind /usr/portage/packages /mnt/gentoo/usr/portage/packages</i>
117# <i>chroot /mnt/gentoo /bin/bash</i> 129# <i>chroot /mnt/gentoo /bin/bash</i>
130<!--per bug 16134, added emerge sync to supress warning, etc-->
131# <i>emerge sync</i>
118# <i>env-update</i> 132# <i>env-update</i>
119# <i>source /etc/profile</i> 133# <i>source /etc/profile</i>
120</pre> 134</pre>
121<p> 135<p>
122By bind-mounting <path>/usr/portage/distfiles</path> and 136By bind-mounting <path>/usr/portage/distfiles</path> and
125</p> 139</p>
126<p> 140<p>
127Bootstrap and build the system in the usual fashion: 141Bootstrap and build the system in the usual fashion:
128</p> 142</p>
129<pre> 143<pre>
130# <i>emerge rsync</i> 144<!--removed the emerge sync below because it is done above-->
131# <i>cd /usr/portage</i> 145# <i>cd /usr/portage</i>
132# <i>nano -w /etc/make.conf</i> 146# <i>nano -w /etc/make.conf</i>
133# <i>nano -w /etc/make.profile/packages</i> 147# <i>nano -w /etc/make.profile/packages</i>
134# <i>nano -w /usr/portage/profiles/package.mask</i> 148# <i>nano -w /usr/portage/profiles/package.mask</i>
135# <i>scripts/bootstrap.sh &amp;&amp; emerge --usepkg system</i> 149# <i>scripts/bootstrap.sh &amp;&amp; emerge --usepkg system</i>
136</pre> 150</pre>
137<warn> 151<warn>
152<!--Changed grub to virtual/bootloader-->
138The <path>/etc/make.profile/packages</path> file needs to be 153The <path>/etc/make.profile/packages</path> file needs to be
139edited to remove grub from the default system (just remove the "*" 154edited to remove the virtual/bootloader ebuild from the default system if it
140from the beginning of the "*sys-apps/grub" line). The grub ebuild 155is listed (just remove the "*" from the beginning of the "*virtual/bootloader"
141tries to mount the /boot partition, which will fail in our chroot. 156line). The virtual/bootloader ebuild tries to mount the /boot partition, which
157will fail in our chroot.
142</warn> 158</warn>
143<note> 159<note>
144Make sure you examine <path>/etc/make.profile/packages</path> 160Make sure you examine <path>/etc/make.profile/packages</path>
145and <path>/usr/portage/profiles/package.mask</path> to be sure that 161and <path>/usr/portage/profiles/package.mask</path> to be sure that
146any to-be-tested packages that you want to install aren't masked out. 162any to-be-tested packages that you want to install aren't masked out.
154Gentoo system a hostname, if you so desire. In <path>/etc/fstab</path> 170Gentoo system a hostname, if you so desire. In <path>/etc/fstab</path>
155you will want <path>/dev/ROOT</path> to be <path>/dev/ubd/0</path>, with 171you will want <path>/dev/ROOT</path> to be <path>/dev/ubd/0</path>, with
156a fs type of either ext2, ext3, or reiserfs. Set <path>/dev/SWAP</path> 172a fs type of either ext2, ext3, or reiserfs. Set <path>/dev/SWAP</path>
157to be <path>/dev/ubd/1</path>, and comment out <path>/dev/BOOT</path>. 173to be <path>/dev/ubd/1</path>, and comment out <path>/dev/BOOT</path>.
158</p> 174</p>
175
176<p> At this point, remember to set your root password. </p>
177
178<pre caption="Setting root password">
179# <i>passwd</i>
180</pre>
181
159<p> 182<p>
160Exit the chroot, unmount all of the bind mounts, 183Exit the chroot, unmount all of the bind mounts,
161tar up the new Gentoo distro, and clean up: 184tar up the new Gentoo distro, and clean up:
162</p> 185</p>
163<pre> 186<pre>
164# <i>exit</i> 187# <i>exit</i>
165# <i>umount /mnt/gentoo/usr/portage/distfiles</i> 188# <i>umount /mnt/gentoo/usr/portage/distfiles</i>
166# <i>umount /mnt/gentoo/usr/portage/packages</i> 189# <i>umount /mnt/gentoo/usr/portage/packages</i>
167# <i>umount /mnt/gentoo/proc</i> 190# <i>umount /mnt/gentoo/proc</i>
168# <i>du -ks /mnt/gentoo</i> 191# <i>du -ks /mnt/gentoo</i>
169261744 /mnt/gentoo 192<!-- wtf is this? 261744 /mnt/gentoo-->
193<!-- added dir change to be more explicit-->
194# <i>cd /mnt/gentoo</i>
170# <i>tar cvjpf ~/gentoo.tbz2 *</i> 195# <i>tar cvjpf ~/gentoo.tbz2 *</i>
171# <i>cd</i> 196# <i>cd</i>
172# <i>rm -rf /mnt/gentoo</i> 197# <i>rm -rf /mnt/gentoo</i>
173</pre> 198</pre>
199
200<p>You might also want to consider reviewing the final steps of the
201<uri link="http://www.gentoo.org/doc/en/gentoo-x86-install.xml">Gentoo Linux x86 Installation Guide</uri>. </p>
174</body> 202</body>
175</section> 203</section>
176 204
177<section> 205<section>
178<title>Making <path>root_fs</path></title> 206<title>Making <path>root_fs</path></title>
210</note> 238</note>
211<p> 239<p>
212With any luck you should be able to log into your user-mode linux 240With any luck you should be able to log into your user-mode linux
213Gentoo system. The only thing keeping this user-mode linux version 241Gentoo system. The only thing keeping this user-mode linux version
214of Gentoo from being fully functional is networking from the virtual 242of Gentoo from being fully functional is networking from the virtual
215machine to the host. Such networking is supposed to be trivial, 243machine to the host.
216but I have yet to get it to work for me. Should you find a workable
217solution, please let me know!
218</p> 244</p>
219</body> 245</body>
220</section> 246</section>
221</chapter> 247</chapter>
222 248
26664 octets from 192.168.0.254: icmp_seq=1 ttl=255 time=0.6 ms 29264 octets from 192.168.0.254: icmp_seq=1 ttl=255 time=0.6 ms
267 293
268--- 192.168.0.254 ping statistics --- 294--- 192.168.0.254 ping statistics ---
2692 packets transmitted, 2 packets received, 0% packet loss 2952 packets transmitted, 2 packets received, 0% packet loss
270round-trip min/avg/max = 0.6/0.7/0.8 ms 296round-trip min/avg/max = 0.6/0.7/0.8 ms
271<i>route add default gw 192.168.0.254</i> 297# <i>route add default gw 192.168.0.254</i>
272<i>netstat -rn</i> 298# <i>netstat -rn</i>
273Kernel IP routing table 299Kernel IP routing table
274Destination Gateway Genmask Flags MSS Window irtt Iface 300Destination Gateway Genmask Flags MSS Window irtt Iface
275192.168.0.0 0.0.0.0 255.255.255.0 U 40 0 0 eth0 301192.168.0.0 0.0.0.0 255.255.255.0 U 40 0 0 eth0
2760.0.0.0 192.168.0.254 0.0.0.0 UG 40 0 0 eth0 3020.0.0.0 192.168.0.254 0.0.0.0 UG 40 0 0 eth0
277<i>scp user@192.168.0.254:/etc/resolv.conf /etc/resolv.conf</i> <comment>(if needed)</comment> 303# <i>scp user@192.168.0.254:/etc/resolv.conf /etc/resolv.conf</i> <comment>(if needed)</comment>
278<i>ping -c 2 www.gentoo.org</i> 304# <i>ping -c 2 www.gentoo.org</i>
279PING www.gentoo.org (207.170.82.202): 56 octets data 305PING www.gentoo.org (207.170.82.202): 56 octets data
28064 octets from 207.170.82.202: icmp_seq=0 ttl=240 time=119.6 ms 30664 octets from 207.170.82.202: icmp_seq=0 ttl=240 time=119.6 ms
28164 octets from 207.170.82.202: icmp_seq=1 ttl=240 time=92.0 ms 30764 octets from 207.170.82.202: icmp_seq=1 ttl=240 time=92.0 ms
282 308
283--- www.gentoo.org ping statistics --- 309--- www.gentoo.org ping statistics ---

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.20