diff options
Diffstat (limited to 'kernel/update_kernel')
-rwxr-xr-x | kernel/update_kernel | 58 |
1 files changed, 43 insertions, 15 deletions
diff --git a/kernel/update_kernel b/kernel/update_kernel index 9cea09e7d..ddb7483dc 100755 --- a/kernel/update_kernel +++ b/kernel/update_kernel @@ -1,11 +1,20 @@ #!/bin/bash ALL_KERNELS="all.kernels" +RPMS=/export/Mandrake/RPMS + +ARCH=`uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/'` + # move stuff to this new "kernel" directory if [ ! -d all.kernels ]; then + 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() { @@ -24,12 +33,18 @@ function create_modules() { perl -pi -e 's/((plip|ppa|imm): parport)/$1 parport_pc/' modules.dep /sbin/modinfo -f '%{filename} %{description}\n' *.o | perl -lne 'print "$1\t$2" if /(.*?)\.o "(.*)"/' > modules.description +} + +function create_modules_mar() { + echo -n "stripping $kern: " + $GIBASEDIR/kernel/strip_modules *.o 2>/dev/null + echo "done" echo -n "packdrake $kern: " ls *.o | packdrake -b9s "modules.cz" 400000 echo "done" mv modules.cz ../modules.cz-$kern - for i in network cdrom hd usb other pcmcia all; do + for i in network network_gigabit_usb network_gigabit network_usb cdrom hd hdcdrom_usb pcmcia all; do modules_var="${i}_modules" eval "create_marfile ${i}_modules.mar \$$modules_var" done @@ -38,13 +53,21 @@ 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/') +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,21 +84,12 @@ fi cd .. } -ARCH=`uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/'` - -eval `perl modules.pl images` if [ "$ARCH" == "i386" ]; then for i in $ALL_KERNELS/*/boot/vmlinuz*; do #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 fi @@ -87,14 +101,28 @@ for i in $ALL_KERNELS/*; do ( mkdir all.modules/$kern cd all.modules/$kern + + create_modules ../../$i $kern + ) || exit 1 +done +cp -f all.modules/$main/modules.description . + +l=`perl modules.pl images` || exit 1 +eval $l + +for i in $ALL_KERNELS/*; do + kern=`basename $i` + ( + cd all.modules/$kern + if [ "$kern" = "$main" ]; then - create_modules ../../$i $kern + create_modules_mar ../../$i $kern else echo "$kern ($main)" - create_modules ../../$i $kern 2>/dev/null + create_modules_mar ../../$i $kern 2>/dev/null fi ) || exit 1 done -cp -f all.modules/$main/modules.description . + ./check_mar.pl |