[Lunar-commits] r23650 - in lunar-iso/trunk: lunar-install/sbin scripts

Auke Kok sofar at lunar-linux.org
Thu Mar 15 23:43:12 CET 2007


Author: sofar
Date: 2007-03-15 23:43:12 +0100 (Thu, 15 Mar 2007)
New Revision: 23650

Modified:
   lunar-iso/trunk/lunar-install/sbin/lunar-install
   lunar-iso/trunk/scripts/kernels
Log:
New style preinstalled kernels pack a 'stripped' kernel source folder that
you can directly compile kernel modules against. This removes the need
for a special stage that installs kernel sources that didn't work anyway.
You can even work with multiple different preinstalled kernels and add
drivers to them.


Modified: lunar-iso/trunk/lunar-install/sbin/lunar-install
===================================================================
--- lunar-iso/trunk/lunar-install/sbin/lunar-install	2007-03-15 21:40:56 UTC (rev 23649)
+++ lunar-iso/trunk/lunar-install/sbin/lunar-install	2007-03-15 22:43:12 UTC (rev 23650)
@@ -1022,7 +1022,7 @@
 		# calculate the total so we can display progress
 		NUM=$(wc -l /.packages | awk '{print $1}')
 		# add the number of times we call percent_msg, subtract 2 for lilo/grub
-		(( NUM = NUM + 11 - 2 ))
+		(( NUM = NUM + 10 - 2 ))
 
 		cd $TARGET
 
@@ -1098,22 +1098,6 @@
 			percent_msg "Running ldconfig"
 			chroot_run ldconfig
 
-			# unpack a kernel source and preconfigure ir
-			percent_msg "Extracting kernel sources..."
-			(
-				if is_26 ; then
-					chroot_run lsh eval 'SILENT=y ; run_details linux-2.6 ; run_pre_build'
-					chroot_run cp /proc/config.gz /usr/src/linux/
-					chroot_run gunzip /usr/src/linux/config.gz
-					chroot_run mv /usr/src/linux/config /usr/src/linux/.config
-				else
-					chroot_run lsh eval 'SILENT=y ; run_details linux-2.4 ; run_pre_build'
-				fi
-				chroot_run make -C /usr/src/linux oldconfig
-				chroot_run make -C /usr/src/linux prepare
-				chroot_run make -C /usr/src/linux _modinst_
-			) > /dev/null
-
 			# pass through some of the configuration at this point:
 			percent_msg "Finishing up installation"
 			[ -z "$KEYMAP" ] || echo "$KEYMAP" > $TARGET/etc/keymap

Modified: lunar-iso/trunk/scripts/kernels
===================================================================
--- lunar-iso/trunk/scripts/kernels	2007-03-15 21:40:56 UTC (rev 23649)
+++ lunar-iso/trunk/scripts/kernels	2007-03-15 22:43:12 UTC (rev 23650)
@@ -96,7 +96,7 @@
 	fi &&
 	make ${ISO_MAKES:+-j$ISO_MAKES} bzImage &&
 	make ${ISO_MAKES:+-j$ISO_MAKES} modules &&
-	mkdir -p $ISO_SOURCE/kernels/{TAR,BUILD,BUILD/boot} &&
+	mkdir -p $ISO_SOURCE/kernels/{TAR,BUILD,BUILD/boot,BUILD/usr/src} &&
 	make INSTALL_MOD_PATH=$ISO_SOURCE/kernels/BUILD modules_install &&
 	if [ -n "$2" ]; then
 		# we need them on the iso later too
@@ -105,17 +105,28 @@
 		cp arch/$ISO_KARCH/boot/bzImage $ISO_SOURCE/kernels/$2 &&
 		cp System.map $ISO_SOURCE/kernels/$2.map || exit 1
 	fi
+	# copy stuff needed to boot kernel
 	cp arch/$ISO_KARCH/boot/bzImage $ISO_SOURCE/kernels/BUILD/boot/$VERSION$1 &&
 	cp System.map $ISO_SOURCE/kernels/BUILD/boot/System.map-$VERSION$1 &&
 	cp .config $ISO_SOURCE/kernels/BUILD/boot/config-$VERSION$1 &&
 	gzip $ISO_SOURCE/kernels/BUILD/boot/config-$VERSION$1 &&
-	# cp -aL $ISO_SOURCE/kernels/linux-$VERSION/include/asm $ISO_SOURCE/kernels/BUILD/usr/include/linux-$VERSION$1/asm
-	# cp -aL $ISO_SOURCE/kernels/linux-$VERSION/include/linux $ISO_SOURCE/kernels/BUILD/usr/include/linux-$VERSION$1/linux
+	# copy the stripped source tree over
+	mkdir -p $ISO_SOURCE/kernels/BUILD/usr/src/linux-$VERSION$1
+	(
+		find ./.config
+		find ./Module.symvers
+		find ./ -name 'Makefile*' -o -name 'Kconfig*'
+		find ./scripts
+		find ./include
+	) | tar c --files-from - -O | (
+		cd $ISO_SOURCE/kernels/BUILD/usr/src/linux-$VERSION$1
+		tar xf -
+	)
 	cd $ISO_SOURCE/kernels/BUILD &&
 	rm -f lib/modules/$VERSION$1/{build,source} &&
-	ln -sf /usr/src/linux-$VERSION lib/modules/$VERSION$1/build &&
-	ln -sf /usr/src/linux-$VERSION lib/modules/$VERSION$1/source &&
-	tar cjf $ISO_SOURCE/kernels/TAR/$VERSION$1.tar.bz2 boot/ lib/ &&
+	ln -sf /usr/src/linux-$VERSION$1 lib/modules/$VERSION$1/build &&
+	ln -sf /usr/src/linux-$VERSION$1 lib/modules/$VERSION$1/source &&
+	tar cjf $ISO_SOURCE/kernels/TAR/$VERSION$1.tar.bz2 boot/ lib/ usr/ &&
 	cd $ISO_SOURCE/kernels &&
 	rm -rf $ISO_SOURCE/kernels/BUILD &&
 	rm -rf $ISO_SOURCE/kernels/linux-$VERSION || exit 1



More information about the Lunar-commits mailing list