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

RFC/lenny: /lib/partman/check.d



(Sorry if this has come up before; I've got very behind on debian-boot.)

It's been annoying me for a while that partman only does its sanity
checks on your partitioning scheme after it commits changes. There's no
technical reason for this as far as I'm aware: I've read through the
code for all the sanity checks and I'm convinced that they almost all
look at the desired state as recorded in parted_server rather than the
state on disk. The only exception to this I've found so far is
aboot-installer, which does some dodgy stuff involving grepping parted's
human-readable output that I think could and should be done using the
GET_DISK_TYPE command to parted_server instead.

I think it would make partman a bit easier to use if we added a check.d
directory run before we ask the user to confirm changes and then run
commit.d (only when preparing to exit partman, not e.g. when committing
changes in order to configure LVM) and moved all the finish.d scripts
with numbers less than 20 there. Obviously this wouldn't be for etch
now, but would anyone object to this? The necessary partman-base patch
is trivial, and follows. Any check.d script exiting non-zero would
automatically return to manual partitioning.

--- partman-base.orig/partman	2006-12-12 14:06:58 +0000
+++ partman-base/partman	2007-02-20 14:57:16 +0000
@@ -88,8 +88,16 @@
 		fi
 		if [ $exitcode -eq 255 ]; then
 			abort 10 # back up to main menu
-		elif [ $exitcode -ge 100 ] && confirm_changes "partman"; then
-			break
+		elif [ $exitcode -ge 100 ]; then
+			for s in /lib/partman/check.d/*; do
+				if [ -x $s ]; then
+					#logger -t partman "Running check.d/$s"
+					$s || continue 2
+				fi
+			done
+			if confirm_changes "partman"; then
+				break
+			fi
 		fi
 		skip_choose_partition=no
 	done

Cheers,

-- 
Colin Watson                                       [cjwatson@debian.org]



Reply to: