Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Installing portage on other distros, easier than ever
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3 ... 11, 12, 13  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Sat Jan 17, 2004 9:05 pm    Post subject: Installing portage on other distros, easier than ever Reply with quote

OK guys, after I figured that lot of people had problems regarding this, I thought a script is in order and hence a separate thread.

WARNING: I have verified each and every step in this script. I have everything in there from my own experience. Before you attempt to use it, make sure that you have a backup of the system(for weak hearted guys...:)). Have a look at the script and know what it does. Although, its not destructive in the sense that unless and until you emerge glibc straightaway, you are safe. Don't emerge glibc,gcc,binutils,baselayout. Alias emerge to something which asks for confirmation if its not "emerge -p <>". And if e.g. "emerge -p tar" tells you that its going to emerge binutils, make sure to inject binutils first. Make sure you have enough space in /(roughly at least 1GB). Just a friendly warning... :)

Here it goes:
---------------------------------------------------------------
Code:

#!/bin/bash
#
                                                                               
if [ "`id -u`" != "0" ]; then
   echo ""
   echo "Su as root and try again."
   echo ""
   exit 1
fi
                                                                               
pythonV=`python -V 2>&1`
if [ "$pythonV" \< "Python 2.2.0" ];then
   echo ""
   echo "Install python 2.2 and then try again"
   echo ""
   exit 1
fi
                                                                               
   mkdir -p /usr/lib/portage/bin
   mkdir -p /usr/lib/portage/pym
   mkdir -p /usr/portage/profiles
   mkdir -p /etc/env.d
   mkdir -p /etc/portage/profile
   mkdir -p /var/log/portage
   mkdir -p /var/tmp/portage
   mkdir -p /etc/config-archive
   mkdir -p /var/lib/init.d
   mkdir -p /var/lib/portage
     
   cd /tmp
   rm -rf portage-2.*                                                                     
   wget ftp://gentoo.mirrors.pair.com/distfiles/portage-2.0.*
   portar=`/bin/ls portage-2.0.* 2>/dev/null |sort|tail -n 1`
   if [ ! -f "${portar}" ];then
      echo ""
      echo "Mirror error. Try this script again after a while without any args".
      echo ""
      exit 1
   fi
   tar jxf ${portar}
                                                                               
   cd portage-2.*/bin
   cp * /usr/lib/portage/bin
   export PATH=/usr/lib/portage/bin:$PATH
   cd ../pym ; cp * /usr/lib/portage/pym/
   cd ../man ;cp *.1 /usr/share/man/man1 ;cp *.5 /usr/share/man/man5
   cd ../src/python-missingos
   ./setup.py install
   cd ../sandbox-1.1
   make && make install
   cd ../../cnf; cp * /etc
                                                                               
   if [ "`id portage`" == "" ]; then
      /usr/sbin/groupadd -g 250 portage
      /usr/sbin/useradd -d /var/tmp/portage -g portage -u 250 portage
   fi
                                                                               
   cd /usr/sbin
   ln -sf ../lib/portage/bin/regenworld .
   ln -sf ../lib/portage/bin/pkgmerge .
   ln -sf ../lib/portage/bin/fixpackages .
   ln -sf ../lib/portage/bin/etc-update .
   ln -sf ../lib/portage/bin/env-update .
   ln -sf ../lib/portage/bin/emerge-webrsync .
   ln -sf ../lib/portage/bin/ebuild.sh .
   ln -sf ../lib/portage/bin/ebuild .
   ln -sf ../lib/portage/bin/dispatch-conf .
   ln -sf ../lib/portage/bin/archive-conf .
                                                                               
   cd /usr/bin
   ln -sf ../lib/portage/bin/xpak .
   ln -sf ../lib/portage/bin/repoman .
   ln -sf ../lib/portage/bin/quickpkg .
   ln -sf ../lib/portage/bin/portageq .
   ln -sf ../lib/portage/bin/g-cpan.pl .
   ln -sf ../lib/portage/bin/emerge .
                   
export PATH=/usr/lib/portage/bin:$PATH                                                         
echo "CC=gcc;CXX=g++" > /etc/env.d/compilers.sh
myldpath="/lib:/usr/lib"
# before we call portage the first time, we should save our ld.so.conf
for i in $(cat /etc/ld.so.conf);do myldpath=$myldpath:$i;done
echo "LDPATH=\"${myldpath}\"" > /etc/env.d/10ldpath
. /etc/env.d/compilers.sh
emerge sync
#
# emerge sync should get /usr/portage/profiles
#
if [ -d /usr/portage/profiles/default-linux ];then
   rm -f /etc/make.profile
   ln -s /usr/portage/profiles/default-linux/x86/2004.2/gcc34 /etc/make.profile
