Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Nov 10, 2008 8:42 pm 
Offline
Junior Member

Joined: Fri Oct 22, 2004 6:40 am
Posts: 20
Hi,

After many hours of testing I've finally come up with a script to upgrade a Gentoo 2007.0 server available via Linode.

Deploy a standard Gentoo 2007.0 image from the Linode Distribution Wizard then SSH in as root and create a script with the following content:

Code:
#!/bin/bash
#
# update portage tree
#
emerge --sync

#
# Fix the Bash/Portage blocker
#
emerge -1 =app-shells/bash-3.2_p17-r1
emerge portage lzma-utils
emerge bash

#
# Fix the mktemp/coreutils/util-linux blocker
#
emerge -C mktemp util-linux
emerge coreutils util-linux
hash -r

#
# Fix the ss/com_err/e2fsprogs/e2fsprogs-libs blocker
#
emerge -f e2fsprogs e2fsprogs-libs
emerge -C ss com_err e2fsprogs
emerge e2fsprogs

#
# Merge in all /etc updates
#
echo "-5" | etc-update

#
# Now go get a kernel source tarball
#
wget --quiet -O /dev/stdout http://www.linode.com/src/$(uname -r).tar.bz2 | tar xjvp -C /usr/src
cd /usr/src
ln -s $(ls) linux
cd linux
zcat /proc/config.gz > .config
make oldconfig && make && make modules_install && depmod

#
# Updating CFLAGS
# See: http://www.linode.com/forums/viewtopic.php?t=3267
#
sed -i s/-pipe/-mno-tls-direct-seg-refs/ /etc/make.conf

#
# Remove cracklib as it doesn't upgrade nicely
#
emerge -C cracklib

#
# Now rebuild your whole system :-)
#
for type in system world ; do
  emerge -e ${type}
  while [ $? -gt 0 ]; do
    emerge --resume -e ${type}
  done
done


Now chmod +x that script and then run it:

Code:
# chmod +x myscript
# ./myscript


You will soon have the latest and greatest version of Gentoo... well, in a few hours anyway :wink:

Each time I have ran this script it has worked for me. No doubt there will be other package blockers in the future that this script doesn't cover so you'll have to figure that out on your own :lol:

Oh one thing to note is that it may error if the kernel source tarball from http://www.linode.com/src doesn't end in tar.bz2. I noticed tonight that some of the newer ones seem to be ending in tar.gz

I hope this helps someone as I think Linode is a great match with Gentoo Perhaps it can be used to help create a Gentoo 2008.0 install image??

Cheers,

Rich


Top
   
 Post subject:
PostPosted: Mon Dec 07, 2009 8:55 am 
Offline
Senior Member

Joined: Mon Dec 07, 2009 6:46 am
Posts: 331
I preferred using Finix recovery, mounting the partitions and doing a straight stage3 install from latest tarballs. As soon as you unpack the tarballs and configure some basic things (network, ssh), you can reboot into stage3 and proceed (re)building world from there.

IMHO better than trying to deal with blocks and profile changes when upgrading from an older installation.


Top
   
 Post subject:
PostPosted: Mon Dec 07, 2009 9:05 am 
Offline
Junior Member

Joined: Fri Oct 22, 2004 6:40 am
Posts: 20
I think that this thread will not be that relevant any more now that Gentoo 2008.0 is available to deploy.

Rich.


Top
   
 Post subject:
PostPosted: Mon Dec 07, 2009 9:11 am 
Offline
Senior Member

Joined: Mon Dec 07, 2009 6:46 am
Posts: 331
Gentoo 2008.0 is old by now. Plenty of changes in between, not to mention no ext4 support.


Top
   
 Post subject:
PostPosted: Mon Dec 07, 2009 9:31 am 
Offline
Junior Member

Joined: Fri Oct 22, 2004 6:40 am
Posts: 20
Azathoth wrote:
Gentoo 2008.0 is old by now. Plenty of changes in between, not to mention no ext4 support.


It may be old, but I don't believe it will suffer with the "ss com_err e2fsprogs" problems of the past that this thread helps resolve.

Rich.


Top
   
 Post subject:
PostPosted: Mon Dec 07, 2009 9:50 am 
Offline
Senior Member

Joined: Mon Dec 07, 2009 6:46 am
Posts: 331
Gentoo 2008.0 does suffer from e2fsprogs block, iirc, and you do solve that in your script.

All I'm saying is that I prefer booting finix, downloading the two tarballs, unpacking them, and I'm ready to boot into latest gentoo installation. IMHO that's better and faster approach than having to babysit the rebuild in case there are upgrade failures. :wink:


Top
   
 Post subject:
PostPosted: Mon Dec 07, 2009 9:55 am 
Offline
Junior Member

Joined: Fri Oct 22, 2004 6:40 am
Posts: 20
ah, I see.. fair point well made :)

I've never looked into what I need to do to get a kernel on a linode when doing things the manual way, so always gone for the "upgrade from within" method.

Rich


Top
   
 Post subject:
PostPosted: Mon Dec 07, 2009 10:23 am 
Offline
Senior Member

Joined: Mon Dec 07, 2009 6:46 am
Posts: 331
Also please note that there are no more major releases. There will be no 2009.x or 2010.x. The official recommended installation procedure now is to use weekly stage3 tarballs, stage3 live CDs (minimal install included) if applicable, and latest portage tarballs.

One more thing, there are at least two upgrades to glibc and at least one upgrade to gcc, if not more, since 2008.0. That alone requires rebuilding gcc+glibc, then rebuilding world again, aside to profile updates (also Python upgraded a few times), which might take an hour or so.

Also syslog-ng has been upgraded to version that breaks old syslog config (regex matching).


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group