#!/bin/sh SCSIMODULES=" 53c7,8xx.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 pas16.o ppa.o qlogicfas.o qlogicisp.o seagate.o t128.o wd7000.o ultrastor.o u14-34f.o ncr53c8xx.o" NETMODULES="apricot.o e2100.o eexpress.o eepro100.o de4x5.o ewrk3.o hp-plus.o hp.o hp100.o ibmtr.o ne.o smc-ultra.o smc9194.o tulip.o wd.o plip.o 3c501.o 3c503.o 3c509.o 3c59x.o 8390.o de600.o de620.o depca.o arcnet.o at1700.o eepro.o ni52.o ni65.o" CDMODULES="aztcd.o gscd.o mcd.o mcdx.o optcd.o sbpcd.o sjcd.o sonycd535.o cdrom.o cdu31a.o cm206.o isp16.o bpcd.o" BLOCKMODULES="loop.o" LIBS="libnss_files libnss_dns libresolv" MISCMODULES="lp.o" FSMODULES="isofs.o nfs.o smbfs.o" PCMCIAMODULES="pcmcia_core.o tcic.o ds.o i82365.o" UNGZMODULES="8390.o.gz" SBIN='$1/misc/src/install/install $1/misc/src/installinit/init /bin/cpio' usage () { echo "updboots: " 2>&1 exit 1 } if [ -z "$1" -o -z "$2" ]; then usage fi if [ ! -d "$1/misc/src/install" ]; then echo "$1 is not a valid directory" 2>&1 usage fi if [ ! -d "/lib/modules/$2/scsi" ]; then echo "$2 is not a valid modules directory" 2>&1 usage fi if [ ! -f "/boot/vmlinuz-$2" ]; then echo "/boot/vmlinuz-$2 does not exist" usage fi rm -rf initrd/modules mkdir initrd/modules for n in $SCSIMODULES; do cp /lib/modules/$2/scsi/$n ./initrd/modules done for n in $NETMODULES; do cp /lib/modules/$2/net/$n ./initrd/modules done for n in $CDMODULES; do cp /lib/modules/$2/cdrom/$n ./initrd/modules done for n in $MISCMODULES; do cp /lib/modules/$2/misc/$n ./initrd/modules done for n in $FSMODULES; do cp /lib/modules/$2/fs/$n ./initrd/modules done for n in $BLOCKMODULES; do cp /lib/modules/$2/block/$n ./initrd/modules done SPACE1=`du -s initrd | awk '{print $1}'` #echo -n "Stripping modules... " #for n in initrd/modules/*.o; do #strip `nm $n | grep ' [a-z] '| awk '{ print "--strip-symbol=" $3}'` $n #done SPACE2=`du -s initrd | awk '{print $1}'` #DIFF=`expr $SPACE1 - $SPACE2` #echo "done (saved ${DIFF}k)" echo -n "Compressing modules... " (cd initrd/modules; gzip -9n *.o) (cd initrd/modules; gunzip $UNGZMODULES) SPACE1=`du -s initrd | awk '{print $1}'` SPACE1=`du -s initrd | awk '{print $1}'` DIFF=`expr $SPACE2 - $SPACE1` echo "done (saved ${DIFF}k)" for n in $PCMCIAMODULES; do ln -s /lib/modules/$2/pcmcia/$n ./initrd/modules 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 (cd initrd/usr/lib; file * | grep 'shared object' | cut -d: -f1 | xargs strip) cp -a keymaps/keymaps.gz initrd/etc for n in $SBIN; do file=`eval echo $n` strip $file cp -f $file initrd/sbin done rm -f initrd/usr/lib/rpmrc cp -a /usr/lib/rpmrc initrd/usr/lib/rpmrc cp -f "/boot/vmlinuz-$2" boot/vmlinuz ln -sf /sbin/init initrd/linuxrc rm -f initrd/etc/mtab ln -sf /proc/mounts initrd/etc/mtab cp boot/vmlinuz $1/dosutils/autoboot/vmlinuz