[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SATA install - AMD64 - success story



On Thu, Jul 28, 2005 at 10:22:41AM -0400, Joey Hess wrote:
> Lennart Sorensen wrote:
> > I have now fixed base-installer-udeb to support linux-image instead of
> > kernel-image.
> 
> Would you like to contribute that patch back to the list? After all,
> we're in exactly the same spot you were in, the linux-2.6 kernel is in the
> archive and we need to get d-i to use it.

Ehm, sure.  I just assumed it had been fixed in a newer version already
and I was just doing it in the sarge released version.

I don't consider it a very clean patch, and certainly not complete (only
amd64 was handled so far although extending it would be trivial).

Here is a patch of what I changed in base-installer-udeb:

diff -ruN base-installer-1.13.4/debian/postinst base-installer-1.13.4.linux-image/debian/postinst
--- base-installer-1.13.4/debian/postinst	2005-03-01 15:20:32.000000000 +0000
+++ base-installer-1.13.4.linux-image/debian/postinst	2005-07-26 20:59:41.000000000 +0000
@@ -297,7 +297,7 @@
 
 kernel_update_list () {
 	# Using 'uniq' to avoid listing the same kernel more then once.
-	chroot /target apt-cache search kernel-image | grep ^kernel-image | \
+	chroot /target apt-cache search linux-image | grep ^linux-image | \
 	cut -d" " -f1 | uniq > $KERNEL_LIST
 }
 
@@ -384,20 +384,20 @@
 		case "$VENDOR" in
 		" AuthenticAMD"*)
 			if test "$SMP" = no; then
-				trykernel=kernel-image-$version-amd64-k8
+				trykernel=linux-image-$version-amd64-k8
 			else
-				trykernel=kernel-image-$version-amd64-k8-smp
+				trykernel=linux-image-$version-amd64-k8-smp
 			fi
 		;;
 		" GenuineIntel"*)
 			if test "$SMP" = no; then
-				trykernel=kernel-image-$version-em64t-p4
+				trykernel=linux-image-$version-em64t-p4
 			else
-				trykernel=kernel-image-$version-em64t-p4-smp
+				trykernel=linux-image-$version-em64t-p4-smp
 			fi
 		;;
 		*)
-			trykernel=kernel-image-$version-amd64-generic
+			trykernel=linux-image-$version-amd64-generic
 		;;
 		esac
 	;;
@@ -624,7 +624,7 @@
 			if [ "$KVERS" != "" ]; then
 				kernellist=`grep $arch_kernel $KERNEL_LIST | sort -r | tr '\n' ' '` 
 				for akernel in $kernellist; do
-					if [ "" != "`echo $akernel | grep '^kernel-image-'$KVERS`" ]; then
+					if [ "" != "`echo $akernel | grep '^linux-image-'$KVERS`" ]; then
 						KERNEL=$akernel
 						break
 					fi
@@ -653,7 +653,7 @@
 }
 
 install_kernel () {
-	kernel_major="$(echo "$KERNEL" | sed 's/^kernel-image-//; s/-.*//' | cut -d . -f 1,2)"
+	kernel_major="$(echo "$KERNEL" | sed 's/^linux-image-//; s/-.*//' | cut -d . -f 1,2)"
 	case $kernel_major in
 		2.?)	;;
 		*)
@@ -707,6 +707,9 @@
 link_in_boot = $link_in_boot
 EOF
 
+	# Hack to make sure module-init-tools are installed since linux-image-2.6.* doesn't depend on it but obviously requires it.
+	apt-install module-init-tools
+
 	if [ yes = "$do_initrd" ] ; then
 		info "Installing initrd-tools."
 
@@ -767,7 +770,7 @@
 }
 
 install_pcmcia_modules () {
-	pcmcia_package=$(echo "$KERNEL" | sed 's/^kernel-image/kernel-pcmcia-modules/')
+	pcmcia_package=$(echo "$KERNEL" | sed 's/^linux-image/kernel-pcmcia-modules/')
 	info "Installing pcmcia modules package '$pcmcia_package'."
 	apt-install "$pcmcia_package" 2>> $LOGFILE || true
 }

As a note:
I didn't touch anything other than the AMD64 section.  Other
architectures will need similar fixes, and it would probably be nice to
be able to support both linux-image and kernel-image unless of course
linux-image will stay as the name in the future.  Of course 2.4 kernels
are still named kernel-image-... as far as I can tell.

The hack to deal with module-init-tools is just ugly, but it works.  Not
sure why linux-image does NOT depend on it given it requires it to
install correctly.  Perhaps this should be a bug and filed as such.

Len Sorensen



Reply to: