summaryrefslogtreecommitdiffstats
path: root/upd-instroot
blob: 3e909ad7aa14149a319ec7ec303eb88decfaf90c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash

if [ -z "$1" -o ! -d "$1" ]; then
	echo "$0: updates instimage from a Red Hat RPMS directory"
	echo "usage: $0 <dir>"
	exit 1
fi

SRC=$1/RedHat/RPMS
DEST=../../../RedHat/instimage

PACKAGES="glibc-2 ldconfig filesystem basesystem setup fileutils
          XFree86-libs XFree86-SVGA XFree86-FBDev XFree86-75dpi-fonts
          XFree86-3. xpm-3 glib- gtk+- gnome-libs slang python-1 newt
          imlib-1 libpng libtiff libjpeg- libtermcap-2 zlib rpm bash-
          pygtk- pygnome- util-linux procps e2fsprogs-1 esound-0
          audiofile-0"

for I in $PACKAGES; do
    for J in `ls $SRC/$I*`; do
	if ! echo $J | grep devel > /dev/null; then
	    RPMS="$RPMS $J"
	fi
    done
done

if [ ! -e $DEST/var/lib/rpm/packages.rpm ]; then
    mkdir -p $DEST/var/lib/rpm
    rpm --initdb -r `pwd`/$DEST
fi
rpm -Uvh $RPMS -r `pwd`/$DEST --relocate /bin=/usr/bin \
                              --relocate /sbin=/usr/sbin --badreloc \
                              --excludedocs --noscripts --nodeps --force

rm -rf $DEST/bin $DEST/sbin $DEST/boot $DEST/home $DEST/root $DEST/tmp

# Xserver needs a place to put the compiled xkb maps.
rm -rf $DEST/usr/X11R6/lib/X11/xkb/compiled
ln -s /tmp $DEST/usr/X11R6/lib/X11/xkb/compiled

make install

chroot $DEST ldconfig -v