else
   echo ""
   echo "Something wrong. Get /usr/portage/profiles dir from a working"
   echo "Gentoo system and try again."
   echo ""
   exit 1
fi
                                                                               
# inject the "dangerous" packages first.
glibcP=`emerge -p -O glibc|grep ebuild|cut -d" " -f8`
emerge inject $glibcP
gccP=`emerge -p -O gcc|grep ebuild|cut -d" " -f8`
emerge inject $gccP
binP=`emerge -p -O binutils|grep ebuild|cut -d" " -f8`
emerge inject $binP
                                                                               
# fetch the baselayout.
emerge -f -O baselayout
                                                                               
# now inject it too.
baseP=`emerge -p -O baselayout|grep ebuild|cut -d" " -f8`
emerge inject $baseP

#was inject success
ret=`emerge -p baselayout|grep "ebuild   R"`

if [ "$ret" == "" ] ;then
  echo "Inject has failed. Please verify and continue with cut & paste of rest of the steps"
  echo "ERROR."
  exit 1
fi
                                                                               
# if it fails with some errors, its fine.
emerge -O portage
                                                                               
cd /tmp
fileN=`ls /usr/portage/distfiles/rc-scripts-*|sort|tail -n1`
tar xjpf $fileN
cd rc-scripts*/sbin
cp depscan.sh /sbin; cp functions.sh /sbin
mkdir -p /lib/rcscripts/awk
cd ../src/awk
cp *.awk /lib/rcscripts/awk/
cd /etc/init.d
ln -s /sbin/depscan.sh .
ln -s /sbin/functions.sh .
                                                                               
emerge -O bison gawk

# FOLLOWING SHOULD NOT GIVE ANY ERRORS HERE. You screwed up if it did.
emerge -O portage
                                                                               
if ! fgrep -q "/etc/profile.env" /etc/profile ; then
  echo ". /etc/profile.env" >> /etc/profile
fi
                                                                               
echo ""
echo "#############################################################"
echo "You are now free to enjoy portage. Make sure you tune"
echo "/etc/make.conf and other portage configuration files to take"
echo "advantage of portage. If you screwed up, its OK. Pick yourself"
echo "up and give it another go."
echo "#############################################################"
echo ""

-----------------------------------------------------------------------------

This script is now officially tested by me and others.

Thanks.

PS:
I use the following script to prune out all packages I have marked unsafe for portage on Fedora.
-------------------------------------------------
Code:

#!/bin/bash
emerge sync
emerge -p -uD world > /tmp/world.update
for i in `cat /etc/portage/package.mask.ORG` ;
do
matching=`grep "$i" /tmp/world.update`
if [ -n "$matching" ]; then
toInject=`echo $matching|cut -d " " -f 4`;
echo "Injecting $toInject"
echo "$toInject" >> /etc/portage/profile/package.provided
fi
done
echo "# #"
echo "################# UPDATES #######################"
echo "# #"
cat /tmp/world.update

-------------------------------------------

Currently, my /etc/portage/package.mask.ORG looks like this:
--------------
Code:

sys-apps/baselayout
sys-apps/sysvinit
sys-fs/devfsd
sys-kernel/linux-headers
sys-libs/pwdb
sys-libs/pam
sys-libs/pam-login
sys-apps/kbd
sys-devel/bin86
net-misc/iputils
sys-apps/shadow
net-misc/dhcpcd
sys-apps/modutils
sys-libs/glibc
sys-apps/cronbase
x11-base/opengl-update
net-mail/mailbase
net-nds/portmap
sys-fs/e2fsprogs

-------------------

No specific reason for anything other than baselayout, glibc, gcc, binutils, I usually update these fabfour with up2date once in a while. These four you should never emerge on redhat/fedora. Remember, services are handled by different mechanisms in gentoo and other distros, so anything which has to do with services you can't really emerge because you didn't emerge baselayout and hence don't have rc-update script. you could hack around them though.

perfect for keeping xfree, gnome, multimedia kind of stuff up2date.

Good luck.

