[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libc5 to libc6 auto-upgrade script



On Thu, 8 Jan 1998, Lindsay Allen wrote:

> I did a new licb5 install and ran your script.  Here are some
> suggested changes.  There may be more, but I wanted to get this out
> the door to save everyone from covering the same ground.
>
> I put a " || exit" after the bash upgrade and suggest that more use be
> made of this to bring the script to a halt after an error.

done.

> Is it OK to do the reboot asked for by the libc5 upgrade at the
> completion of the script?

yes, it's ok to type 'shutdown -r now'.  no, i wont make the script do it.

imo, you may as well run dselect and upgrade everything to hamm before
rebooting so that you get a nice clean hamm system with only one reboot.


here's an updated version of the script which includes suggestions from
a few people, including yourself and a few improvements of my own.

This is still mostly untested software.  It probably wont completely
destroy your system but I am making no guarrantees at all: USE AT YOUR
OWN RISK.


---cut here---
#! /bin/sh

# safely upgrade a libc5 (bo) machine to libc6 (hamm).

# based on Scott Ellis' excellent "Debian libc5 to libc6 Mini-HOWTO"
# document.

# Author: Craig Sanders <cas@taz.net.au>
#
# Copyright Status: This script is hereby placed in the public domain
#
# Revision History:
# v0.0: 19980801 (morning)
#	- a rough transcript of scott's doc and my own experiences
# v0.1: 19980801 (night)
#   - a few bugfixes
#   - i got unlazy and put in the right subdirectories for each package. 
#     should run a lot faster.
# 	- now checks for failure at critical points and exits with a different
#     exit code for each failure.
#   - now uses 'binary-$(dpkg --print-installation-architecture)' instead 
#     of 'binary-i386'.
#
# TODO: (probably by somebody else.  this script is mostly good enough imo)
#   - error checking
#   - be smarter about locating the hamm rootdir (or just assume we're in
#     the right directory to start with.  look for ./base/libc6_*.deb as a
#     sanity check).

# first, build up a list of installed -dev packages so that we can
# remove them.  remove wg-15-locale too.
#
# this is necessary even on machines which aren't doing libc6
# development because libc5 can't be upgraded to latest version without
# removal of libc5-dev which also necessitates removal of other -dev
# packages like libdb1-dev and libdl1-dev if they are installed.

DEVPACKAGES=`dpkg --get-selections | 
    grep -- -dev | 
    grep -v deinstall | 
    cut -f1`

dpkg --remove -B $DEVPACKAGES wg-15-locale || exit 1

# now install the new versions of things.  Just the bare minimum to let
# the user safely run dselect for the rest of the upgrade.

# change this to prompt the user for the location of the debian archive.
cd /debian/dists/unstable/main/binary-$(dpkg --print-installation-architecture)

# libc
#
dpkg -iB base/ldso_*.deb base/libc5_*.deb base/libc6_*.deb \
    base/timezones_*.deb admin/locales_*.deb || exit 2

# libreadline, ncurses, and bash
#
dpkg -iB base/ncurses3.0_*.deb libs/ncurses3.4_*.deb  || exit 3
dpkg -iB oldlibs/libreadline2_*.deb  || exit 4
dpkg -iB base/libreadlineg2_*.deb || exit 5

# paranoia says run ldconfig NOW. don't laugh, i've needed to do this on
# some libc5-libc6 upgrades. i know that the postinst scripts for the
# libs are supposed to do it but ....
ldconfig
dpkg -iB base/bash_*.deb || exit 6

# new dpkg
#
dpkg -iB devel/libg++272_*.deb || exit 7
dpkg -iB base/dpkg_*.deb base/dpkg-dev_*.deb

# strictly speaking, dpkg-ftp and dpkg-mountable are not essential to upgrade
# right now but they're both very useful.
dpkg -iB utils/dpkg-ftp_*.deb admin/admin/dpkg-mountable_*.deb

# perl
#
dpkg -iB base/libgdbm1_*.deb devel/libgdbmg1_*.deb || exit 8
# paranoia says "run ldconfig now".
ldconfig
dpkg -iB base/perl-base_*.deb interpreters/perl_*.deb

# the user can now run dselect and select any -dev packages they want
# (and other packages too, of course :-)

cat <<__EOF__

libc6 is now installed.  Now run dselect to upgrade the rest of your
system.  Reboot for the utmp/wtmp wrapper functions in the upgraded
libc5 to take effect.

Also remember to fix up wtmp and utmp, otherwise last and who and sac
etc wont work. here's what Miquel van Smoorenburg <miquels@cistron.nl>
had to say about this recently in debian-user mailing list:

    > 1. You need to update ALL your packages to hamm
    > 2. Reboot if you haven't done that already
    > 3. You need to move the wtmp file and truncate the utmp file:
    >    cd /var/log
    >    mv wtmp wtmp.libc5
    >    touch wtmp
    >    cd /var/run
    >    cp /dev/null utmp
    > 4. You might want to reboot again to make sure
    > 
    > This is because the "struct utmp" and thus the utmp and wtmp
    > "databases" are different between libc5 and libc6

__EOF__
---cut here---

--
craig sanders


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: