summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-04-14 21:50:37 +0000
committerErik Troan <ewt@redhat.com>2000-04-14 21:50:37 +0000
commit03ea7bd05929bccb48417486ec5bb5622381a038 (patch)
tree8525c5a392009dba3dcc98a47ae5611e81bfe034
parentaa3afa459c72a7c078c23f97875a94332310256b (diff)
downloadanaconda-03ea7bd05929bccb48417486ec5bb5622381a038.tar.gz
anaconda-03ea7bd05929bccb48417486ec5bb5622381a038.tar.xz
anaconda-03ea7bd05929bccb48417486ec5bb5622381a038.zip
piles of fixes
-rwxr-xr-xscripts/mk-images97
-rw-r--r--scripts/mk-images.i38617
2 files changed, 82 insertions, 32 deletions
diff --git a/scripts/mk-images b/scripts/mk-images
index 0da3f68bc..289be0eeb 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -18,10 +18,17 @@ TOPDIR=$(cd $TOPDIR; pwd)
KERNELPATH=$1
IMAGEPATH=$2
FULLMODPATH=$3
+ IMGPATH=$(echo $FULLMODPATH | sed 's,/[^/]*$,,')
KERNELROOT=/tmp/updboot.kernel
MODDEPS=$KERNELROOT/moddeps
ARCH=$(uname -m | sed 's/i.86/i386/')
+ if [ ! -d "$1" ]; then
+ LATEST=latest --arch $ARCH
+ else
+ LATEST=findPackage
+ fi
+
rm -rf $IMAGEPATH
rm -rf $FULLMODPATH
mkdir -p $IMAGEPATH
@@ -30,17 +37,20 @@ TOPDIR=$(cd $TOPDIR; pwd)
mkdir -p $KERNELROOT
# Stuff that we need
- TRIMPCITABLE=$FULLMODPATH/../usr/lib/anaconda-runtime/trimpcitable
- GETMODDEPS=$FULLMODPATH/../usr/lib/anaconda-runtime/moddeps
- MODLIST=$FULLMODPATH/../usr/lib/anaconda-runtime/modlist
- MODINFO=$FULLMODPATH/../usr/lib/anaconda-runtime/loader/module-info
- FILTERMODDEPS=$FULLMODPATH/../usr/lib/anaconda-runtime/filtermoddeps
- LOADERBINDIR=$FULLMODPATH/../usr/lib/anaconda-runtime/loader
- BOOTDISKDIR=$FULLMODPATH/../usr/lib/anaconda-runtime/boot
- LANGTABLE=$FULLMODPATH/../usr/lib/anaconda/lang-table
- SYSLINUX=$FULLMODPATH/../usr/bin/syslinux
- PCITABLE=$FULLMODPATH/../usr/share/kudzu/pcitable
+ TRIMPCITABLE=$IMGPATH/usr/lib/anaconda-runtime/trimpcitable
+ GETMODDEPS=$IMGPATH/usr/lib/anaconda-runtime/moddeps
+ MODLIST=$IMGPATH/usr/lib/anaconda-runtime/modlist
+ MODINFO=$IMGPATH/usr/lib/anaconda-runtime/loader/module-info
+ FILTERMODDEPS=$IMGPATH/usr/lib/anaconda-runtime/filtermoddeps
+ LOADERBINDIR=$IMGPATH/usr/lib/anaconda-runtime/loader
+ BOOTDISKDIR=$IMGPATH/usr/lib/anaconda-runtime/boot
+ LANGTABLE=$IMGPATH/usr/lib/anaconda/lang-table
+ SYSLINUX=$IMGPATH/usr/bin/syslinux
+ PCITABLE=$IMGPATH/usr/share/kudzu/pcitable
CACHE=$KERNELROOT/lib/modules/.cache
+ MODULESUSED=$KERNELROOT/modules-used
+
+ touch $MODULESUSED
dieLater=
for n in $TRIMPCITABLE $PCITABLE $GETMODDEPS $MODINFO $FILTERMODDEPS \
@@ -60,6 +70,22 @@ TOPDIR=$(cd $TOPDIR; pwd)
if [ -n "$dieLater" ]; then exit 1; fi
+findPackage() {
+ dir=$1
+ name=$2
+
+ for n in $dir/$name*; do
+ thisName=$(rpm --qf '%{NAME}' -qp $n)
+ if [ $thisName = $name ]; then
+ echo $n
+ return
+ fi
+ done
+
+ echo "cannot find package $name in path $dir" >&2
+ kill -9 $$
+}
+
findmodule () {
if [ ! -f $CACHE ]; then
find $KERNELROOT/lib/modules > $CACHE
@@ -94,21 +120,26 @@ getmoddeps () {
}
intcopymodules () {
+ dir=$2
+
for n in $1; do
m=$(findmodule $n)
if [ -z "$m" ]; then
echo "Module $n not found in kernel rpm"
else
- for dir in $2; do
- if ! cp $m $dir ; then
- echo "Failed to copy $m to $dir (for module $n)"
- fi
- done
+ echo $n >> $MODULESUSED
+ if ! cp $m $dir ; then
+ echo "Failed to copy $m to $dir (for module $n)"
+ fi
fi
done
}
resdeps () {
+ $GETMODDEPS -m $MODDEPS $* 2>&1
+ if [ $? != "0" ] ; then
+ kill -9 $$
+ fi
list=`$GETMODDEPS -m $MODDEPS $*`
items=$(for n in $* $list; do echo $n; done | sort -u)
echo $items
@@ -117,9 +148,14 @@ resdeps () {
expandModuleSet() {
SET=""
for name in $1; do
- if [ $(echo $name | cut -c1) = '+' ]; then
+ char=$(echo $name | cut -c1)
+ if [ $char = '=' ]; then
NAME=$(echo $name | cut -c2-)
SET="$SET $($MODLIST --modinfo-file $MODINFO $NAME)"
+ elif [ $char = '+' ]; then
+ NAME=$(echo $name | cut -c2-)
+
+ SET=$( ($MODLIST --modinfo-file $MODINFO $NAME; cat $MODULESUSED) | sort | uniq -u)
else
SET="$SET $name"
fi
@@ -171,13 +207,11 @@ makemoduleball() {
}
makemainmodules() {
-set -x
modlist=`expandModuleSet "$1"`
rm -rf $FULLMODPATH
makemoduleball $FULLMODPATH "$modlist"
-set +x
}
makebootdisk() {
@@ -282,7 +316,7 @@ EOF
gzip -9 < $MBD_FSIMAGE.uncompressed > $MBD_FSIMAGE
rm -rf $MBD_FSIMAGE.uncompressed $MBD_DIR
- rm -f $MBD_TMPIMAGE $MBD_BOOTTREE
+ rm -rf $MBD_TMPIMAGE $MBD_BOOTTREE
dd if=/dev/zero bs=1k count=$FLOPPYSIZE of=/$MBD_TMPIMAGE
# Create the bootdisk image as $MBD_TMPIMAGE, mount it, copy
@@ -315,7 +349,7 @@ EOF
makedriverdisk () {
diskname=$1
- modlist=$2
+ modlist=$(expandModuleSet $2)
diskpath=/tmp/makedriverdisk.$$/$diskname
rm -rf $diskpath
@@ -323,27 +357,40 @@ makedriverdisk () {
makemoduleball $diskpath "$modlist"
- size=$(expr 20 + $(du -sk $diskpath | awk '{print $1}'))
+ size=$(expr 60 + $(du -sk $diskpath | awk '{print $1}'))
if [ $size -lt 57 ]; then
size=64
fi
dd if=/dev/zero of=/tmp/$diskname.img bs=1k count=$size 2> /dev/null
- echo y | mke2fs /tmp/$diskname.img > /dev/null 2>/dev/null
+ echo y | mke2fs -i 4096 /tmp/$diskname.img > /dev/null 2>/dev/null
mkdir -p /tmp/mkdd.$$
- mount -o loop /tmp/$diskname.img /tmp/mkdd.$$
+ mount -t ext2 -o loop /tmp/$diskname.img /tmp/mkdd.$$
+ rmdir /tmp/mkdd.$$/lost+found
(cd $diskpath; tar cSpf - .) | (cd /tmp/mkdd.$$; tar xSpf -)
+ DIE=""
+ if [ $(du -s $diskpath | cut -f1) != $(du -s /tmp/mkdd.$$ | cut -f1) ]; then
+ echo copy to disk image failed
+ ls -l /tmp/mkdd.$$
+ echo "disk size: $size"
+ ls -l $diskpath
+ DIE=1
+ fi
umount /tmp/mkdd.$$
rm -rf /tmp/mkdd.$$
+ if [ -n "$DIE" ]; then
+ kill -9 $$
+ fi
+
cp /tmp/${diskname}.img $IMAGEPATH/${diskname}.img
rm /tmp/${diskname}.img
rm -rf $diskpath
}
# Find the kernel, unpack it, and verify it
- kpackage=$(latest --arch $ARCH $KERNELPATH kernel-BOOT)
- ppackage=$(latest --arch $ARCH $KERNELPATH kernel-pcmcia-cs)
+ kpackage=$($LATEST $KERNELPATH kernel-BOOT)
+ ppackage=$($LATEST $KERNELPATH kernel-pcmcia-cs)
version=$(rpm --qf '%{VERSION}-%{RELEASE}' -qp $kpackage)BOOT
rpm2cpio $kpackage | (cd $KERNELROOT; cpio --quiet -iumd)
diff --git a/scripts/mk-images.i386 b/scripts/mk-images.i386
index c862a7ef9..5f1ddd9f8 100644
--- a/scripts/mk-images.i386
+++ b/scripts/mk-images.i386
@@ -1,11 +1,14 @@
-#makebootdisk boot.img loader-local "+scsi vfat"
+makebootdisk boot.img loader-local "vfat
+ AM53C974 ips DAC960 megaraid ncr53c8xx cpqarray aic7xxx
+ BusLogic qlogicisp advansys eata_dma"
+
makebootdisk bootnet.img loader-network "3c59x ac3200 at1700 de4x5
- de600 de620 depca dgrs eepro eexpress hp-plus hp
- hp100 ibmtr ni52 tulip wavelan wd nfs"
+ de600 de620 depca dgrs eepro eexpress hp-plus hp
+ hp100 ibmtr ni52 tulip wavelan wd nfs"
+
+makedriverdisk "drivers" "+scsi -net"
-#makedriverdisk "gdth" "gdth"
-#makedriverdisk "eata_dma" "eata_dma"
-#makedriverdisk "paride" "parport_pc parport pcd paride aten bpck comm dstr epat fit2 fit3 friq frpw kbic ktti on20 on26 epia ppa imm"
+makedriverdisk "paride" "parport_pc parport pcd paride aten bpck comm dstr epat fit2 fit3 friq frpw kbic ktti on20 on26 epia ppa imm"
-makemainmodules "+scsi +net vfat"
+makemainmodules "=scsi =net vfat"