EDIT: How can I forget to thanks Crichards for floating this idea here? Thanks crichards!! please refer this thread as well:

https://forums.gentoo.org/viewtopic.php?t=28559

EDIT: mar 10, 05
existing ld.so.conf is killed by portage because it doesn't know about redhat installed stuff. Fixed this in the script.
/EDIT

EDIT: feb 21 '05
update the script for latest portage. I link /etc/make.profile with gcc34 profile, feel free to change to your taste after installing. also, I do emerge gcc,binutils now on my FC2 install, works out better. so apart from some very specific stuff like sysvinit, baselayout, glibc you can pretty emerge whole system. I did a custom nitro2 install sometime back using portage on FC2, works out fine.
/EDIT

EDIT: 03-03-2004

Somebody posted the link for rescue tars in responses, just updating it here at the top:

http://dev.gentoo.org/~carpaski/portage_rescue/

/EDIT

EDIT: Jan 22
found a much easier way to install portage on a non-gentoo system.

get the rescue tarball for your arch from here:

ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/gentoo-x86-portage/sys-apps/portage/files/

read the README.RESCUE. Untar, emerge sync and emerge portage should get you on your way!!

/EDIT


Last edited by devsk on Sun Sep 18, 2005 1:10 am; edited 24 times in total
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Sun Jan 18, 2004 7:42 pm    Post subject: Reply with quote

Wow! Not a single response. This is a great news for gentoo! A lot has changed since jan last year. I thought lot of people didn't want to re-install linux and just wanted portage to work on their distro so they could have the best of both worlds. But I think most people have already jumped ship to gentoo(or they don't understand the beauty the portage is). And after having used the former favourite distro for a while alongwith Gentoo, I know why I shouldn't ask "why"? :)
Back to top
View user's profile Send private message
Khan
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2003
Posts: 96

PostPosted: Mon Jan 19, 2004 10:09 pm    Post subject: Reply with quote

devsk wrote:
Wow! Not a single response. This is a great news for gentoo! A lot has changed since jan last year. I thought lot of people didn't want to re-install linux and just wanted portage to work on their distro so they could have the best of both worlds. But I think most people have already jumped ship to gentoo(or they don't understand the beauty the portage is). And after having used the former favourite distro for a while alongwith Gentoo, I know why I shouldn't ask "why"? :)


I totally jumped ship from Mandrake to Gentoo. It was time to learn all I could about Linux in general and what it really takes to run this OS. While I have certainly hit a number of bumps (most notably ALSA with nForce2), these forums (especially the Documentation, Tips & Tricks one) really made a HUGE diffference in helping me overcome those areas that I wasn't sure about. Also, the installation docs are by far some of the best I have ever seen. I've pointed several of my Windows co-workers at them and even they agree that anyone can install Gentoo. Kudos to everyone here and I'm looking forward to installing the 2.6.x kernel....once Gentoo updates their documentation :twisted:
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Tue Jan 20, 2004 1:00 am    Post subject: Reply with quote

you might wanna look here...

https://forums.gentoo.org/viewtopic.php?t=70838

upgrading to 2.6 is easier than it looks...I would recommend gentoo-dev-sources (instead of development-sources) mainly for acpi and bootsplash, if you are not into "patching the kernel yourself" kind of mode...
Back to top
View user's profile Send private message
pcassidy
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jul 2003
Posts: 116
Location: Dublin, Ireland

PostPosted: Fri Jan 23, 2004 2:38 pm    Post subject: Reply with quote

I'm trying to get portage up and running on a redhat 7.3 box in work(while my boss isn't looking)

I don't have access to a working gentoo machine.

Can anyone supply me with the contents of /usr/portage/profiles? I've looked around and
tried downloading some packages, but I can't find it anywhere?

Thanks,

Paul
Back to top
View user's profile Send private message
pcassidy
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jul 2003
Posts: 116
Location: Dublin, Ireland

PostPosted: Fri Jan 23, 2004 3:59 pm    Post subject: Reply with quote

Got it working,

my version of python wasn't installed properly. a quick re-install and emerge sync works
perfectly!!!

Thanks for the script!!
Back to top
View user's profile Send private message
Mister Bill
n00b
n00b


Joined: 24 Jan 2004
Posts: 35
Location: Huntsville, Alabama

PostPosted: Mon Jan 26, 2004 2:58 am    Post subject: Reply with quote

rock on.

