diff -Nru /tmp/Y9xNZQPkD3/base-installer-1.15ubuntu6/debian/changelog /tmp/u5g1Y4t35g/base-installer-1.15ubuntu7/debian/changelog --- /tmp/Y9xNZQPkD3/base-installer-1.15ubuntu6/debian/changelog 2005-03-08 14:37:31.000000000 +0000 +++ /tmp/u5g1Y4t35g/base-installer-1.15ubuntu7/debian/changelog 2005-03-09 03:23:46.000000000 +0000 @@ -1,3 +1,10 @@ +base-installer (1.15ubuntu7) hoary; urgency=low + + * Work out the largest swap partition, if any, and use its devfs-mapped + name as the value of RESUME= in /etc/mkinitrd/mkinitrd.conf. + + -- Colin Watson Wed, 9 Mar 2005 03:23:45 +0000 + base-installer (1.15ubuntu6) hoary; urgency=low * Fix syntax error in configure_apt. diff -Nru /tmp/Y9xNZQPkD3/base-installer-1.15ubuntu6/debian/postinst /tmp/u5g1Y4t35g/base-installer-1.15ubuntu7/debian/postinst --- /tmp/Y9xNZQPkD3/base-installer-1.15ubuntu6/debian/postinst 2005-03-08 14:35:29.000000000 +0000 +++ /tmp/u5g1Y4t35g/base-installer-1.15ubuntu7/debian/postinst 2005-03-09 03:23:43.000000000 +0000 @@ -432,6 +432,16 @@ db_set base-installer/kernel/image "$KERNEL" } +get_resume_partition () { + maxsize=0 + tail -n +2 /proc/swaps | while read file t size rest; do + if [ "$size" -ge "$maxsize" ]; then + echo "$file" + maxsize="$size" + fi + done | tail -n 1 +} + install_kernel () { if db_get "base-installer/kernel/linux/initrd-$KERNEL_MAJOR" ; then if [ "$RET" = true ]; then @@ -493,6 +503,13 @@ rootpartfs=$(mount | grep "on /target " | cut -d' ' -f5) rootpart=$(mapdevfs $rootpart_devfs) + resume_devfs="$(get_resume_partition)" || resume_devfs= + if [ "$resume_devfs" ] && [ -e "$resume_devfs" ]; then + resume="$(mapdevfs "$resume_devfs")" + else + resume= + fi + # Avoid possible root shell without giving passord while # booting the 2.4 kernel # This is here for back-compatability with woody's @@ -501,9 +518,16 @@ if [ -f $mkinitrdconf ] ; then sed -e 's/^DELAY=.*/DELAY=0/' -e "s#^ROOT=.*#ROOT='$rootpart $rootpartfs'#" < $mkinitrdconf > $mkinitrdconf.new && mv $mkinitrdconf.new $mkinitrdconf + if [ "$resume" ]; then + sed -e "s@^#* *RESUME=.*@RESUME=$resume@" < $mkinitrdconf > $mkinitrdconf.new && + mv $mkinitrdconf.new $mkinitrdconf + fi else echo 'DELAY=0' >> $mkinitrdconf echo "ROOT='$rootpart $rootpartfs'" >> $mkinitrdconf + if [ "$resume" ]; then + echo "RESUME=$resume" >> $mkinitrdconf + fi fi else info "Not installing initrd-tools."