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

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

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

Revision 1.25 Revision 1.26
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/altinstall.xml,v 1.25 2004/04/11 13:05:50 swift Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/altinstall.xml,v 1.26 2004/04/21 16:15:21 swift Exp $ -->
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4 4
5 5
6<guide link="/doc/en/altinstall.xml"> 6<guide link="/doc/en/altinstall.xml">
7<title>The Gentoo Linux alternative installation method HOWTO</title> 7<title>The Gentoo Linux alternative installation method HOWTO</title>
22or a computer that can't boot cds. 22or a computer that can't boot cds.
23</abstract> 23</abstract>
24 24
25<license/> 25<license/>
26 26
27<version>0.37</version> 27<version>0.38</version>
28<date>April 11, 2004</date> 28<date>April 21, 2004</date>
29 29
30<chapter> 30<chapter>
31<title>About this document</title> 31<title>About this document</title>
32<section> 32<section>
33<body> 33<body>
139 139
140<p>Burn a LiveCD iso.</p> 140<p>Burn a LiveCD iso.</p>
141 141
142<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<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>
143 143
144<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>
145
146<pre caption="dl-list.sh">
147#!/bin/bash
148
149# set your defaults here:
150user_defs() {
151
152 # portage directory (without a trailing "/"):
153 portage_dir="/usr/portage"
154
155 # default download mirror (without a trailing "/"):
156 gentoo_mirror="http://www.ibiblio.org/pub/Linux/distributions/gentoo"
157
158 # default sourceforge mirror (unc, telia, belnet):
159 sourceforge_mirror="unc"
160
161 # fix gnu mirror entries
162 gnu_url="ftp:\/\/ftp.gnu.org\/pub\/gnu"
163
164}
165
166
167#------------------------------------------------------------
168
169# function to remove temporary files
170cleanup() {
171
172 rm -f $temp_file_1 $temp_file_2
173 exit $1
174
175}
176
177# set user defaults
178user_defs
179
180# set the complete url for the sourceforge mirror
181# (the \'s are needed because this goes in a sed command)
182sourceforge_mirror_complete="http:\/\/$sourceforge_mirror.dl.sourceforge.net\/sourceforge"
183
184# initialize counters
185num_files=0
186num_alt_urls=0
187total_size=0
188
189# initialize lists (arrays)
190declare -a def_urls_arr
191declare -a alt_urls_arr
192
193# create 2 temporary files
194temp_file_1=`mktemp -t dl-list.XXXXXX` || cleanup 1
195temp_file_2=`mktemp -t dl-list.XXXXXX` || cleanup 1
196
197# run "emerge -p &lt;args&gt;" (too easy to forget the "-p" in the command line...)
198emerge -p $@ &gt; $temp_file_1 || cleanup 1
199
200# remove the lines that do not contain the word "ebuild"
201sed -n -e '/ebuild/p' $temp_file_1 &gt; $temp_file_2
202
203# count how many lines were left
204num_ebuilds=`wc -l $temp_file_2 | sed -e 's/\(.*\) \(.*\)/\1/'`
205
206# extract the useful information from those lines: category, package and version
207#sed -e 's:\(.*\) \(.*\)/\(.*\)-\([0-9].*\) \(.*\) \(.*\):\2 \3 \4:' $temp_file_2 &gt; $temp_file_1
208sed -e 's:\(.*\) \(.*\)/\(.*\)-\([0-9].*\):\2 \3 \4:' $temp_file_2 &gt; $temp_file_1
209
210# display starting message :)
211echo -n "Generating list " &gt;&amp;2
212
213# process each package in turn
214while read category package version rest
215do
216
217 # form the name of the digest file
218
219digest_file="$portage_dir/$category/$package/files/digest-$package-$version"
220
221 # process the contents of the digest file
222 while read md5_flag md5_sum file_name file_size
223 do
224
225 # form the default url to download the file
226 def_urls_arr[$num_files]="$gentoo_mirror/distfiles/$file_name"
227
228 # increment the file counter
229 num_files=$(($num_files + 1))
230
231 # update the size accumulator (in kilobytes)
232 total_size=$(($total_size + $file_size / 1024))
233
234 done &lt; $digest_file
235
236 # form the "ebuild depend" command line
237 ebuild_depend_cmd="ebuild $portage_dir/$category/$package/$package-${version}.ebuild depend"
238
239 # execute the "ebuild depend" command
240 $ebuild_depend_cmd || cleanup 1
241
242 # form the name of the dependency file
243 dependency_file="/var/cache/edb/dep/$category/$package-$version"
244
245 # read in the 4th line from the dependency file,
246 # which contains the official download urls
247 alt_urls=`head -n 4 $dependency_file | tail -n 1`
248
249 # ignore empty url list
250 if [ -n "$alt_urls" ]
251 then
252
253 # split the urls list into $1..$N
254 set $alt_urls
255
256 # process each url in turn
257 for i in $@
258 do
259
260 # remove the (use)? strings from the url list
261 alt_url_tmp=`echo "$i" | sed -e '/\?$/d'`
262
263 # remove the "mirror://gnome" urls
264 alt_url_tmp=`echo "$alt_url_tmp" | sed -e '/^mirror:\/\/gnome/d'`
265
266 # remove the "mirror://kde" urls
267 alt_url_tmp=`echo "$alt_url_tmp" | sed -e '/^mirror:\/\/kde/d'`
268
269 # remove the "mirror://gentoo" urls (already included)
270 alt_url_tmp=`echo "$alt_url_tmp" | sed -e '/^mirror:\/\/gentoo/d'`
271
272 # translate the "mirror://sourceforge" urls into valid urls
273 alt_url_tmp=`echo "$alt_url_tmp" | sed -e "s/mirror:\/\/sourceforge/$sourceforge_mirror_complete/"`
274
275 # translate the "mirror://gnu" urls into valid urls
276 alt_url_tmp=`echo "$alt_url_tmp" | sed -e "s/mirror:\/\/gnu/$gnu_url/"`
277 # ignore empty urls
278 if [ -n "$alt_url_tmp" ]
279 then
280
281 # add the url to the list
282 alt_urls_arr[$num_alt_urls]=$alt_url_tmp
283
284 # increment the alternate url counter
285 num_alt_urls=$(($num_alt_urls + 1))
286
287 fi
288
289 done
290
291 fi
292
293 # a progress bar :)
294 echo -n "." &gt;&amp;2
295
296done &lt; $temp_file_1
297
298# display ending message :)
299echo " done." &gt;&amp;2
300
301# display default urls list
302for i in ${def_urls_arr[@]}; do echo $i; done | sort
303
304# display alternate urls list
305for i in ${alt_urls_arr[@]}; do echo $i; done | sort
306
307# display totals
308echo "Totals:" $num_ebuilds "ebuilds," $num_files "files," $num_files "default urls," \n
309$num_alt_urls "alternate urls," "${total_size}Kb." &lt;&amp;2
310
311# remove temporary files and exit
312cleanup 0
313</pre>
314
315<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> 144<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>
316 145
317<p>Open a new console (Alt-F2), we will continue with the Install Doc up to running the bootstrap.sh script.</p> 146<p>Open a new console (Alt-F2), we will continue with the Install Doc up to running the bootstrap.sh script.</p>
318 147
319<warn>Older realeases of the livecd required you to change the password using the <c>passwd</c> command, before logging in manually.</warn> 148<warn>Older realeases of the livecd required you to change the password using the <c>passwd</c> command, before logging in manually.</warn>
320 149
321 150
322<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> 151<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>.</p>
323 152
324<pre caption="Mount the snapshot cd"> 153<pre caption="Mount the snapshot cd">
325# <i>umount /mnt/cdrom</i> 154# <i>umount /mnt/cdrom</i>
326# <i>mkdir /mnt/gentoo/mnt/cdrom2</i> 155# <i>mkdir /mnt/gentoo/mnt/cdrom2</i>
327# <i>mount /dev/cdroms/cdrom0 /mnt/gentoo/mnt/cdrom2</i> 156# <i>mount /dev/cdroms/cdrom0 /mnt/gentoo/mnt/cdrom2</i>
328# <i>cp /mnt/gentoo/mnt/cdrom2/portage-$date.tar.bz2 /mnt/gentoo/usr/portage</i> 157# <i>cp /mnt/gentoo/mnt/cdrom2/portage-$date.tar.bz2 /mnt/gentoo/usr/portage</i>
329# <i>cp /mnt/gentoo/mnt/cdrom2/dl-list.sh /mnt/gentoo/usr/sbin</i>
330# <i>cd /mnt/gentoo/usr/portage</i> 158# <i>cd /mnt/gentoo/usr/portage</i>
331# <i>tar xvjpf portage-$date.tar.bz2</i> 159# <i>tar xvjpf portage-$date.tar.bz2</i>
332# <i>chmod +x /mnt/gentoo/usr/sbin/dl-list.sh</i>
333</pre> 160</pre>
334 161
335<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> 162<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>
336 163
337<p>You need a list of Stage1 packages: glibc, baselayout, texinfo, gettext, zlib, binutils, gcc, ncurses plus their dependencies. </p> 164<p>You need a list of Stage1 packages: glibc, baselayout, texinfo, gettext, zlib, binutils, gcc, ncurses plus their dependencies. </p>
338 165
339<note>Note that you need the versions of each package synced with your portage tree.</note> 166<note>Note that you need the versions of each package synced with your portage tree.</note>
340 167
341 <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>
342
343<pre caption="Using dl-list.sh"> 168<pre caption="Using dl-list.sh">
169<comment>(Don't forget the 2 in front of the &gt;)</comment>
344# <i>dl-list.sh glibc baselayout texinfo gettext zlib binutils gcc ncurses > stage1.list</i> 170# <i>emerge -fp glibc baselayout texinfo gettext zlib binutils gcc ncurses 2&gt; stage1.list</i>
345# <i>mount -t vfat /dev/fd0 /mnt/floppy</i> 171# <i>mount -t vfat /dev/fd0 /mnt/floppy</i>
346# <i>cp /mnt/gentoo/stage1.list /mnt/floppy</i> 172# <i>cp /mnt/gentoo/stage1.list /mnt/floppy</i>
347# <i>umount /mnt/floppy</i> 173# <i>umount /mnt/floppy</i>
348</pre> 174</pre>
349 175
350<p>Take the floppy to the computer that has fast access and feed this list to wget:</p> 176<p>
177Take the floppy to the computer that has fast access. If you take a look at the
178<path>stage1.list</path> file, you'll see that it provides you with several URLs
179to download. Sadly, it lists several possible URLs for each package as well,
180which isn't what you want. Strip all but one of the URLs first:
181</p>
182
183<pre caption="Stripping URLs">
184<comment>(This script is depending on the output format given by emerge which
185 might change in the future without further notice - use with caution!)</comment>
186# <i>cut -f 1 -d ' ' stage1.list > stage1.download</i>
187</pre>
188
189<p>
190Now use <c>wget</c> to fetch all the listed sources:
191</p>
351 192
352<pre caption="Use wget to grab your source packages"> 193<pre caption="Use wget to grab your source packages">
353# <i>wget -N -i stage1.list</i> 194# <i>wget -N -i stage1.list</i>
354</pre> 195</pre>
355 196

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.20