1 |
zhen |
1.3 |
<?xml version='1.0' encoding="UTF-8"?> |
2 |
swift |
1.22 |
<!-- $Header: /home/cvsroot/gentoo/xml/htdocs/doc/en/altinstall.xml,v 1.21 2004/02/19 14:30:59 swift Exp $ --> |
3 |
antifa |
1.12 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
4 |
|
|
|
5 |
drobbins |
1.1 |
|
6 |
zhen |
1.2 |
<guide link="/doc/en/altinstall.xml"> |
7 |
drobbins |
1.1 |
<title>The Gentoo Linux alternative installation method HOWTO</title> |
8 |
gerrynjr |
1.9 |
<author title="Contributor"><mail link="gerrynjr@gentoo.org">Gerald Normandin Jr.</mail></author> |
9 |
|
|
<author title="Contributor"><mail link="lordviram@rebelpacket.net">Travis Tilley</mail></author> |
10 |
|
|
<author title="Contributor"><mail link="volontir@yahoo.com">Oleg Raisky</mail></author> |
11 |
|
|
<author title="Contributor"><mail link="luminousit@hotmail.com">Alex Garbutt</mail></author> |
12 |
|
|
<author title="Contributor"><mail link="alex@openvs.com">Alexandre Georges</mail></author> |
13 |
antifa |
1.15 |
<author title="Contributor"><mail link="vargen@b0d.org">Magnus Backanda</mail></author> |
14 |
klieber |
1.13 |
<author title="Contributor"><mail link="davoid@gentoo.org">Faust A. Tanasescu</mail></author> |
15 |
swift |
1.7 |
<author title="Contributor"><mail link="aliz@gentoo.org">Daniel Ahlberg</mail></author> |
16 |
|
|
<author title="Editor"><mail link="swift@gentoo.org">Sven Vermeulen</mail></author> |
17 |
antifa |
1.15 |
<author title="Reviewer"><mail link="antifa@gentoo.org">Ken Nowack</mail></author> |
18 |
blubber |
1.18 |
<author title="Editor"><mail link="blubber@gentoo.org">Tiemo Kieft</mail></author> |
19 |
drobbins |
1.1 |
<abstract> |
20 |
|
|
This HOWTO is meant to be a repository of alternative Gentoo installation |
21 |
|
|
methods, for those with special installation needs such as lack of a cdrom |
22 |
gerrynjr |
1.14 |
or a computer that can't boot cds. |
23 |
drobbins |
1.1 |
</abstract> |
24 |
|
|
|
25 |
swift |
1.21 |
<license/> |
26 |
|
|
|
27 |
swift |
1.22 |
<version>0.36</version> |
28 |
|
|
<date>March 11, 2004</date> |
29 |
gerrynjr |
1.9 |
|
30 |
drobbins |
1.1 |
<chapter> |
31 |
|
|
<title>About this document</title> |
32 |
|
|
<section> |
33 |
|
|
<body> |
34 |
|
|
|
35 |
|
|
<p>If the standard boot-from-CD install method doesn't work for you |
36 |
|
|
(or you just don't like it), |
37 |
|
|
help is now here. This document serves to |
38 |
|
|
provide a repository of alternative Gentoo Linux installation techniques |
39 |
|
|
to those who need them. |
40 |
|
|
Or, if you prefer, it serves as |
41 |
|
|
a place to put your wacky installation methods. If you have an |
42 |
|
|
installation method that you yourself find useful, or you have devised an |
43 |
gerrynjr |
1.14 |
amusing way of installing Gentoo, please don't hesitate to write something |
44 |
gerrynjr |
1.9 |
up and <mail link="antifa@gentoo.org">send it to me.</mail></p> |
45 |
|
|
|
46 |
|
|
|
47 |
|
|
</body> |
48 |
|
|
</section> |
49 |
|
|
</chapter> |
50 |
|
|
|
51 |
|
|
<chapter> |
52 |
|
|
<title>Booting the LiveCD with Smart BootManager</title> |
53 |
|
|
<section> |
54 |
|
|
|
55 |
|
|
<body> |
56 |
gerrynjr |
1.14 |
<p>Download Smart BootManager <uri link="http://btmgr.sourceforge.net/index.php3?body=download.html">http://btmgr.sourceforge.net/index.php3?body=download.html</uri>. Linux source or binary format and windows .exe versions are available as well as many language packs. However, at this time, the preferred method would be to use the binary format, as the source will not compile with newer versions of NASM.</p> |
57 |
gerrynjr |
1.9 |
|
58 |
|
|
<p>Either compile the package from source or just grab the binary. There are several options that can be utilized while creating your boot floppy, as seen below.</p> |
59 |
|
|
|
60 |
|
|
<pre caption="Smart BootManager Options"> |
61 |
|
|
<i>sbminst [-t theme] [-d drv] [-b backup_file] [-u backup_file] |
62 |
|
|
|
63 |
|
|
-t theme select the theme to be used, in which the theme could be: |
64 |
|
|
us = English theme de = German theme |
65 |
|
|
hu = Hungarian theme zh = Chinese theme |
66 |
|
|
ru = Russian theme cz = Czech theme |
67 |
|
|
es = Spanish theme fr = French theme |
68 |
|
|
pt = Portuguese theme |
69 |
|
|
|
70 |
|
|
|
71 |
|
|
-d drv set the drive that you want to install Smart BootManager on; |
72 |
|
|
for Linux: |
73 |
|
|
/dev/fd0 is the first floppy driver, |
74 |
|
|
/dev/hda is the first IDE harddisk driver. |
75 |
|
|
/dev/sda is the first SCSI harddisk driver. |
76 |
|
|
for DOS: |
77 |
|
|
0 is the first floppy drive |
78 |
|
|
128 is the first hard drive; |
79 |
|
|
|
80 |
|
|
-c disable CD-ROM booting feature; |
81 |
|
|
|
82 |
gerrynjr |
1.14 |
-b backup_file backup the data that will be overwritten for |
83 |
gerrynjr |
1.9 |
future uninstallation; |
84 |
|
|
|
85 |
|
|
-u backup_file uninstall Smart BootManager, should be used alone; |
86 |
|
|
|
87 |
|
|
-y do not ask any question or warning.</i> |
88 |
|
|
</pre> |
89 |
|
|
|
90 |
|
|
<pre caption="Using sbminst to build the boot floppy"> |
91 |
|
|
# <i>sbminst -t us -d /dev/fd0</i> |
92 |
|
|
</pre> |
93 |
|
|
<note> Replace fd0 with your repective floppy device name if yours is different. </note> |
94 |
|
|
<p>Now simply place the floppy in the floppy drive of the computer you'd like to boot the LiveCD on, as well as placing the LiveCD in the CD-ROM and boot the computer.</p> |
95 |
|
|
|
96 |
|
|
<p>You'll be greeted with the Smart BootManager dialog. Select your CD-ROM and press ENTER to boot the LiveCD. Once booted proceed with the standard installation instructions.</p> |
97 |
|
|
|
98 |
|
|
<p>Further information on Smart BootManager may be found at <uri>http://btmgr.sourceforge.net/</uri></p> |
99 |
|
|
</body> |
100 |
|
|
</section> |
101 |
|
|
</chapter> |
102 |
|
|
|
103 |
|
|
|
104 |
|
|
<chapter> |
105 |
|
|
<title>Knoppix Installation</title> |
106 |
|
|
<section> |
107 |
|
|
|
108 |
|
|
<body> |
109 |
|
|
<p>Booting from the <uri link="http://www.knoppix.org/">Knoppix</uri> LiveCD is a way to have a fully functional linux system while you're compiling Gentoo. Tux Racer will help you pass the time while you wait for bootstrap.</p> |
110 |
|
|
|
111 |
|
|
<p>Boot from the Knoppix CD. It generally does a really good job of hardware detection. Although, you may have to add some boot options. </p> |
112 |
|
|
|
113 |
|
|
<p>By default Knoppix boots into a KDE 3.0 desktop. The first thing I did was open a konsole and typed <c>sudo passwd root</c>. This lets you set the root password for Knoppix.</p> |
114 |
|
|
|
115 |
|
|
<p> Next, I su to root and typed <c>usermod -d /root -m root</c>. This sets user roots home directory to /root (the Gentoo way) from /home/root (the Knoppix way). If you do not do this, then you will receive errors when emerging about "/home/root: not found" or something to that effect.</p> |
116 |
|
|
|
117 |
swift |
1.22 |
<p>I then typed <c>exit</c> and then <c>su</c> back into root. This loads the change that was made with the usermod command. Now create the <path>/mnt/gentoo</path> mountpoint using <c>mkdir</c>:</p> |
118 |
swift |
1.16 |
|
119 |
swift |
1.22 |
<pre caption="Creating the /mnt/gentoo mountpoint"> |
120 |
|
|
# <i>mkdir /mnt/gentoo</i> |
121 |
|
|
</pre> |
122 |
|
|
|
123 |
|
|
<p>At this point, you can pick up with the standard install documentation at step 6. However, when you're asked to mount the proc system, issue the following command instead: </p> |
124 |
|
|
|
125 |
|
|
<pre caption = "Bind-mounting the proc pseudo filesystem"> |
126 |
swift |
1.16 |
# <i>mount -o bind /proc /mnt/gentoo/proc</i> |
127 |
|
|
</pre> |
128 |
|
|
|
129 |
gerrynjr |
1.9 |
</body> |
130 |
|
|
</section> |
131 |
|
|
</chapter> |
132 |
|
|
|
133 |
|
|
<chapter> |
134 |
|
|
<title>Installing from Stage 1 without network access</title> |
135 |
|
|
<section> |
136 |
|
|
<body> |
137 |
|
|
|
138 |
|
|
|
139 |
|
|
<p>Burn a LiveCD iso.</p> |
140 |
|
|
|
141 |
gerrynjr |
1.14 |
<p>Get the latest portage snapshot from <uri>http://distro.ibiblio.org/pub/linux/distributions/gentoo/snapshots/</uri> (or your favorite <uri link="http://www.gentoo.org/main/en/mirrors.xml">mirror</uri>). Either place this tarball on an existing partition on the computer your are installing to, or burn it to a CD.</p> |
142 |
gerrynjr |
1.9 |
|
143 |
|
|
<p>You'll also need a package list for the stage packages. Place the following dl-list.sh script on the same medium as the portage snapshot, you'll need it later.</p> |
144 |
|
|
|
145 |
|
|
<pre caption="dl-list.sh"> |
146 |
|
|
#!/bin/bash |
147 |
|
|
|
148 |
|
|
# set your defaults here: |
149 |
|
|
user_defs() { |
150 |
|
|
|
151 |
|
|
# portage directory (without a trailing "/"): |
152 |
|
|
portage_dir="/usr/portage" |
153 |
|
|
|
154 |
|
|
# default download mirror (without a trailing "/"): |
155 |
|
|
gentoo_mirror="http://www.ibiblio.org/pub/Linux/distributions/gentoo" |
156 |
|
|
|
157 |
|
|
# default sourceforge mirror (unc, telia, belnet): |
158 |
|
|
sourceforge_mirror="unc" |
159 |
|
|
|
160 |
|
|
# fix gnu mirror entries |
161 |
|
|
gnu_url="ftp:\/\/ftp.gnu.org\/pub\/gnu" |
162 |
|
|
|
163 |
|
|
} |
164 |
|
|
|
165 |
|
|
|
166 |
|
|
#------------------------------------------------------------ |
167 |
|
|
|
168 |
|
|
# function to remove temporary files |
169 |
|
|
cleanup() { |
170 |
|
|
|
171 |
|
|
rm -f $temp_file_1 $temp_file_2 |
172 |
|
|
exit $1 |
173 |
|
|
|
174 |
|
|
} |
175 |
|
|
|
176 |
|
|
# set user defaults |
177 |
|
|
user_defs |
178 |
|
|
|
179 |
|
|
# set the complete url for the sourceforge mirror |
180 |
|
|
# (the \'s are needed because this goes in a sed command) |
181 |
|
|
sourceforge_mirror_complete="http:\/\/$sourceforge_mirror.dl.sourceforge.net\/sourceforge" |
182 |
|
|
|
183 |
|
|
# initialize counters |
184 |
|
|
num_files=0 |
185 |
|
|
num_alt_urls=0 |
186 |
|
|
total_size=0 |
187 |
|
|
|
188 |
|
|
# initialize lists (arrays) |
189 |
|
|
declare -a def_urls_arr |
190 |
|
|
declare -a alt_urls_arr |
191 |
|
|
|
192 |
|
|
# create 2 temporary files |
193 |
|
|
temp_file_1=`mktemp -t dl-list.XXXXXX` || cleanup 1 |
194 |
|
|
temp_file_2=`mktemp -t dl-list.XXXXXX` || cleanup 1 |
195 |
|
|
|
196 |
|
|
# run "emerge -p <args>" (too easy to forget the "-p" in the command line...) |
197 |
|
|
emerge -p $@ > $temp_file_1 || cleanup 1 |
198 |
|
|
|
199 |
|
|
# remove the lines that do not contain the word "ebuild" |
200 |
|
|
sed -n -e '/ebuild/p' $temp_file_1 > $temp_file_2 |
201 |
|
|
|
202 |
|
|
# count how many lines were left |
203 |
|
|
num_ebuilds=`wc -l $temp_file_2 | sed -e 's/\(.*\) \(.*\)/\1/'` |
204 |
|
|
|
205 |
|
|
# extract the useful information from those lines: category, package and version |
206 |
|
|
#sed -e 's:\(.*\) \(.*\)/\(.*\)-\([0-9].*\) \(.*\) \(.*\):\2 \3 \4:' $temp_file_2 > $temp_file_1 |
207 |
|
|
sed -e 's:\(.*\) \(.*\)/\(.*\)-\([0-9].*\):\2 \3 \4:' $temp_file_2 > $temp_file_1 |
208 |
|
|
|
209 |
|
|
# display starting message :) |
210 |
|
|
echo -n "Generating list " >&2 |
211 |
|
|
|
212 |
|
|
# process each package in turn |
213 |
|
|
while read category package version rest |
214 |
|
|
do |
215 |
|
|
|
216 |
|
|
# form the name of the digest file |
217 |
|
|
|
218 |
|
|
digest_file="$portage_dir/$category/$package/files/digest-$package-$version" |
219 |
|
|
|
220 |
|
|
# process the contents of the digest file |
221 |
|
|
while read md5_flag md5_sum file_name file_size |
222 |
|
|
do |
223 |
|
|
|
224 |
|
|
# form the default url to download the file |
225 |
|
|
def_urls_arr[$num_files]="$gentoo_mirror/distfiles/$file_name" |
226 |
|
|
|
227 |
|
|
# increment the file counter |
228 |
|
|
num_files=$(($num_files + 1)) |
229 |
|
|
|
230 |
|
|
# update the size accumulator (in kilobytes) |
231 |
|
|
total_size=$(($total_size + $file_size / 1024)) |
232 |
|
|
|
233 |
|
|
done < $digest_file |
234 |
|
|
|
235 |
|
|
# form the "ebuild depend" command line |
236 |
|
|
ebuild_depend_cmd="ebuild $portage_dir/$category/$package/$package-${version}.ebuild depend" |
237 |
|
|
|
238 |
|
|
# execute the "ebuild depend" command |
239 |
|
|
$ebuild_depend_cmd || cleanup 1 |
240 |
|
|
|
241 |
|
|
# form the name of the dependency file |
242 |
|
|
dependency_file="/var/cache/edb/dep/$category/$package-$version" |
243 |
|
|
|
244 |
|
|
# read in the 4th line from the dependency file, |
245 |
|
|
# which contains the official download urls |
246 |
|
|
alt_urls=`head -n 4 $dependency_file | tail -n 1` |
247 |
|
|
|
248 |
|
|
# ignore empty url list |
249 |
|
|
if [ -n "$alt_urls" ] |
250 |
|
|
then |
251 |
|
|
|
252 |
|
|
# split the urls list into $1..$N |
253 |
|
|
set $alt_urls |
254 |
|
|
|
255 |
|
|
# process each url in turn |
256 |
|
|
for i in $@ |
257 |
|
|
do |
258 |
|
|
|
259 |
|
|
# remove the (use)? strings from the url list |
260 |
|
|
alt_url_tmp=`echo "$i" | sed -e '/\?$/d'` |
261 |
|
|
|
262 |
|
|
# remove the "mirror://gnome" urls |
263 |
|
|
alt_url_tmp=`echo "$alt_url_tmp" | sed -e '/^mirror:\/\/gnome/d'` |
264 |
|
|
|
265 |
|
|
# remove the "mirror://kde" urls |
266 |
|
|
alt_url_tmp=`echo "$alt_url_tmp" | sed -e '/^mirror:\/\/kde/d'` |
267 |
|
|
|
268 |
|
|
# remove the "mirror://gentoo" urls (already included) |
269 |
|
|
alt_url_tmp=`echo "$alt_url_tmp" | sed -e '/^mirror:\/\/gentoo/d'` |
270 |
|
|
|
271 |
|
|
# translate the "mirror://sourceforge" urls into valid urls |
272 |
|
|
alt_url_tmp=`echo "$alt_url_tmp" | sed -e "s/mirror:\/\/sourceforge/$sourceforge_mirror_complete/"` |
273 |
|
|
|
274 |
|
|
# translate the "mirror://gnu" urls into valid urls |
275 |
|
|
alt_url_tmp=`echo "$alt_url_tmp" | sed -e "s/mirror:\/\/gnu/$gnu_url/"` |
276 |
|
|
# ignore empty urls |
277 |
|
|
if [ -n "$alt_url_tmp" ] |
278 |
|
|
then |
279 |
|
|
|
280 |
|
|
# add the url to the list |
281 |
|
|
alt_urls_arr[$num_alt_urls]=$alt_url_tmp |
282 |
|
|
|
283 |
|
|
# increment the alternate url counter |
284 |
|
|
num_alt_urls=$(($num_alt_urls + 1)) |
285 |
|
|
|
286 |
|
|
fi |
287 |
|
|
|
288 |
|
|
done |
289 |
|
|
|
290 |
|
|
fi |
291 |
|
|
|
292 |
|
|
# a progress bar :) |
293 |
|
|
echo -n "." >&2 |
294 |
|
|
|
295 |
|
|
done < $temp_file_1 |
296 |
|
|
|
297 |
|
|
# display ending message :) |
298 |
|
|
echo " done." >&2 |
299 |
|
|
|
300 |
|
|
# display default urls list |
301 |
|
|
for i in ${def_urls_arr[@]}; do echo $i; done | sort |
302 |
|
|
|
303 |
|
|
# display alternate urls list |
304 |
|
|
for i in ${alt_urls_arr[@]}; do echo $i; done | sort |
305 |
|
|
|
306 |
|
|
# display totals |
307 |
|
|
echo "Totals:" $num_ebuilds "ebuilds," $num_files "files," $num_files "default urls," \n |
308 |
|
|
$num_alt_urls "alternate urls," "${total_size}Kb." <&2 |
309 |
|
|
|
310 |
|
|
# remove temporary files and exit |
311 |
|
|
cleanup 0 |
312 |
|
|
</pre> |
313 |
|
|
|
314 |
gerrynjr |
1.14 |
<p>Follow all instructions of Gentoo Install Doc up to <c>chroot /mnt/gentoo</c> in Step 8. If you only have one CD-ROM remember to use the <c>cdcache</c> option while booting so you can unmount the LiveCD and mount your portage snapshot CD.</p> |
315 |
gerrynjr |
1.9 |
|
316 |
blubber |
1.18 |
<p>Open a new console (Alt-F2), we will continue with the Install Doc up to running the bootstrap.sh script.</p> |
317 |
gerrynjr |
1.9 |
|
318 |
blubber |
1.18 |
<warn>Older realeases of the livecd required you to change the password using the <c>passwd</c> command, before logging in manually.</warn> |
319 |
|
|
|
320 |
gerrynjr |
1.9 |
|
321 |
gerrynjr |
1.14 |
<p>Go back to the first console (Alt-F1, without chroot) and mount a second CD on <path>/mnt/gentoo/mnt/cdrom2</path>. Copy the portage tarball from cdrom2 and unpack it to <path>/mnt/gentoo/usr/portage</path>. Further, grab the dl-list.sh script and place it in <path>/usr/sbin</path> and make it executable.</p> |
322 |
gerrynjr |
1.9 |
|
323 |
|
|
<pre caption="Mount the snapshot cd"> |
324 |
|
|
# <i>umount /mnt/cdrom</i> |
325 |
|
|
# <i>mkdir /mnt/gentoo/mnt/cdrom2</i> |
326 |
|
|
# <i>mount /dev/cdroms/cdrom0 /mnt/gentoo/mnt/cdrom2</i> |
327 |
|
|
# <i>cp /mnt/gentoo/mnt/cdrom2/portage-$date.tar.bz2 /mnt/gentoo/usr/portage</i> |
328 |
|
|
# <i>cp /mnt/gentoo/mnt/cdrom2/dl-list.sh /mnt/gentoo/usr/sbin</i> |
329 |
|
|
# <i>cd /mnt/gentoo/usr/portage</i> |
330 |
|
|
# <i>tar xvjpf portage-$date.tar.bz2</i> |
331 |
|
|
# <i>chmod +x /mnt/gentoo/usr/sbin/dl-list.sh</i> |
332 |
|
|
</pre> |
333 |
|
|
|
334 |
gerrynjr |
1.14 |
<p>Switch back to the F2 console. Now if you try to run bootstrap.sh it will fail because it won't be able to download any files. We will fetch these files somewhere else and put them in /usr/portage/distfiles (on F2 console). </p> |
335 |
gerrynjr |
1.9 |
|
336 |
|
|
<p>You need a list of Stage1 packages: glibc, baselayout, texinfo, gettext, zlib, binutils, gcc, ncurses plus their dependencies. </p> |
337 |
|
|
|
338 |
|
|
<note>Note that you need the versions of each package synced with your portage tree.</note> |
339 |
|
|
|
340 |
gerrynjr |
1.14 |
<p>Now use the dl-list.sh script to generate the package list that you need. Then copy the subsequent list to a floppy.</p> |
341 |
gerrynjr |
1.9 |
|
342 |
|
|
<pre caption="Using dl-list.sh"> |
343 |
|
|
# <i>dl-list.sh glibc baselayout texinfo gettext zlib binutils gcc ncurses > stage1.list</i> |
344 |
|
|
# <i>mount -t vfat /dev/fd0 /mnt/floppy</i> |
345 |
|
|
# <i>cp /mnt/gentoo/stage1.list /mnt/floppy</i> |
346 |
|
|
# <i>umount /mnt/floppy</i> |
347 |
|
|
</pre> |
348 |
|
|
|
349 |
gerrynjr |
1.14 |
<p>Take the floppy to the computer that has fast access and feed this list to wget:</p> |
350 |
gerrynjr |
1.9 |
|
351 |
|
|
<pre caption="Use wget to grab your source packages"> |
352 |
|
|
# <i>wget -N -i stage1.list</i> |
353 |
|
|
</pre> |
354 |
|
|
|
355 |
|
|
|
356 |
gerrynjr |
1.14 |
<p>Once you have obtained all the files, take them to the computer and copy them to <path>/mnt/gentoo/usr/portage/distfiles</path>. You will then be able to run <c>bootstrap.sh</c>. Repeat this same wget fetch and place procedure for stage2 and 3.</p> |
357 |
gerrynjr |
1.9 |
|
358 |
drobbins |
1.1 |
|
359 |
|
|
|
360 |
|
|
</body> |
361 |
|
|
</section> |
362 |
|
|
</chapter> |
363 |
|
|
|
364 |
gerrynjr |
1.9 |
<chapter><title>Diskless install using PXE boot</title> |
365 |
|
|
|
366 |
|
|
<section><title>Requirements</title> |
367 |
|
|
<body> |
368 |
|
|
<p>You will need a network card on the diskless client that uses the PXE protocol to boot, like many 3com cards. You will also need a BIOS that supports booting from PXE.</p> |
369 |
|
|
</body></section> |
370 |
|
|
|
371 |
|
|
<section><title>Server base setup</title> |
372 |
|
|
<body> |
373 |
gerrynjr |
1.14 |
<p>Create directories: The first thing to do is to create the directories where your diskless system will be stored. Create a directory called <path>/diskless</path> which houses a directory for each diskless client. For the rest of this howto we'll be working on the client 'eta'.</p> |
374 |
gerrynjr |
1.9 |
|
375 |
|
|
<pre caption="directory setup"> |
376 |
|
|
# <i>mkdir /diskless</i> |
377 |
|
|
# <i>mkdir /diskless/eta</i> |
378 |
|
|
# <i>mkdir /diskless/eta/boot</i> |
379 |
|
|
</pre> |
380 |
|
|
|
381 |
gerrynjr |
1.14 |
<p>DHCP and TFTP setup: The client will get boot informations using DHCP and download all the required files using TFTP. Just emerge DHCP and configure it for your basic needs. Then, add the following on <path>/etc/dhcp/dhcpd.conf</path>.</p> |
382 |
gerrynjr |
1.9 |
|
383 |
gerrynjr |
1.14 |
<note>This provide a static IP address for the client and the path of a PXE boot image, here pxegrub. You have to replace the MAC address of the Ethernet card of the client and the directory where you will put the client files with the one you use.</note> |
384 |
gerrynjr |
1.9 |
|
385 |
|
|
<pre caption="dhcp.conf"> |
386 |
|
|
option option-150 code 150 = text ; |
387 |
|
|
host eta { |
388 |
|
|
hardware ethernet 00:00:00:00:00:00; |
389 |
|
|
fixed-address <c>ip.add.re.ss</c>; |
390 |
|
|
option option-150 "/eta/boot/grub.lst"; |
391 |
|
|
filename "/eta/boot/pxegrub"; |
392 |
|
|
} |
393 |
|
|
</pre> |
394 |
|
|
|
395 |
gerrynjr |
1.14 |
<p>For TFTP, emerge <c>app-admin/tftp-hpa</c>. In <path>/etc/conf.d/in.tftpd</path>, put the following :</p> |
396 |
gerrynjr |
1.9 |
|
397 |
|
|
<pre caption="in.tftpd"> |
398 |
|
|
INTFTPD_PATH="/diskless" |
399 |
|
|
INTFTPD_USER="nobody" |
400 |
|
|
INTFTPD_OPTS="-u ${INTFTPD_USER} -l -vvvvvv -p -c -s ${INTFTPD_PATH}" |
401 |
|
|
</pre> |
402 |
|
|
|
403 |
gerrynjr |
1.14 |
<p>Setup GRUB: To provide PXE booting I use GRUB. You have to compile it by yourself to enable the PXE image compilation ... but that's quite easy. First, get the latest version of the GRUB source code (<c>emerge -f grub</c> will place the tarball in <path>/usr/portage/distfiles</path>). Copy the tarball to <path>/diskless</path> and then build it to make the pxe capable binary. Once the binary is built, copy it to the diskless client's boot directory. Then edit it's grub.lst config file.</p> |
404 |
gerrynjr |
1.9 |
|
405 |
|
|
<pre caption="grub setup"> |
406 |
|
|
# <i>tar zxvf grub-0.92.tar.gz</i> |
407 |
|
|
# <i>cd grub-0.92</i> |
408 |
|
|
# <i>./configure --help</i> |
409 |
|
|
<codenote>In the options you will see a list of supported network interface drivers. </codenote> |
410 |
|
|
<codenote>Select the driver compatible with your card. Herein referenced a $nic</codenote> |
411 |
|
|
# <i>./configure --enable-diskless --enable-$nic</i> |
412 |
|
|
# <i>make</i> |
413 |
|
|
# <i>cd stage2</i> |
414 |
|
|
# <i>cp pxegrub /diskless/eta/boot/pxegrub</i> |
415 |
|
|
# <i>nano -w /diskless/eta/boot/grub.lst</i> |
416 |
|
|
</pre> |
417 |
|
|
|
418 |
|
|
<pre caption="grub.lst"> |
419 |
|
|
default 0 |
420 |
|
|
timeout 30 |
421 |
|
|
|
422 |
|
|
title=Diskless Gentoo |
423 |
|
|
root (nd) |
424 |
|
|
kernel /eta/bzImage ip=dhcp root=/dev/nfs nfsroot=<c>ip.add.re.ss</c>:/diskless/eta |
425 |
drobbins |
1.1 |
|
426 |
gerrynjr |
1.9 |
<codenote>For the nfsroot option, the IP address is the one of the server and </codenote> |
427 |
|
|
<codenote>the directory is the one where your diskless client files are located (on the server).</codenote> |
428 |
|
|
</pre> |
429 |
|
|
|
430 |
gerrynjr |
1.14 |
<p>Setup NFS: NFS is quite easy to configure. The only thing you have to do is to add a line on the <path>/etc/exports</path> config file :</p> |
431 |
gerrynjr |
1.9 |
|
432 |
|
|
<pre caption="/etc/exports"> |
433 |
|
|
# <i>nano -w /etc/exports</i> |
434 |
|
|
NFS file systems being exported. See exports(5). |
435 |
|
|
/diskless/eta eta(rw,sync,no_root_squash) |
436 |
|
|
</pre> |
437 |
|
|
|
438 |
gerrynjr |
1.14 |
<p>Update your hosts: One important thing to do now is to modify your <path>/etc/hosts</path> file to fit your needs. </p> |
439 |
gerrynjr |
1.9 |
|
440 |
|
|
<pre caption="/etc/hosts"> |
441 |
|
|
127.0.0.1 localhost |
442 |
|
|
|
443 |
|
|
192.168.1.10 eta.example.com eta |
444 |
|
|
192.168.1.20 sigma.example.com sigma |
445 |
|
|
</pre> |
446 |
|
|
</body> |
447 |
|
|
</section> |
448 |
|
|
|
449 |
|
|
<section><title>Creating the system on the server</title> |
450 |
|
|
|
451 |
|
|
<body> |
452 |
|
|
|
453 |
gerrynjr |
1.14 |
<p>Reboot the server on a Gentoo LiveCD. Follow the standard install procedure as explained in the Gentoo Install Howto BUT with the following differences. When you mount the file system, do the following (where hdaX is the partition where you created the /diskless directory). You do not need to mount any other partitions as all of the files will reside in the <path>/diskless/eta</path> directory.</p> |
454 |
gerrynjr |
1.9 |
|
455 |
|
|
<pre caption="mounting the filesystem"> |
456 |
|
|
#<i> mount /dev/hda3 /mnt/gentoo</i> |
457 |
|
|
</pre> |
458 |
|
|
|
459 |
gerrynjr |
1.14 |
<p>Stage tarballs and chroot: This example uses a stage3 tarball. Mount <path>/proc</path> to your diskless directory and chroot into it to continue with the install. Then follow the installation manual until kernel configuration.</p> |
460 |
gerrynjr |
1.9 |
|
461 |
|
|
<warn>Be very careful where you extract your stage tarball. You don't want to end up extracting over your existing installation.</warn> |
462 |
|
|
|
463 |
|
|
<pre caption="extracting the stage tarball"> |
464 |
|
|
# <i>cd /mnt/gentoo/diskless/eta/</i> |
465 |
|
|
# <i>tar -xvjpf /mnt/cdrom/gentoo/stage3-*.tar.bz2</i> |
466 |
|
|
# <i>mount -t proc /proc /mnt/gentoo/diskless/eta/proc</i> |
467 |
|
|
# <i>cp /etc/resolv.conf /mnt/gentoo/diskless/eta/etc/resolv.conf</i> |
468 |
|
|
# <i>chroot /mnt/gentoo/diskless/eta/ /bin/bash</i> |
469 |
|
|
# <i>env-update</i> |
470 |
|
|
# <i>source /etc/profile</i> |
471 |
|
|
</pre> |
472 |
|
|
|
473 |
|
|
<p>Kernel configuration: When you do the <c>make menuconfig</c> of your kernel configuration, don't forget to enable the following options with the others recommended into the install howto.</p> |
474 |
|
|
|
475 |
|
|
<pre caption="menuconfig options"> |
476 |
|
|
- Your network card device support |
477 |
|
|
|
478 |
|
|
- Under "Networking options" : |
479 |
|
|
|
480 |
|
|
[*] TCP/IP networking |
481 |
|
|
[*] IP: kernel level autoconfiguration |
482 |
|
|
[*] IP: DHCP support |
483 |
|
|
[*] IP: BOOTP support |
484 |
|
|
|
485 |
|
|
|
486 |
|
|
- Under "File systems --> Network File Systems" : |
487 |
|
|
|
488 |
|
|
<*> NFS file system support |
489 |
|
|
[*] Provide NFSv3 client support |
490 |
|
|
[*] Root file system on NFS |
491 |
|
|
</pre> |
492 |
|
|
|
493 |
gerrynjr |
1.14 |
<p>Next configure your diskless client's <path>/etc/fstab</path>.</p> |
494 |
gerrynjr |
1.9 |
|
495 |
|
|
<pre caption="/etc/fstab"> |
496 |
|
|
# <i>nano -w /etc/fstab</i> |
497 |
|
|
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0 |
498 |
|
|
proc /proc proc defaults 0 0 |
499 |
|
|
tmpfs /dev/shm tmpfs defaults 0 0 |
500 |
|
|
</pre> |
501 |
|
|
|
502 |
gerrynjr |
1.14 |
<p>Bootloader. Don't install another bootloader because we already have one - pxegrub. Simply finish the install and restart the server. Start the services you'll need to boot the new client: DHCP, TFTPD, and NFS.</p> |
503 |
gerrynjr |
1.9 |
|
504 |
|
|
<pre caption="Starting services"> |
505 |
|
|
# <i>/etc/init.d/dhcp start</i> |
506 |
|
|
# <i>/etc/init.d/tftpd start</i> |
507 |
|
|
# <i>/etc/init.d/nfs start</i> |
508 |
|
|
</pre> |
509 |
|
|
|
510 |
|
|
</body></section> |
511 |
|
|
|
512 |
|
|
<section><title>Booting the new client</title> |
513 |
|
|
<body> |
514 |
gerrynjr |
1.14 |
<p>For the new client to boot properly, you'll need to configure the bios and the network card to use PXE as the first boot method - before CD-ROM or floppy. For help with this consult your hardware manuals or manufacturers website. The network card should get an IP address using DHCP and download the GRUB PXE image using TFTP. Then, you should see a nice black and white GRUB bootmenu where you will select the kernel to boot and press Enter. If everything is ok the kernel should boot, mount the root filesystem using NFS and provide you with a login prompt. Enjoy.</p> |
515 |
gerrynjr |
1.9 |
</body></section> |
516 |
|
|
|
517 |
|
|
</chapter> |
518 |
drobbins |
1.1 |
|
519 |
|
|
|
520 |
|
|
|
521 |
|
|
<chapter> <title>Installing Gentoo from an existing Linux distribution </title> |
522 |
|
|
<section> <title> Requirements </title> |
523 |
|
|
<body> |
524 |
|
|
<p>In order to install Gentoo from your existing Linux distribution you need to |
525 |
|
|
have chroot command installed, and have a copy of the Gentoo installation |
526 |
|
|
tarball or ISO you want to install. A network connection would be preferable if |
527 |
|
|
you want more than what's supplied in your tarball. (by the way, a tarball is |
528 |
|
|
just a file ending in .tbz or .tar.gz). The author used RedHat Linux 7.3 as the |
529 |
|
|
"host" operating system, but it is not very important. Let's get started! </p> |
530 |
|
|
</body> |
531 |
|
|
</section> |
532 |
|
|
|
533 |
|
|
<section> <title> Overview </title> |
534 |
|
|
<body> |
535 |
gerrynjr |
1.14 |
<p>We will first allocate a partition to Gentoo by resizing our existing Linux partition, mount the partition, untar the tarball that is mounted, chroot inside the psuedo-system and start building. Once the bootstrap process is done, we will do some final configuration on the system so as to make sure it boots, then we are ready to reboot and use Gentoo. </p> |
536 |
drobbins |
1.1 |
</body> |
537 |
|
|
</section> |
538 |
|
|
|
539 |
gerrynjr |
1.14 |
<section> <title> How should we make space for Gentoo? </title> |
540 |
drobbins |
1.1 |
<body> |
541 |
|
|
|
542 |
|
|
<p> |
543 |
gerrynjr |
1.14 |
The root partition is the filesystem mounted under <path>/</path>. A quick run of mount on my system shows what I am talking about. We well also use df (disk free) to see how much space I have left and how I will be resizing. Note that it is not mandatory to resize your root partition! You could be resizing anything else supported by our resizer, but let's talk about that later.</p> |
544 |
drobbins |
1.1 |
|
545 |
|
|
|
546 |
|
|
<pre caption="Filesystem information"> |
547 |
|
|
# <i>mount</i> |
548 |
|
|
/dev/hdb2 on / type ext3 (rw) |
549 |
|
|
none on /proc type proc (rw) |
550 |
|
|
none on /dev/pts type devpts (rw,gid=5,mode=620) |
551 |
|
|
none on /dev/shm type tmpfs (rw) |
552 |
|
|
# <i>df -h </i> |
553 |
|
|
Filesystem Size Used Avail Use% Mounted on |
554 |
|
|
/dev/hdb2 4.0G 1.9G 2.4G 82% / |
555 |
|
|
none 38M 0 38M 0% /dev/shm |
556 |
|
|
</pre> |
557 |
|
|
|
558 |
gerrynjr |
1.14 |
<p>As we can see, the partition mounted as <path>/</path> named <path>/dev/hdb2</path> has 2.4 gigabytes free. In my case, I think I will resize it as to leave 400Megs free of space, therefore allocating 2 gigabytes for Gentoo. Not bad, I could have quite some stuff installed. However, think that even one gigabyte is enough for most users. So let's partition this thing! </p> |
559 |
drobbins |
1.1 |
|
560 |
swift |
1.21 |
</body> |
561 |
|
|
</section> |
562 |
drobbins |
1.1 |
|
563 |
swift |
1.21 |
<section> |
564 |
|
|
<title>Building parted to resize partition</title> |
565 |
drobbins |
1.1 |
<body> |
566 |
swift |
1.21 |
|
567 |
|
|
<p> |
568 |
|
|
Parted is an utility supplied by the GNU foundation, an old and respectable huge project whose software you are using in this very moment. There is one tool, however, that is extremely useful for us at the moment. It's called parted, partition editor and we can get it from <uri>http://www.gnu.org/software/parted/</uri> |
569 |
drobbins |
1.1 |
</p> |
570 |
swift |
1.21 |
|
571 |
|
|
<note> |
572 |
|
|
There are other tools for doing resize of partitions as well, but author |
573 |
drobbins |
1.1 |
is unsure/uninterested whether PartitionMagic(tm) or other software of the kind |
574 |
swift |
1.21 |
do the job. It's the reader's job to check them out |
575 |
|
|
</note> |
576 |
drobbins |
1.1 |
|
577 |
|
|
<p> |
578 |
|
|
Look up on that page the type of filesystem you want to resize and see if parted |
579 |
|
|
can do it. If not, you're out of luck, you will have to destroy some partition |
580 |
gerrynjr |
1.14 |
to make space for Gentoo, and reinstall back. Go ahead by downloading the |
581 |
drobbins |
1.1 |
software, install it. Here we have a problem. We want to resize our Linux root |
582 |
|
|
partition, therefore we must boot from a floppy disk a minimal linux system and |
583 |
gerrynjr |
1.14 |
use previously-compiled parted copied to a diskette in order to resize <path>/</path>. |
584 |
drobbins |
1.1 |
However, if you can unmount the partition while still in Linux you are lucky, |
585 |
|
|
you don't need to do what follows. Just compile parted and run it on an |
586 |
|
|
unmounted partition you chose to resize. Here's how I did it for my system. |
587 |
|
|
</p> |
588 |
|
|
|
589 |
swift |
1.21 |
<impo> |
590 |
|
|
Make sure that the operations you want to do on your partition are |
591 |
|
|
supported by parted! |
592 |
|
|
</impo> |
593 |
drobbins |
1.1 |
|
594 |
swift |
1.21 |
<p> |
595 |
|
|
Get tomsrtbt boot/root disk (free of charge) from <uri>http://freshmeat.net/tomsrtbt </uri>, create a floppy as suggested in the Documentation that accompanies the software package and insert a new floppy in the drive for the next step. |
596 |
|
|
</p> |
597 |
drobbins |
1.1 |
|
598 |
swift |
1.21 |
<note> |
599 |
|
|
Note again that Linux is synonym of "There's one more way to do it". Your |
600 |
drobbins |
1.1 |
objective is to run parted on an unmounted partition so it can do its work. You |
601 |
|
|
might use some other boot/root diskset other than tomsrtbt. You might not even |
602 |
|
|
need to do this step at all, that is only umount the filesystem you want to |
603 |
swift |
1.21 |
repartition in your Linux session and run parted on it. |
604 |
|
|
</note> |
605 |
drobbins |
1.1 |
|
606 |
|
|
<pre caption="Utility disk creation"> |
607 |
|
|
# <i>mkfs.minix /dev/fd0</i> |
608 |
|
|
480 inodes |
609 |
|
|
1440 blocks |
610 |
|
|
Firstdatazone=19 (19) |
611 |
|
|
Zonesize=1024 |
612 |
|
|
Maxsize=268966912 |
613 |
|
|
</pre> |
614 |
|
|
|
615 |
swift |
1.21 |
<p> |
616 |
drobbins |
1.1 |
We will now proceed with the build of parted. If it's not already downloaded and untarred, do so now and cd into the corresponding directory. Now run the following set of commands to build the utility and copy it to your floppy disk. |
617 |
swift |
1.21 |
</p> |
618 |
drobbins |
1.1 |
|
619 |
|
|
<pre caption="Building the utility floppy"> |
620 |
|
|
# <i> mkdir /floppy; mount -t minix /dev/fd0 /floppy && |
621 |
|
|
export CFLAGS="-O3 -pipe -fomit-frame-pointer -static" && ./configure |
622 |
|
|
&& make && cp parted/parted /floppy && umount /floppy </i> |
623 |
|
|
</pre> |
624 |
|
|
|
625 |
|
|
<p> |
626 |
|
|
Congratulations, you are ready to reboot and resize your partition. Do this only |
627 |
|
|
after taking a quick look at the parted documentation on the GNU website. The |
628 |
|
|
resize should take under 30 minutes for the largest hard-drives, be patient. |
629 |
|
|
Reboot your system with the tomsrtbt boot disk (just pop it inside), and once |
630 |
|
|
you are logged in, switch the disk in the drive with your utility disk we have |
631 |
|
|
created above and type mount /dev/fd0 /floppy to have parted under /floppy. |
632 |
|
|
There you go. Run parted and you will be able to resize your partition. Once |
633 |
|
|
this lenghty process done, we are ready to have the real fun, by installing |
634 |
gerrynjr |
1.14 |
Gentoo. Reboot back into your old Linux system for now. Drive you wish to |
635 |
swift |
1.8 |
operate on is the drive containing the partition we want to resize. For |
636 |
|
|
example, if we want to resize /dev/hda3, the drive is /dev/hda |
637 |
|
|
</p> |
638 |
drobbins |
1.1 |
|
639 |
|
|
<pre caption="Commands to run once logged into tomsrtbt system"> |
640 |
|
|
# <i>mount /dev/fd0 /floppy </i> |
641 |
|
|
# <i>cd /floppy; ./parted [drive you wish to operate on]</i> |
642 |
|
|
(parted) <i> print </i> |
643 |
|
|
Disk geometry for /dev/hdb: 0.000-9787.148 megabytes |
644 |
|
|
Disk label type: msdos |
645 |
|
|
Minor Start End Type Filesystem Flags |
646 |
|
|
1 0.031 2953.125 primary ntfs |
647 |
|
|
3 2953.125 3133.265 primary linux-swap |
648 |
|
|
2 3133.266 5633.085 primary ext3 |
649 |
|
|
4 5633.086 9787.148 extended |
650 |
|
|
5 5633.117 6633.210 logical |
651 |
|
|
6 6633.242 9787.148 logical ext3 |
652 |
|
|
(parted) <i> help resize </i> |
653 |
|
|
resize MINOR START END resize filesystem on partition MINOR |
654 |
|
|
|
655 |
|
|
MINOR is the partition number used by Linux. On msdos disk labels, the |
656 |
|
|
primary partitions number from 1-4, and logical partitions are 5 |
657 |
|
|
onwards. |
658 |
|
|
START and END are in megabytes |
659 |
|
|
(parted) <i> resize 2 3133.266 4000.000 </i> |
660 |
|
|
</pre> |
661 |
|
|
|
662 |
|
|
<impo> Be patient! The computer is working! Just look at the hardware LED on |
663 |
|
|
your case to see that it is really working. This should take between 2 and 30 |
664 |
|
|
minutes. </impo> |
665 |
|
|
|
666 |
|
|
<p>Once you have resized, boot back into your old linux as described. Then go to |
667 |
swift |
1.22 |
<uri link="/doc/en/handbook/handbook.xml?part=1&chap=5">The Gentoo Handbook: Installing the Gentoo Installation Files</uri> and follow the instructions. When chrooting, use the following command to flush your environment: |
668 |
swift |
1.17 |
</p> |
669 |
drobbins |
1.1 |
|
670 |
swift |
1.17 |
<pre caption = "Flushing the environment during chroot"> |
671 |
|
|
# <i>env -i chroot /mnt/gentoo /bin/bash</i> |
672 |
|
|
</pre> |
673 |
drobbins |
1.1 |
|
674 |
swift |
1.17 |
<p> |
675 |
drobbins |
1.1 |
Enjoy! |
676 |
|
|
</p> |
677 |
|
|
</body> |
678 |
|
|
</section> |
679 |
|
|
</chapter> |
680 |
|
|
</guide> |