From a24ad686cd629bee0dcf5cc6e5c1f4da65ca1159 Mon Sep 17 00:00:00 2001
From: Roman Kyrylych <roman@archlinux.org>
Date: Sun, 2 Aug 2009 21:04:48 +0300
Subject: [PATCH] Fixed warning about bootbits with encrypted swap and util-linux-ng 2.16

Afte update to util-linux-ng the following message is shown during boot:
mkswap: /dev/mapper/swap: Warning: don't erase bootbits sectors on
whole disk. Use -f to force.

The change was introduced by this commit:
http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=commit;h=ff3bed806863d1c2075d0efda70b39ea6af9ecba

From man mkswap:
   -f     Force - go ahead even if the command is stupid.  This allows the
          creation of a swap area larger than the  file  or  partition  it
          resides on.

          Without  this option mkswap will refuse to erase the first block
          on a device with a  partition  table  or  on  whole  disk  (e.g.
          /dec/sda).

This change adds -f to mkswap in rc.sysinit to eliminate the warning.

Signed-off-by: Roman Kyrylych <roman@archlinux.org>
---
 rc.sysinit |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/rc.sysinit b/rc.sysinit
index 160f70e..8ec6ec6 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -180,7 +180,7 @@ if [ -f /etc/crypttab -a -n "$(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$)"
 					$CS -d /dev/urandom $copts create $cname $csrc >/dev/null
 					if [ $? -eq 0 ]; then
 						stat_append "creating swapspace.."
-						/sbin/mkswap -L $cname /dev/mapper/$cname >/dev/null
+						/sbin/mkswap -f -L $cname /dev/mapper/$cname >/dev/null
 					fi
 				fi
 			elif [ "${cpass}" = "ASK" ]; then
-- 
1.6.4

