installer.kmdr: fix MBR changed check after gparted

installer.sh: fix not-running kernel removal
This commit is contained in:
Silvan Calarco 2011-10-06 18:27:19 +02:00
parent 833f6c8925
commit 7b63c05b37
2 changed files with 11 additions and 9 deletions

View File

@ -1478,6 +1478,7 @@ function get_udisks_key() {
devices=`udisks --enumerate-device-files | grep -v /dev/disk | sort -n -r`
for device in $devices; do
[ "$device:0:2" = "sd" -o "$device:0:2" = "hd" ] || continue
native_path=`get_udisks_key $device native-path`
[ -e $native_path/partition ] && continue
partscheme=`get_udisks_key $device scheme`

View File

@ -404,6 +404,16 @@ if [ "$INSTALL_DRIVER" ]; then
} || MKINITRAMFS_ADD=""
fi
# remove not-running installed kernel
RUNNING_KERNEL=`uname -r | sed "s|[0-9.]*||"`
for i in `ls $MOUNTPOINT/boot/vmlinuz-*`; do
INSTALLED_KERNEL=`echo ${i} | sed "s|.*/vmlinuz-[0-9.]*||"`
[ "$INSTALLED_KERNEL" = "$RUNNING_KERNEL" ] && continue
dcop_write $"Removing ""$INSTALLED_KERNEL kernel..." 74
echo $"Removing ""$INSTALLED_KERNEL kernel..."
chroot $MOUNTPOINT smart remove -y kernel-$INSTALLED_KERNEL
done
dcop_write $"Creating initramfs..." 75
echo $"Creating initramfs"
chroot $MOUNTPOINT \
@ -607,15 +617,6 @@ echo $"Removing/cleaning unnecessary files and packages"
rpm -r $MOUNTPOINT -e livecd-tools
[ "$INSTALL_STABLE_UPDATES" = "1" ] && rpm -r $MOUNTPOINT -e openmamba-devel 2>/dev/null
# remove not-running installed kernel
RUNNING_KERNEL=`uname -r`
for i in `ls $MOUNTPOINT/boot/vmlinuz-*`; do
INSTALLED_KERNEL=${i/*-}
[ "$INSTALLED_KERNEL" = "$RUNNING_KERNEL" ] && continue
chroot $MOUNTPOINT smart remove kernel-$INSTALLED_KERNEL
rm -f $MOUNTPOINT/boot/initramfs-$INSTALLED_KERNEL.img*
done
sed -i /eject_cd.sh/d $MOUNTPOINT/etc/rc0.d/K99halt
sed -i /eject_cd.sh/d $MOUNTPOINT/etc/rc6.d/K99reboot