Tomorrow I'm going to install Mandrake and tell you how the script turns out.
_________________
~WÆ
Back to top
View user's profile Send private message
ixion
l33t
l33t


Joined: 16 Dec 2002
Posts: 708

PostPosted: Sat Jan 31, 2004 2:32 pm    Post subject: Reply with quote

devsk, you're a genius! I'm slowly but surely getting this going on a RedHat9 server... it's been slow-going, but I've got hopes that it will pull through... I would've just gone with Gentoo on the server if it was my decision, but it isn't so I'm trying to make admin'ing it as painless as possible.. :)

I have run into a couple problems, however.

First, ncurses bombs during 'emerge portage':
Code:

cd ../obj_s;  g++ -I../c++ -I../include -I. -DHAVE_CONFIG_H  -DNDEBUG -D_GNU_SOURCE -I. -I../include -O2 -mcpu=i686 -pipe -fPIC -c ../c++/cursesf.cc
/bin/sh: line 1: g++: command not found
make[1]: *** [../obj_s/cursesf.o] Error 127
make[1]: Leaving directory `/var/tmp/portage/ncurses-5.3-r5/work/ncurses-5.3/c++'
make: *** [all] Error 2

!!! ERROR: sys-libs/ncurses-5.3-r5 failed.
!!! Function src_compile, Line 58, Exitcode 2
!!! make failed


I've tried copying over 'g++' from my gentoo laptop (which runs a different version of gcc (3.2.3-r3) and that didn't work. I even symlinked g++ to gcc (version 3.3.2) on the RH system, but that didn't work either. I installed GCC on the Red Hat system via rpm.. How should I properly get 'g++' working? Not being a good programmer, I don't know what to do..:-/
_________________
only the paranoid survive
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Sat Jan 31, 2004 4:43 pm    Post subject: Reply with quote

you would need package "gcc-c++". if you are gcc 3.3.2, then

http://mirrors.kernel.org/fedora/core/1/i386/os/Fedora/RPMS/gcc-c++-3.3.2-1.i386.rpm

would need to be downloaded and installed.

your redhat CD will have the compatible "gcc-c++" RPM if you are not updated to the latest...
Back to top
View user's profile Send private message
russryder
Tux's lil' helper
Tux's lil' helper


Joined: 28 Aug 2002
Posts: 133

PostPosted: Sun Feb 01, 2004 8:04 pm    Post subject: Reply with quote

I'm about to put a fresh install of fedora on my machine. Gentoo just won't play well with my mn31n nforce2 mobo, and my co-worker has fedora running well on his, so I'll going to try to get the portage working on it. I'll post my results when I'm finished.
_________________
System Specs
Athlon XP 2500+
1.5g ram
GeForce FX 5700 Ultra
Soundblaster Live
200gb hdd
gentoo-dev-sources 2.6.9 r4
screenshot http://russbox.sytes.net/screenshot.png
Back to top
View user's profile Send private message
jago25_98
Apprentice
Apprentice


Joined: 23 Aug 2002
Posts: 180

PostPosted: Thu Feb 12, 2004 4:49 pm    Post subject: ftp's down Reply with quote

can't connect to [url]ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/gentoo-x86-portage/sys-apps/portage/files/ [/url] anymore.

Got an alternative?
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Thu Feb 12, 2004 5:04 pm    Post subject: Reply with quote

plenty of them:

http://www.gentoo.org/main/en/mirrors.xml
Back to top
View user's profile Send private message
jago25_98
Apprentice
Apprentice


Joined: 23 Aug 2002
Posts: 180

PostPosted: Fri Feb 13, 2004 2:28 pm    Post subject: gentoo-x86-portage/sys-apps/portage/files/ Reply with quote

ah, but uk one doesn't have

[url]gentoo-x86-portage/sys-apps/portage/files/[/url]
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Fri Feb 13, 2004 11:38 pm    Post subject: Reply with quote

I think you are left with the script. they have removed the x86 rescue tar(very naughty of them)...at least I couldn't find it...you can still give the script a run!!
Back to top
View user's profile Send private message
axxackall
l33t
l33t


Joined: 06 Nov 2002
Posts: 651
Location: Toronto, Ontario, 3rd Rock From Sun

PostPosted: Fri Feb 13, 2004 11:53 pm    Post subject: Reply with quote

Does anyone know what's happened to portage in cygwin? Is the project still alive?
_________________
"Lisp is a programmable programming language." - John Foderaro, CACM, September 1991
Back to top
View user's profile Send private message
mt2
n00b
n00b


Joined: 20 Sep 2003
Posts: 20

PostPosted: Wed Feb 18, 2004 3:15 am    Post subject: Reply with quote

I was wondering if anyone was able to get this to work. I can't find the portage-rescuse anywhere...

Thanks!
Back to top
View user's profile Send private message
Mister Bill
n00b
n00b


Joined: 24 Jan 2004
Posts: 35
Location: Huntsville, Alabama

PostPosted: Wed Feb 18, 2004 10:21 pm    Post subject: Reply with quote

So, are there any packages that would be considered "unsafe" on Slackware (other than the fab-four, of course).
_________________
~WÆ
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Thu Feb 19, 2004 4:19 am    Post subject: Reply with quote

not used slackware, so no idea. In general, anything that changes stuff with boot and login should be emerged with great care.
Back to top
View user's profile Send private message
merkaba
n00b
n00b


Joined: 10 Jul 2003
Posts: 56

PostPosted: Thu Feb 26, 2004 8:04 pm    Post subject: Reply with quote

i've tried this on a redhat 8.0 install.
it seems to work for the most part.
i didn't run the script directly, just typed out each command in the script one by one to make sure everything worked. a couple of points to note:
- the newest portage is portage-2.0.50-r1.tar.bz2
- useradd fails with the -G option because the group is already created in the previous step. using -g instead works.
- `emerge -p glibc|grep ebuild|cut -d" " -f8` includes all of the dependencies of glibc including gcc and binutils so there's no need to inject them seperately.
- a couple extra symlinks are needed to get rid of some errors during emerges:
cd /etc/init.d
ln -s /sbin/depscan.sh .
ln -s /sbin/functions.sh .
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Fri Feb 27, 2004 12:42 am    Post subject: Reply with quote

thanks for the comments. I have updated the script with those.
Back to top
View user's profile Send private message
raid517
l33t
l33t


Joined: 06 Mar 2003
Posts: 946

PostPosted: Wed Mar 03, 2004 10:45 am    Post subject: Reply with quote

Hi I love portage and I have been trying to get this script to work on a Slackware 9.1 install (mainly because I simply don't have the time to invest 72 hours+ to get Gentoo up and running - I've done it about 8 times already and I think that's enough to show how capable I am). However Slackware just does not have the same range of sofware that Gentoo has.

The main problem when I run this script is that - well to be honest it doesn't work: Here is the way I have laid it out and also the output I got after running it. (I had to move most of it over to the left to line up with the command prompt - as the html formatting above seems to have knocked it out of line - or to put it another way it just wouldn't run at all like that.

Here is what I did and the ouput I got:

Code:
#!/bin/bash
#
# call with one argument "again" or call it with no arguments at all
# call it with no arguments first time.
# call it again with "again" to bypass some operations.
#
                                                                                
if [ "$#" == "1" ];then
again=$1
else
again=""
fi
                                                                                
if [ "`id -u`" != "0" ]; then
echo ""
echo "Su as root and try again."
echo ""
fi
                                                                                
pythonV=`python -V 2>&1`
if [ "$pythonV" \< "Python 2.2.0" ];then
echo ""
echo "Install python 2.2 and then try again"
echo ""
exit 1
fi
                                                                                
if [ "$again" == "" ];then
mkdir -p /usr/lib/portage/bin
mkdir -p /usr/portage/profiles
mkdir /etc/env.d
                                                                                
wget ftp://gentoo.mirrors.pair.com/distfiles/portage-2.0.50-r1.tar.bz2 -O /tmp/portage-2.0.50-r1.tar.bz2
cd /tmp
if [ ! -f portage-2.0.50-r1.tar.bz2 ];then
echo ""
echo "Mirror error. Try this script again after a while without any args".
echo ""
exit 1
fi
tar jxf portage-2.0.50-r1.tar.bz2
                                                                                
cd portage-2.0.50-r1/bin
cp * /usr/lib/portage/bin
export PATH=/usr/lib/portage/bin:$PATH
cd ../pym ; cp * /usr/lib/python2.2/site-packages
cd ../man ;cp *.1 /usr/man/man1 ;cp *.5 /usr/man/man5
cd ../src/python-missingos
./setup.py install
cd ../sandbox-1.1
make && make install
cd ../../cnf; cp * /etc
                                                                                
if [ "`id portage`" == "" ]; then
groupadd -g 250 portage
useradd -d /var/tmp/portage -g portage -u 250 portage
fi
                                                                                
cd /usr/sbin
ln -s ../lib/portage/bin/regenworld .
ln -s ../lib/portage/bin/pkgmerge .
ln -s ../lib/portage/bin/fixpackages .
ln -s ../lib/portage/bin/etc-update .
ln -s ../lib/portage/bin/env-update .
ln -s ../lib/portage/bin/emerge-webrsync .
ln -s ../lib/portage/bin/ebuild.sh .
ln -s ../lib/portage/bin/ebuild .
ln -s ../lib/portage/bin/dispatch-conf .
ln -s ../lib/portage/bin/archive-conf .
                                                                                
cd /usr/bin
ln -s ../lib/portage/bin/xpak .
ln -s ../lib/portage/bin/repoman .
ln -s ../lib/portage/bin/quickpkg .
ln -s ../lib/portage/bin/portageq .
ln -s ../lib/portage/bin/g-cpan.pl .
    
ln -s ../lib/portage/bin/emerge .
fi

export PATH=/usr/lib/portage/bin:$PATH                                                         
echo "CC=gcc;CXX=g++" > /etc/env.d/compilers.sh
echo "LDPATH=\"/lib:/usr/lib:/usr/local/lib:/usr/X11R6/lib:/usr/kerberos/lib\"" > /etc/env.d/10ldpath
. /etc/env.d/compilers.sh
emerge sync
#
# emerge sync should get /usr/portage/profiles
#
if [ -d /usr/portage/profiles/default-x86-1.4 ];then
ln -s /usr/portage/profiles/default-x86-1.4 /etc/make.profile
else
echo ""
echo "Something wrong. Get /usr/portage/profiles dir from a working"
echo "Gentoo system and try again."
echo ""
exit 1
fi
                                                                                
# inject the "dangerous" packages first.
glibcP=`emerge -p -O glibc|grep ebuild|cut -d" " -f8`
emerge inject $glibcP
gccP=`emerge -p -O gcc|grep ebuild|cut -d" " -f8`
emerge inject $gccP
binP=`emerge -p -O binutils|grep ebuild|cut -d" " -f8`
emerge inject $binP
                                                                                
# fetch the baselayout.
emerge -f -O baselayout
                                                                                
# now inject it too.
baseP=`emerge -p -O baselayout|grep ebuild|cut -d" " -f8`
emerge inject $baseP
 
#was inject success
ret=`emerge -p baselayout|grep "ebuild   R"`
 
if [ "$ret" == "" ] ;then
echo "Inject has failed. Please verify and continue with cut & paste of rest of the steps"
echo "ERROR."
exit 1
fi
                                                                                
# if it fails with some errors, its fine.
emerge portage
                                                                                
cd /tmp
cp /usr/portage/distfiles/rc-scripts*.tar.bz2 .
tar xjpf rc-scripts*.tar.bz2
cd rc-scripts*/sbin
cp depscan.sh /sbin; cp functions.sh /sbin
mkdir -p /lib/rcscripts/awk
cd ../src/awk
cp *.awk /lib/rcscripts/awk/
cd /etc/init.d
ln -s /sbin/depscan.sh .
ln -s /sbin/functions.sh .
                                                                                
emerge gawk
 
# FOLLOWING SHOULD NOT GIVE ANY ERRORS HERE. You screwed up if it did.
emerge portage
                                                                                
if ! fgrep -q "/etc/profile.env" /etc/profile ; then
echo ". /etc/profile.env" >> /etc/profile
fi
                                                                                
echo ""
echo "#############################################################"
echo "You are now free to enjoy portage. Make sure you tune"
echo "/etc/make.conf and other portage configuration files to take"
echo "advantage of portage. If you screwed up, its OK. Pick yourself"
echo "up and give it another go."
echo "#############################################################"
echo ""


Code:
bash-2.05b# ./Portage.sh
./Portage.sh: line 7:  : command not found
./Portage.sh: line 13:  : command not found
./Portage.sh: line 19:  : command not found
./Portage.sh: line 27:  : command not found
mkdir: cannot create directory `/etc/env.d': File exists
./Portage.sh: line 32:  : command not found
--10:26:13--  ftp://gentoo.mirrors.pair.com/distfiles/portage-2.0.50-r1.tar.bz2
           => `/tmp/portage-2.0.50-r1.tar.bz2'
Resolving gentoo.mirrors.pair.com... done.
Connecting to gentoo.mirrors.pair.com[216.92.2.140]:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /distfiles ... done.
==> PORT ... done.    ==> RETR portage-2.0.50-r1.tar.bz2 ... done.
Length: 222,535 (unauthoritative)

100%[====================================>] 222,535       43.85K/s    ETA 00:00

10:26:19 (43.85 KB/s) - `/tmp/portage-2.0.50-r1.tar.bz2' saved [222535]

./Portage.sh: line 42:  : command not found
cp: omitting directory `functions'
cp: copying multiple files, but last argument `/usr/lib/python2.2/site-packages' is not a directory
Try `cp --help' for more information.
/usr/bin/env: python2.2: No such file or directory
make: Nothing to be done for `all'.
install -d -m 0755 /lib
install -d -m 0755 /usr/lib/portage/bin
install -d -m 0755 /usr/lib/portage/lib
install -m 0755 libsandbox.so /lib
install -m 0755 sandbox /usr/lib/portage/bin
install -m 0644 sandbox.bashrc /usr/lib/portage/lib
./Portage.sh: line 53:  : command not found
./Portage.sh: line 58:  : command not found
ln: `./regenworld': File exists
ln: `./pkgmerge': File exists
ln: `./fixpackages': File exists
ln: `./etc-update': File exists
ln: `./env-update': File exists
ln: `./emerge-webrsync': File exists
ln: `./ebuild.sh': File exists
ln: `./ebuild': File exists
ln: `./dispatch-conf': File exists
ln: `./archive-conf': File exists
./Portage.sh: line 70:  : command not found
ln: `./xpak': File exists
ln: `./repoman': File exists
ln: `./quickpkg': File exists
ln: `./portageq': File exists
ln: `./g-cpan.pl': File exists
./Portage.sh: line 77:  : command not found
ln: `./emerge': File exists
./Portage.sh: line 80:  : command not found
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
./Portage.sh: line 81: export: ` ': not a valid identifier
Traceback (most recent call last):
  File "/usr/lib/portage/bin/emerge", line 10, in ?
    import emergehelp,xpak,string,re,commands,time,shutil,traceback,atexit,signal,socket,types
  File "/usr/lib/portage/bin/emergehelp.py", line 7, in ?
    from output import *
ImportError: No module named output

Something wrong. Get /usr/portage/profiles dir from a working
Gentoo system and try again.

bash-2.05b#


I checked and /usr/portage/profiles is there - but what would be the point of getting one from a working portage install just to copy it? I mean if I did that I would need to install Gentoo - and if I did this, why wouldn't I just keep it?

Any help anyone can offer would be very much appreciated, I was really hoping that someone would come up with a working script to do this some day.

GJ
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Wed Mar 03, 2004 4:42 pm    Post subject: Reply with quote

all "if" statements have failed with "command not found"....shell 'export' fails...that's old 'sh' behaviour, not bash behaviour. Try save the script as Portage (w/o .sh) and then run it, make sure /bin/bash is not pointing to /bin/sh (older sh) and BASH_ENV is set to some sane script.

that copy to python2.2/site-packages is not required for portage 2.0.50, I will remove it from the script. simply cut and paste the script again. it works without any editing/identation/editing required.
Back to top
View user's profile Send private message
raid517
l33t
l33t


Joined: 06 Mar 2003
Posts: 946

PostPosted: Wed Mar 03, 2004 5:20 pm    Post subject: Reply with quote

Thanks for fixing your script. :) I'll give it another go.

GJ
Back to top
View user's profile Send private message
merkaba
n00b
n00b


Joined: 10 Jul 2003
Posts: 56

PostPosted: Wed Mar 03, 2004 9:02 pm    Post subject: Reply with quote

portage rescue files are still available here:
http://dev.gentoo.org/~carpaski/portage_rescue/

the link is in the README.RESCUE
Back to top
View user's profile Send private message
raid517
l33t
l33t


Joined: 06 Mar 2003
Posts: 946

PostPosted: Wed Mar 03, 2004 9:06 pm    Post subject: Reply with quote

Erm how do you use it? I got it but I'm still getting the same errors got after running the script.

GJ
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
Goto page 1, 2, 3 ... 11, 12, 13  Next
Page 1 of 13

 
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