[Lunar-commits] <lunar-iso> Correctly pass the kernel version to the installer

Peter de Ridder peter at lunar-linux.org
Thu Apr 25 22:08:56 CEST 2013


commit bb4b248a61f3705f302ee7f9b1e761aa0754240f
Author: Peter de Ridder <peter at lunar-linux.org>
Date: Thu, 25 Apr 2013 12:05:23 -0700
URL: https://github.com/lunar-linux/lunar-iso/commit/bb4b248a61f3705f302ee7f9b1e761aa0754240f

Correctly pass the kernel version to the installer
---
  lunar-install/sbin/lunar-install | +10/-6    
  mkfiles/kernel.mk                | +1/-1     
  2 files changed, 11 insertions(+), 7 deletions(-)

--- a/lunar-install/sbin/lunar-install
+++ b/lunar-install/sbin/lunar-install
@@ -1444,9 +1444,9 @@ install_kernels()
 		local LINE
 		while read LINE; do
 			echo $LINE | cut -d: -f1
-			echo $LINE | cut -d: -f2-
+			echo $LINE | cut -d: -f3-
 			# same text below - more space for longer description
-			echo $LINE | cut -d: -f2-
+			echo $LINE | cut -d: -f3-
 		done < $KERNEL_LIST
 	}
 
@@ -1491,20 +1491,24 @@ install_kernels()
 					cd $TARGET && tar xjf /var/cache/lunar/$CCOMMAND.tar.bz2
 					#ln -s /usr/src/linux-$CCOMMAND $TARGET/usr/src/linux
 
+					KVER=$(grep "^$CCOMMAND:" $KERNEL_LIST | cut -d: -f2)
+					KVER_PATCH=$(echo $KVER | cut -d . -f 3)
+					KVER_FULL=$(echo $KVER | cut -d . -f 1,2).${KVER_PATCH:-0}
+
 					# Register the kernel module as installed
 					if ! grep -q "^linux" $TARGET/var/state/lunar/packages; then
-						echo "linux:%DATE%:installed:$CCOMMAND:37000KB" >> $TARGET/var/state/lunar/packages
+						echo "linux:%DATE%:installed:$KVER:37000KB" >> $TARGET/var/state/lunar/packages
 					fi
 
 					# Generate kernel install log
-					tar -tf /var/cache/lunar/$CCOMMAND.tar.bz2 | sed '/^usr\/src/d;s:^:/:g' >> $TARGET/var/log/lunar/install/linux-${CCOMMAND} 2> /dev/null
+					#tar -tf /var/cache/lunar/$CCOMMAND.tar.bz2 | sed '/^usr\/src/d;s:^:/:g' >> $TARGET/var/log/lunar/install/linux-${CCOMMAND} 2> /dev/null
 
 					# Generate kernel md5sum log
-					cat $TARGET/var/log/lunar/install/linux-${CCOMMAND} | xargs -i md5sum {} >> $TARGET/var/log/lunar/md5sum/linux-${CCOMMAND} 2> /dev/null
+					#cat $TARGET/var/log/lunar/install/linux-${CCOMMAND} | xargs -i md5sum {} >> $TARGET/var/log/lunar/md5sum/linux-${CCOMMAND} 2> /dev/null
 
 					# let the plugin code handle the hard work
 					chroot_run depmod
-					chroot_run lsh update_bootloader $CCOMMAND ${CCOMMAND:0:15}
+					chroot_run lsh update_bootloader $KVER_FULL $KVER
 
 					msgbox "The precompiled kernel \"$CCOMMAND\" has been installed to your system."
 					if (( STEP == 8 )); then
--- a/mkfiles/kernel.mk
+++ b/mkfiles/kernel.mk
@@ -28,7 +28,7 @@ $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files: $(ISO_TARGET)/var/cache/l
 $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar.bz2: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files
 	@tar -rf $< -C $(ISO_TARGET) -T $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files
 	@rm $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files
-	@echo 'linux-$(ISO_ARCH):You have no choice' > $(ISO_TARGET)/var/cache/lunar/kernels
+	@echo "linux-$(ISO_ARCH):$$($(ISO_SOURCE)/scripts/chroot-build lvu installed linux):You have no choice" > $(ISO_TARGET)/var/cache/lunar/kernels
 	@bzip2 $<
 
 linux: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar.bz2




More information about the Lunar-commits mailing list