home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1999 November
/
VPR9911B.ISO
/
misc
/
src
/
trees
/
updboots
< prev
next >
Wrap
Text File
|
1999-08-30
|
7KB
|
266 lines
#!/bin/sh
export PATH=/sbin:$PATH
q=--quiet
KERNELROOT=/tmp/updboot.kernel-$$
SCSIMODULES="
53c7,8xx.o AM53C974.o BusLogic.o NCR53c406a.o advansys.o aha152x.o
aha1542.o aha1740.o aic7xxx.o dtc.o eata_dma.o eata_pio.o fdomain.o
g_NCR5380.o in2000.o megaraid.o ncr53c8xx.o pas16.o
qlogicisp.o seagate.o t128.o u14-34f.o wd7000.o ultrastor.o"
# broken network modules: at1700.o
NETMODULES="
3c501.o 3c503.o 3c505.o 3c507.o 3c509.o 3c59x.o 82596.o 8390.o ac3200.o
epic100.o cs89x0.o de4x5.o de600.o de620.o dgrs.o e2100.o
eepro.o eepro100.o eexpress.o es3210.o eth16i.o hp-plus.o hp.o
hp100.o ibmtr.o lance.o lne390.o ne.o ne2k-pci.o ne3210.o ni52.o
ni5010.o ni65.o plip.o
pcnet32.o rtl8139.o rcpci45.o sktr.o smc9194.o smc-ultra.o
smc-ultra32.o tlan.o
tulip.o wavelan.o wd.o yellowfin.o"
CDMODULES="
aztcd.o cm206.o isp16.o mcdx.o sbpcd.o sonycd535.o
cdu31a.o gscd.o mcd.o optcd.o sjcd.o"
LOCALBLOCKMODULES="DAC960.o cpqarray.o"
BLOCKMODULES="loop.o"
LIBS=""
MISCMODULES="lp.o parport_pc.o parport.o"
NETMISCMODULES="sunrpc.o"
LOCALFSMODULES="vfat.o fat.o"
NETFSMODULES="nfs.o lockd.o vfat.o fat.o"
PCMCIAMODULES="pcmcia_core.o tcic.o ds.o i82365.o"
# this is an egrep expression, not a list!
PRISTINEMODULES="(8390.o)|(loop.o)"
SBIN='$1/misc/src/install/install $1/misc/src/installinit/init'
MODLINKS="block cdrom fs ipv4 misc net scsi"
usage () {
echo "updboots: <imagetree> <rpm-tree> <kernel-version> [dep]" 2>&1
exit 1
}
if [ -z "$1" -o -z "$2" -o -z "$3" ]; then
usage
fi
mkdir -p $KERNELROOT
rpm2cpio $2/kernel-$3.i386.rpm | (cd $KERNELROOT; cpio -id)
if echo $3 | grep -e BOOT > /dev/null; then
kversion=`echo $3 | sed 's/BOOT-//'`
version=`echo ${kversion}BOOT`
else
version=$3
fi
if [ ! -d "$1/misc/src/install" ]; then
echo "$1 is not a valid directory" 2>&1
usage
fi
if [ ! -d "$KERNELROOT/lib/modules/$version/scsi" ]; then
echo "$2 is not a valid modules directory" 2>&1
usage
fi
if [ ! -f "$KERNELROOT/boot/vmlinuz-$version" ]; then
echo "$KERNELROOT/boot/vmlinuz-$version does not exist"
usage
fi
rm -rf initrd
mkdir -p initrd/modules
mkdir -p initrd/sbin
mkdir -p initrd/var
ln -s ../tmp initrd/var/run
rm -rf local/modules network/modules ../../../LASER5/instimage/modules
mkdir -p local/modules network/modules ../../../LASER5/instimage/modules
for n in $SCSIMODULES; do
cp $KERNELROOT/lib/modules/$version/scsi/$n ./local/modules
cp $KERNELROOT/lib/modules/$version/scsi/$n ../../../LASER5/instimage/modules
done
for n in $LOCALBLOCKMODULES; do
cp $KERNELROOT/lib/modules/$version/block/$n ./local/modules
cp $KERNELROOT/lib/modules/$version/block/$n ../../../LASER5/instimage/modules
done
for n in $NETMODULES; do
cp $KERNELROOT/lib/modules/$version/net/$n ./network/modules
cp $KERNELROOT/lib/modules/$version/net/$n ../../../LASER5/instimage/modules
done
for n in $CDMODULES; do
cp $KERNELROOT/lib/modules/$version/cdrom/$n ./local/modules
cp $KERNELROOT/lib/modules/$version/cdrom/$n ../../../LASER5/instimage/modules
done
for n in $MISCMODULES; do
cp $KERNELROOT/lib/modules/$version/misc/$n ./network/modules
cp $KERNELROOT/lib/modules/$version/misc/$n ./local/modules
cp $KERNELROOT/lib/modules/$version/misc/$n ../../../LASER5/instimage/modules
done
for n in $NETMISCMODULES; do
cp $KERNELROOT/lib/modules/$version/misc/$n ./network/modules
cp $KERNELROOT/lib/modules/$version/misc/$n ../../../LASER5/instimage/modules
done
for n in $LOCALFSMODULES; do
cp $KERNELROOT/lib/modules/$version/fs/$n ./local/modules
cp $KERNELROOT/lib/modules/$version/fs/$n ../../../LASER5/instimage/modules
done
for n in $NETFSMODULES; do
cp $KERNELROOT/lib/modules/$version/fs/$n ./network/modules
cp $KERNELROOT/lib/modules/$version/fs/$n ../../../LASER5/instimage/modules
done
for n in $BLOCKMODULES; do
cp $KERNELROOT/lib/modules/$version/block/$n ./initrd/modules
cp $KERNELROOT/lib/modules/$version/block/$n ../../../LASER5/instimage/modules
done
for I in local/modules network/modules ../../../LASER5/instimage/modules; do
echo -n "Computing $I dependencies... "
cd $I;
SPACE2=`du -s . | awk '{print $1}'`
/sbin/depmod -m $KERNELROOT/boot/System.map-$version -i -e *.o | \
grep ':.*o' | \
sed -e 's/\.o//g' \
-e 's/lp: parport/lp: parport_pc/g' \
-e 's/plip: parport/plip: parport_pc/g' > modules.dep
if grep "unresolved symbol" modules.dep; then
echo "ERROR - Unresolved symbols in $I"
else
echo "done. "
fi
echo -n "Balling $I modules... "
ls *.o | egrep -v "$PRISTINEMODULES|(modules.dep)" | cpio $q -H crc -o |
gzip -9 > modules.cgz;
gunzip < modules.cgz | cpio $q -t | xargs rm -f
SPACE1=`du -s . | awk '{print $1}'`
cd -
DIFF=`expr $SPACE2 - $SPACE1`
echo "done (saved ${DIFF}k)"
done
for n in $LIBS; do
# this preserves hard links
rm -f initrd/usr/lib/$n*
(cd /lib; tar cSpf - ${n}*) | (cd initrd/usr/lib; tar xSpf -)
done
for n in $PCMCIAMODULES; do
ln -s /tmp/pcmcia/lib/modules/preferred/pcmcia/$n ./initrd/modules
ln -s /tmp/pcmcia/lib/modules/preferred/pcmcia/$n ../../../LASER5/instimage/modules
done
rm -rf initrd/etc
mkdir initrd/etc
cp -a keymaps/keymaps.gz initrd/etc
cp -a fonts.cgz initrd/etc
cp -a ../install/install1.tr initrd/etc
ln -s /usr/etc/install2.tr initrd/etc/install2.tr
rm -rf initrd/usr/lib/terminfo
mkdir -p initrd/usr/lib/terminfo/l
rm -rf initrd/usr/share
ln -s lib initrd/usr/share
cp /usr/share/terminfo/l/linux initrd/usr/lib/terminfo/l/linux
tic linux-lat.terminfo
cp /usr/share/terminfo/l/linux-lat initrd/usr/lib/terminfo/l/linux-lat
for n in $SBIN; do
file=`eval echo $n`
strip $file
cp -f $file initrd/sbin
done
ln -s install initrd/sbin/insmod
ln -s install initrd/sbin/rmmod
ln -s /usr/bin/sh initrd/sbin/sh
mkdir -p initrd/usr/lib/rpm
rm -f initrd/usr/lib/rpm/rpmrc
cp -ar /usr/lib/rpm/rpmrc initrd/usr/lib/rpm/rpmrc
ln -sf /sbin/init initrd/linuxrc
rm -f initrd/etc/mtab
ln -sf /proc/mounts initrd/etc/mtab
rm -rf initrd/dev
mkdir -p initrd/dev
mknod initrd/dev/console c 5 1
chmod 600 initrd/dev/console
mknod initrd/dev/ttyS0 c 4 64
chmod 644 initrd/dev/ttyS0
mknod initrd/dev/null c 1 3
chmod 666 initrd/dev/null
mknod initrd/dev/mem c 1 1
chmod 600 initrd/dev/mem
mknod initrd/dev/ram b 1 1
chmod 640 initrd/dev/ram
for TTY in 0 1 2 3 4 5; do
mknod initrd/dev/tty$TTY c 4 $TTY
chmod 600 initrd/dev/tty$TTY
chown root:tty initrd/dev/tty$TTY
done
mkdir -p initrd/proc
mkdir -p initrd/tmp
mkdir -p initrd/lost+found
ln -s sbin initrd/bin
cat > initrd/.profile << EOF
PATH=/bin:/usr/bin:/mnt/sbin:/mnt/usr/sbin:/mnt/bin:/mnt/usr/bin
export PATH
EOF
cp -f "$KERNELROOT/boot/vmlinuz-$version" boot/vmlinuz
rm -rf pcmcia/lib/*
mkdir -p pcmcia/lib/modules/${version}/pcmcia
cp $KERNELROOT/lib/modules/$version/pcmcia/* pcmcia/lib/modules/${version}/pcmcia
for n in $MODLINKS; do
ln -s /modules pcmcia/lib/modules/${version}/$n
done
ln -s ${version} pcmcia/lib/modules/preferred
rm -rf $KERNELROOT
mkdir -p $1/dosutils/autoboot
cp boot/vmlinuz $1/dosutils/autoboot/vmlinuz