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

Re: Bug#49948: liloconfig makes bad lilo.conf when from scratch



Hi,

On Mon, 22 Nov 1999, Adam Di Carlo wrote:

> >> Yes -- it should exit out gracefully when fstab is missing
> >> or empty.
> 
> >You want lilo to exit  gracefully in case of /etc/fstab is missing?
> >Ok, that would fix your problem for the boot floppies, but it would be
> >broken for the "normal case", where lilo can't install and be configured
> >without fstab file.
> >Is there a way I can test whether liloconfig is executing in the initial
> >base2_2 dir so I can make a special case? (like create a
> >/tmp/no-fstab-ok-for-liloconfig empty file for example)
> 
> I dunno -- let me try to find some appropriate mechanism and let you
> know.
> 
> Boot-floppies folks, any ideas?

I've done a patch for lilo.postinst that addresses the problem.
It also stops liloconfig from being rerun on regular upgrades, so the
maintainer may not wish to incorporate all the changes.

Cheers,


Joost

--- lilo.postinst.orig	Tue Nov 23 18:43:33 1999
+++ lilo.postinst.new	Wed Nov 24 19:55:16 1999
@@ -9,7 +9,64 @@
 fi
 # End automatically added section
 
-[ x"configure" = x"$1" ] || exit 0
-echo "Running /usr/sbin/liloconfig"
+#
+# Handle the various ways in which dpkg may call this script:
+#
+case $1 in
+
+    configure)
+
+	last_configured_version=$2
+
+	if [ -z $last_configured_version ]
+	then
+	    #
+	    # No previous version of lilo has yet been configured before.
+	    # Configure this version now:
+	    # 
+	    if [ ! -s /etc/fstab ]
+	    then
+		#
+		# A special case: While the base system is still being 
+		# initially installed, /etc/fstab may not be present or
+		# incorrect.  In that case, skip liloconfig.
+		#
+		echo "Invalid /etc/fstab, skipping liloconfig."
+	    else
+		echo "Installing lilo for the first time;"
+		echo "Running /usr/sbin/liloconfig."
 echo 
 /usr/sbin/liloconfig
+	    fi
+	else
+	    #
+	    # State of the previous package was "configured".  Assume
+	    # that liloconfig does not need to run automatically.
+	    #
+	    echo "Since the previous version of lilo was installed"
+	    echo "successfully, I assume that it is not necessary to"
+	    echo "reinstall a bootblock."
+	    echo
+	    echo "You may still run /usr/sbin/liloconfig manually if"
+	    echo "you wish to alter the setup."
+	fi
+	;;
+
+    abort-upgrade)
+	;;
+
+    abort-remove)
+	;;
+
+    abort-deconfigure)
+	#
+	# maybe liloconfig should be run now.  If another bootloader
+	# tried to install, but failed - after changing a bootsector,
+	# the system might now be unbootable...
+	#
+	## /usr/sbin/liloconfig
+	;;
+esac
+
+
+


Reply to: