Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Small guide: Gentoo Stage 1 install without network access
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
OYR66
n00b
n00b


Joined: 05 Feb 2003
Posts: 13

PostPosted: Fri Feb 07, 2003 5:29 pm    Post subject: Small guide: Gentoo Stage 1 install without network access Reply with quote

It's snowing in NYC and NO traffic! One of those rare moments...

Back to business - I thought it could be useful to post my experience with Gentoo installation without network access.

I did installation on a computer with two CD drives and Win2k.

Steps

1) Burn a live CD iso.

2) Get the latest portage snapshot. In my case I have a choice of either to put portage tarball on Win2k partition or burned it on a second CD. My choice was CD.

3) Follow all instructions of Gentoo Install Doc up to "chroot /mnt/gentoo"

4) Run "passwd" and get a new password for root. Open a new virtual console (Alt-F2) and login as root with your new password. You need a new password because you don't know it!

5) On that new console (I call it F2) continue with Install Doc up to running bootstrap.sh script.

4) Go back to the first console (Alt-F1, without chroot) and mount a second CD on /mnt/gentoo/mnt/cdrom2

5) copy portage tarball from cdrom2 and unpack it to /mnt/gentoo/usr/portage

6) Switch back to 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).

You need a list of Stage1 packages:

glibc, baselayout, texinfo, gettext, zlib, binutils, gcc, ncurses plus their dependencies.

Note that you need the versions of each package synced with your portage tree. Here is a bash script I found on this forum that will generate the list of URLs for each file. I changed this script to fix "mirror://gnu" type URLs.


Code:

#!/bin/bash

# set your defaults here:
user_defs() {
 
  # portage directory (without a trailing "/"):
  portage_dir="/usr/portage"
 
  # default download mirror (without a trailing "/"):
  gentoo_mirror="http://www.ibiblio.org/pub/Linux/distributions/gentoo"
 
  # default sourceforge mirror (unc, telia, belnet):
  sourceforge_mirror="unc"
 
  # fix gnu mirror entries
  gnu_url="ftp:\/\/ftp.gnu.org\/pub\/gnu"
 
}


#------------------------------------------------------------

# function to remove temporary files
cleanup() {
 
  rm -f $temp_file_1 $temp_file_2
  exit $1
 
}

# set user defaults
user_defs

# set the complete url for the sourceforge mirror
# (the \'s are needed because this goes in a sed command)
sourceforge_mirror_complete="http:\/\/$sourceforge_mirror.dl.sourceforge.net\/sourceforge"

# initialize counters
num_files=0
num_alt_urls=0
total_size=0

# initialize lists (arrays)
declare -a def_urls_arr
declare -a alt_urls_arr

# create 2 temporary files
temp_file_1=`mktemp -t dl-list.XXXXXX` || cleanup 1
temp_file_2=`mktemp -t dl-list.XXXXXX` || cleanup 1

# run "emerge -p <args>" (too easy to forget the "-p" in the command line...)
emerge -p $@ > $temp_file_1 || cleanup 1

# remove the lines that do not contain the word "ebuild"
sed -n -e '/ebuild/p' $temp_file_1 > $temp_file_2

# count how many lines were left
num_ebuilds=`wc -l $temp_file_2 | sed -e 's/\(.*\) \(.*\)/\1/'`

# extract the useful information from those lines: category, package and version
#sed -e 's:\(.*\) \(.*\)/\(.*\)-\([0-9].*\) \(.*\) \(.*\):\2 \3 \4:' $temp_file_2 > $temp_file_1
sed -e 's:\(.*\) \(.*\)/\(.*\)-\([0-9].*\):\2 \3 \4:' $temp_file_2 > $temp_file_1
 
# display starting message :)
echo -n "Generating list " >&2

# process each package in turn
while read category package version rest
do
 
  # form the name of the digest file

digest_file="$portage_dir/$category/$package/files/digest-$package-$version"
 
  # process the contents of the digest file
  while read md5_flag md5_sum file_name file_size
  do
   
    # form the default url to download the file
    def_urls_arr[$num_files]="$gentoo_mirror/distfiles/$file_name"
   
    # increment the file counter
    num_files=$(($num_files + 1))
   
    # update the size accumulator (in kilobytes)
    total_size=$(($total_size + $file_size / 1024))
   
  done < $digest_file
 
  # form the "ebuild depend" command line
  ebuild_depend_cmd="ebuild $portage_dir/$category/$package/$package-${version}.ebuild depend"
 
  # execute the "ebuild depend" command
  $ebuild_depend_cmd || cleanup 1
 
  # form the name of the dependency file
  dependency_file="/var/cache/edb/dep/$category/$package-$version"
 
  # read in the 4th line from the dependency file,
  # which contains the official download urls
  alt_urls=`head -n 4 $dependency_file | tail -n 1`
 
  # ignore empty url list
  if [ -n "$alt_urls" ]
  then
   
    # split the urls list into $1..$N
    set $alt_urls
   
    # process each url in turn
    for i in $@
    do
     
      # remove the <use>? strings from the url list
      alt_url_tmp=`echo "$i" | sed -e '/\?$/d'`
     
      # remove the "mirror://gnome" urls
      alt_url_tmp=`echo "$alt_url_tmp" | sed -e '/^mirror:\/\/gnome/d'`
     
      # remove the "mirror://kde" urls
      alt_url_tmp=`echo "$alt_url_tmp" | sed -e '/^mirror:\/\/kde/d'`
     
      # remove the "mirror://gentoo" urls (already included)
      alt_url_tmp=`echo "$alt_url_tmp" | sed -e '/^mirror:\/\/gentoo/d'`
     
      # translate the "mirror://sourceforge" urls into valid urls
      alt_url_tmp=`echo "$alt_url_tmp" | sed -e "s/mirror:\/\/sourceforge/$sourceforge_mirror_complete/"`

      # translate the "mirror://gnu" urls into valid urls
      alt_url_tmp=`echo "$alt_url_tmp" | sed -e "s/mirror:\/\/gnu/$gnu_url/"`
      # ignore empty urls
      if [ -n "$alt_url_tmp" ]
      then
       
        # add the url to the list
        alt_urls_arr[$num_alt_urls]=$alt_url_tmp
       
        # increment the alternate url counter
        num_alt_urls=$(($num_alt_urls + 1))
       
      fi
     
    done
   
  fi
 
  # a progress bar :)
  echo -n "." >&2
 
done < $temp_file_1

# display ending message :)
echo " done." >&2

# display default urls list
for i in ${def_urls_arr[@]}; do echo $i; done | sort

# display alternate urls list
for i in ${alt_urls_arr[@]}; do echo $i; done | sort

# display totals
echo "Totals:" $num_ebuilds "ebuilds," $num_files "files," $num_files "default urls," $num_alt_urls "alternate urls," "${total_size}Kb." >&2

# remove temporary files and exit
cleanup 0



I forgot to add that you should have this script on the second CDROM or you will end up typing the whole thing.

Instructions (as per script's author)

Quote:


1. Save the script as e.g. /usr/sbin/dl-list

2. Make it executable:

Code:

# chmod +x /usr/sbin/dl-list




Now you run the following:

Code:
 

# dl-list glibc baselayout texinfo gettext zlib binutils gcc ncurses > stage1.list



You can try to run:
Code:

# dl-list system > stage2.list

# dl-list world > stage3.list


to get lists for stage2 and stage3 but I'm not sure if you'll get a correct list before completing stage1.

Copy this list on the floppy (F1 console)

Code:

# mount -t vfat /dev/fd0 /mnt/floppy
# cp /mnt/gentoo/[i]path to the list[/i] /mnt/floppy
# umount /mnt/floppy


Take the floppy to the machine that has fast access and feed this list to wget:

Code:

# wget -N -i stage1.list


you can get Windows version of wget here http://space.tin.it/computer/hherold/

Get the files, burn them on a CD, bring it to Gentoo machine, mount that CD from F1 console, switch to F2 console and copy all files to /usr/portage/distfiles.

Now, you can run bootstrap.sh

Hope it helps
_____________________________________________________
My big personal gripe about Gentoo installation:

No vi or any decent vi clone all the way to Stage3!

Not to start any wars here but nano as a editor sucks big way.


Last edited by OYR66 on Fri Feb 07, 2003 9:24 pm; edited 1 time in total
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Fri Feb 07, 2003 8:26 pm    Post subject: Reply with quote

This is detailed enough to be in Documentation, Tips and Tricks.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
darktux
Veteran
Veteran


Joined: 16 Nov 2002
Posts: 1086
Location: Coimbra, Portugal

PostPosted: Fri Feb 07, 2003 8:38 pm    Post subject: Re: Small guide: Gentoo Stage 1 install without network acce Reply with quote

OYR66 wrote:

4) Run "passw" and get a new password for root. Open a new virtual console (Alt-F2) and login as root with your new password. You need a new password because you don't know it!


The command is passwd, not passw. Other then that, it seems like a good job to be :wink:
_________________
Lego my ego, and I'll lego your knowledge

www.tuxslare.org - My reborn website :P
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum