diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-01-13 10:59:53 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-01-13 10:59:53 +0000 |
commit | 3bd1b10d335923ff4216dd58e35d1d957a5400d3 (patch) | |
tree | 23675ed611bc4e43dbb9718af10909e71a6a6f13 /kernel | |
parent | 7b11ba72e055836161f185a87521cc1d2c374413 (diff) | |
download | drakx-backup-do-not-use-3bd1b10d335923ff4216dd58e35d1d957a5400d3.tar drakx-backup-do-not-use-3bd1b10d335923ff4216dd58e35d1d957a5400d3.tar.gz drakx-backup-do-not-use-3bd1b10d335923ff4216dd58e35d1d957a5400d3.tar.bz2 drakx-backup-do-not-use-3bd1b10d335923ff4216dd58e35d1d957a5400d3.tar.xz drakx-backup-do-not-use-3bd1b10d335923ff4216dd58e35d1d957a5400d3.zip |
- allow to specify a kernel rpm (works both for BOOT kernels and normal one)
- allow --move
Diffstat (limited to 'kernel')
-rwxr-xr-x | kernel/update_kernel | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/kernel/update_kernel b/kernel/update_kernel index f1a351689..cdfdf3e19 100755 --- a/kernel/update_kernel +++ b/kernel/update_kernel @@ -79,28 +79,30 @@ function create_modules_mar() { [ -e $ALL_KERNELS/.main ] && main=$(cat $ALL_KERNELS/.main) -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}/') +if [ "$1" = "--move" ]; then + MOVE=1 + shift +fi + +#- allow specifying a kernel file on commandline (./update_kernel /RPMS/kernel-2.4.22.10mdk-1-1mdk.i586.rpm 2.4.22-10mdk) +if [ -n "$1" ]; then + rpm=$1 +elif [ "$ARCH" == "ia64" ] || [ "$ARCH" == "ppc" ]; then + rpm=$RPMS/kernel-[0-9]*.rpm else - #- allow specifying a kernel file on commandline (./update_kernel /RPMS/kernel-2.4.22.10mdk-1-1mdk.i586.rpm 2.4.22-10mdk) - if [ -n "$1" ]; then - file=$1 - rpm=$2 - MOVE=1 - else - file=$RPMS/kernel-BOOT-*.rpm - rpm=$(rpm -qp --qf '%{name}' $file | perl -pe 's/kernel-BOOT-((\.?[0-9]+){3})\.(.*)/$1-${3}BOOT/') - fi + rpm=$RPMS/kernel-BOOT-*.rpm fi -if [ -n "$rpm" -a ! -e $ALL_KERNELS/$rpm ]; then +ver=$(rpm -qp --qf '%{name}' $rpm | perl -pe 's/kernel(-(BOOT))?-((\.?[0-9]+){3})\.(.*)/$3-$5$2/') + +if [ -n "$ver" -a ! -e $ALL_KERNELS/$ver ]; then [ -n "$main" ] && rm -rf $ALL_KERNELS/$main cd $ALL_KERNELS - rm -rf $rpm ; mkdir $rpm - cd $rpm + rm -rf $ver ; mkdir $ver + cd $ver if [ "$ARCH" == "ia64" ] || [ "$ARCH" == "ppc" ]; then rpm2cpio $RPMS/kernel-[0-9]*.rpm | cpio -id else - rpm2cpio $file | cpio -id + rpm2cpio $rpm | cpio -id fi find -type f -name "*.o.gz" -o -name "*.ko.gz" | xargs gunzip cd ../.. |