Fixes in kernel-config.sh script.
This commit is contained in:
parent
dbdd120562
commit
a581a96c03
|
@ -10,9 +10,6 @@ REVISION=`kernel-config list | grep \*$ | cut -d" " -f6 | cut -d- -f2-8`
|
||||||
UNAME=`uname -r`
|
UNAME=`uname -r`
|
||||||
echo UNAME=$UNAME
|
echo UNAME=$UNAME
|
||||||
|
|
||||||
SOURCES=linux-$REVISION
|
|
||||||
[ "" == "$SOURCES" ] && echo "No appropriate kernel sources found ;-(" && exit -1
|
|
||||||
|
|
||||||
# remounting file systems ro->rw
|
# remounting file systems ro->rw
|
||||||
for fs in $RW_REMOUNT; do
|
for fs in $RW_REMOUNT; do
|
||||||
if [[ "$fs" =~ ^/+usr/*$ || "$fs" =~ ^/+boot/*$ ]]; then
|
if [[ "$fs" =~ ^/+usr/*$ || "$fs" =~ ^/+boot/*$ ]]; then
|
||||||
|
@ -24,18 +21,19 @@ done
|
||||||
|
|
||||||
# rm old modules
|
# rm old modules
|
||||||
echo REVISION=$REVISION
|
echo REVISION=$REVISION
|
||||||
cd /lib/modules && $NICE_CMD rm -rf `ls --color=never | grep -vE "^$REVISION$|^$UNAME$" | sort -V | head -n-1`
|
cd /lib/modules && $NICE_CMD rm -rf `ls --color=never | sort -V | head -n-1 | grep -vE "^$REVISION$|^$UNAME$"`
|
||||||
|
|
||||||
# rm old kernel revisions
|
# rm old kernel revisions
|
||||||
mount -o remount,rw /boot
|
mount -o remount,rw /boot
|
||||||
cd /boot
|
cd /boot
|
||||||
for f in System.map config vmlinuz kernel-genkernel initramfs; do
|
for f in System.map config vmlinuz kernel-genkernel initramfs; do
|
||||||
rm -f `ls --color=never $f-* 2>/dev/null | grep -vE "$REVISION$|$REVISION.img$|$UNAME$|$UNAME.img$" | sort -V | head -n-1`
|
rm -f `ls --color=never $f-* 2>/dev/null | sort -V | head -n-1 | grep -vE "$REVISION$|$REVISION.img$|$UNAME$|$UNAME.img$"`
|
||||||
done
|
done
|
||||||
mount -o remount,ro -force /boot
|
mount -o remount,ro -force /boot
|
||||||
|
|
||||||
# rm old sources
|
# rm old sources
|
||||||
cd /usr/src && $NICE_CMD rm -rf `find -maxdepth 1 -name "linux-*" -type d | grep -v "$SOURCES$"`
|
cd /usr/src
|
||||||
|
$NICE_CMD rm -rf `find -maxdepth 1 -name "linux-*" -type d | sort -V | head -n-1 | grep -vE "linux-$REVISION$|linux-$UNAME"`
|
||||||
|
|
||||||
# remounting file systems rw->ro
|
# remounting file systems rw->ro
|
||||||
for fs in $RO_REMOUNT; do
|
for fs in $RO_REMOUNT; do
|
||||||
|
|
Loading…
Reference in New Issue