summaryrefslogtreecommitdiffstats
path: root/kernel/update_kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/update_kernel')
-rwxr-xr-xkernel/update_kernel38
1 files changed, 27 insertions, 11 deletions
diff --git a/kernel/update_kernel b/kernel/update_kernel
index 9cea09e7d..6e43ceeb3 100755
--- a/kernel/update_kernel
+++ b/kernel/update_kernel
@@ -1,11 +1,17 @@
#!/bin/bash
ALL_KERNELS="all.kernels"
+RPMS=/RPMS
# move stuff to this new "kernel" directory
if [ ! -d all.kernels ]; then
- mv ../all.kernels .
- rm -rf ../all.modules
+ if [ -d ../all.kernels ]; then
+ mv ../all.kernels .
+ rm -rf ../all.modules
+ else
+ # make sure "all.kernels" directory exists
+ mkdir all.kernels
+ fi
fi
function create_marfile() {
@@ -38,13 +44,23 @@ function create_modules() {
[ -e $ALL_KERNELS/.main ] && main=$(cat $ALL_KERNELS/.main)
-rpm=$(rpm -qp --qf '%{name}' /RPMS/kernel-BOOT-*.rpm | perl -pe 's/kernel-BOOT-(.*)\.(.*)/$1-${2}BOOT/')
+ARCH=`uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/'`
+
+if [ "$ARCH" == "ia64" ] || [ "$ARCH" == "ppc" ]; then
+ rpm=$(rpm -qp --qf '%{name}' $RPMS/kernel-[0-9]*.rpm | perl -pe 's/kernel-((\.?[0-9]+){3})\.(.*)/$1-${3}/')
+else
+ rpm=$(rpm -qp --qf '%{name}' $RPMS/kernel-BOOT-*.rpm | perl -pe 's/kernel-BOOT-((\.?[0-9]+){3})\.(.*)/$1-${3}BOOT/')
+fi
if [ -n "$rpm" -a ! -e $ALL_KERNELS/$rpm ]; then
[ -n "$main" ] && rm -rf $ALL_KERNELS/$main
cd $ALL_KERNELS
rm -rf $rpm ; mkdir $rpm
cd $rpm
- rpm2cpio /RPMS/kernel-BOOT-*.rpm | cpio -id
+ if [ "$ARCH" == "ia64" ] || [ "$ARCH" == "ppc" ]; then
+ rpm2cpio $RPMS/kernel-[0-9]*.rpm | cpio -id
+ else
+ rpm2cpio $RPMS/kernel-BOOT-*.rpm | cpio -id
+ fi
find -type f -name "*.o.gz" | xargs gunzip
cd ../..
@@ -61,7 +77,6 @@ fi
cd ..
}
-ARCH=`uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/'`
eval `perl modules.pl images`
@@ -70,12 +85,12 @@ if [ "$ARCH" == "i386" ]; then
#disable any existing resolution!!!
/usr/sbin/rdev -v $i 65535 #788 #785
done
-else
- if [ "$ARCH" == "ppc" ]; then
- cp -f "$KERNEL_BOOT_PATH"/boot/vmlinux .
- else
- cp -f "$KERNEL_BOOT_PATH"/boot/vmlinux.gz .
- fi
+elif [ "$ARCH" == "ppc" ]; then
+ cp -f "$KERNEL_BOOT_PATH"/boot/vmlinux .
+elif [ "$ARCH" == "ia64" ]; then
+ cp -f "$KERNEL_BOOT_PATH"/boot/efi/vmlinuz* .
+else
+ cp -f "$KERNEL_BOOT_PATH"/boot/vmlinuz* .
fi
@@ -91,6 +106,7 @@ for i in $ALL_KERNELS/*; do
create_modules ../../$i $kern
else
echo "$kern ($main)"
+ find ../../$i -type f -name "*.o.gz" | xargs gunzip
create_modules ../../$i $kern 2>/dev/null
fi
) || exit 1