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

Bug#738922: [PATCH 1/3] Remove use of parted for swap create/check



Use mkswap to create and there is no such thing as checking
swap, so remove it.
---
 check.d/check_swap   | 22 ----------------------
 commit.d/format_swap | 27 ++++++++++-----------------
 debian/changelog     |  8 ++++++++
 3 files changed, 18 insertions(+), 39 deletions(-)

diff --git a/check.d/check_swap b/check.d/check_swap
index 12f9a42..c9e3e2b 100755
--- a/check.d/check_swap
+++ b/check.d/check_swap
@@ -23,28 +23,6 @@ for dev in $DEVICES/*; do
 		if [ "$method" = swap ]; then
 			swap=:
 		fi
-		[ ! -f $id/format ] || continue
-		if [ "$method" = swap ]; then
-			log "Check the swap space in $dev/$id"
-			template=partman-basicfilesystems/progress_swap_checking
-			db_subst $template PARTITION "$num"
-			db_subst $template DEVICE $(humandev $(cat device))
-			name_progress_bar $template
-			open_dialog CHECK_FILE_SYSTEM $id
-			read_line status
-			close_dialog
-			if [ "$status" != good ]; then
-				db_subst partman-basicfilesystems/swap_check_failed PARTITION "$num"
-				db_subst partman-basicfilesystems/swap_check_failed DEVICE $(humandev $(cat device))
-				db_set partman-basicfilesystems/swap_check_failed true
-				db_input critical partman-basicfilesystems/swap_check_failed || true
-				db_go || true
-				db_get partman-basicfilesystems/swap_check_failed
-				if [ "$RET" = true ]; then
-					exit 1
-				fi
-			fi
-		fi
 	done
 done
 
diff --git a/commit.d/format_swap b/commit.d/format_swap
index cdf0589..e2dc4b0 100755
--- a/commit.d/format_swap
+++ b/commit.d/format_swap
@@ -30,24 +30,17 @@ for dev in $DEVICES/*; do
 			close_dialog
 			db_subst $template PARTITION "$num"
 			db_subst $template DEVICE $(humandev $(cat device))
-			name_progress_bar $template
-			open_dialog CREATE_FILE_SYSTEM $id linux-swap
-			read_line status
-			close_dialog
-			sync
-			if [ "$status" != OK ]; then
-				db_progress START 0 3 partman/text/formatting
-				db_progress INFO $template
-				db_progress SET 1
-				if log-output -t partman --pass-stdout \
-				   mkswap $device >/dev/null; then
-					sync
-					status=OK
-				else
-					status=failed
-				fi
-				db_progress STOP
+			db_progress START 0 3 partman/text/formatting
+			db_progress INFO $template
+			db_progress SET 1
+			if log-output -t partman --pass-stdout \
+			   mkswap $device >/dev/null; then
+				sync
+				status=OK
+			else
+				status=failed
 			fi
+			db_progress STOP
 
 			if [ "$status" != OK ]; then
 				db_subst partman-basicfilesystems/create_swap_failed TYPE linux-swap
diff --git a/debian/changelog b/debian/changelog
index 7d67b7c..be32c03 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+partman-basicfilesystems (91) UNRELEASED; urgency=low
+
+  * Use only mkswap instead of parted to format swap, since this is no
+    longer supported in parted3.
+  * Remove check_swap, as there is no such thing as fscking swap
+
+ -- Phillip Susi <psusi@ubuntu.com>  Wed, 12 Feb 2014 15:56:24 -0500
+
 partman-basicfilesystems (90) unstable; urgency=low
 
   [ Updated translations ]
-- 
1.8.3.2


Reply to: