only two bugs first sandbox is disabled which is ok I guesss
the second you need to delete /etc/make.profile
and do ln -sf /usr/portage/profiles/default-linux/x86/2006.0 /etc/make.profile
that fixs it so it compiles and installs stuff on KANOTIX, not sure what sandbox is for thou
I found this post from another site, it may help to getting portage on debian type systems like Kanotix , I would post in the Kanotix forum but its not english anoff for me to read whatever the forum commands are in
link
http://forums.gentoo.org/viewtopic.php?t=125553
this link does to his posts , I hope too see this in a new kanotix version of the cd someday that would be nice, and yes the script seems to work on kanotix 2006 RC3 version
devsk
l33t
l33t
Joined: 23 Oct 2003
Posts: 704
PostPosted: Sat Jan 17, 2004 4: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:
http://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...portage/files/
read the README.RESCUE. Untar, emerge sync and emerge portage should get you on your way!!
/EDIT
Last edited by devsk on Sat Sep 17, 2005 8:10 pm; edited 24 times in total