From owner-freebsd-rc@FreeBSD.ORG Thu Jun 27 16:59:35 2013 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AA1E4BDD; Thu, 27 Jun 2013 16:59:35 +0000 (UTC) (envelope-from crees@bayofrum.net) Received: from mk-outboundfilter-1.mail.uk.tiscali.com (mk-outboundfilter-1.mail.uk.tiscali.com [212.74.114.37]) by mx1.freebsd.org (Postfix) with ESMTP id 6A6FF125D; Thu, 27 Jun 2013 16:59:34 +0000 (UTC) X-Trace: 734424731/mk-outboundfilter-1.mail.uk.tiscali.com/PIPEX/$ON_NET_AUTH_ACCEPTED/Talk_Talk_Customer/2.102.6.254/None/crees@bayofrum.net X-SBRS: None X-RemoteIP: 2.102.6.254 X-IP-MAIL-FROM: crees@bayofrum.net X-SMTP-AUTH: bayofrum@uwclub.net X-MUA: Apple Mail (2.1085) X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnIGAC5uzFECZgb+/2dsb2JhbABbgwnABX8XdIIjAQEEAScTHCMFCwsOODkeBhOICAq7II9VB4MCYwOdU4s3gxI7 X-IronPort-AV: E=Sophos;i="4.87,953,1363132800"; d="scan'208";a="734424731" X-IP-Direction: OUT Received: from host-2-102-6-254.as13285.net (HELO pegasus.bayofrum.net) ([2.102.6.254]) by smtp.pipex.tiscali.co.uk with ESMTP; 27 Jun 2013 17:59:32 +0100 Received: from zeus.bayofrum.net (zeus.bayofrum.net [192.168.1.151]) by pegasus.bayofrum.net (Postfix) with ESMTPA id EB0CD2B406; Thu, 27 Jun 2013 17:57:42 +0100 (BST) References: <20130623.035356.644417021040610458.hrs@allbsd.org> <20130624.032458.2116947740119973135.hrs@allbsd.org> <20130627.170642.243849725172853011.hrs@allbsd.org> In-Reply-To: <20130627.170642.243849725172853011.hrs@allbsd.org> Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii Message-Id: <3F225AB1-8111-4841-97D7-0B525F9CC96C@bayofrum.net> Content-Transfer-Encoding: 7bit From: Chris Rees Subject: Re: RFC: swapon(8) vnode-backed md and gbde/geli encryption support Date: Thu, 27 Jun 2013 17:57:43 +0100 To: Hiroki Sato X-Mailer: Apple Mail (2.1085) X-bayofrum-MailScanner-Information: Please contact the ISP for more information X-bayofrum-MailScanner-ID: EB0CD2B406.ACE3B X-bayofrum-MailScanner: Found to be clean X-bayofrum-MailScanner-From: crees@bayofrum.net X-Spam-Status: No Cc: swhetzel@gmail.com, freebsd-current@FreeBSD.org, freebsd-rc@FreeBSD.org, wblock@FreeBSD.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2013 16:59:35 -0000 On 27 Jun 2013, at 09:06, Hiroki Sato wrote: > Hiroki Sato wrote > in <20130623.035356.644417021040610458.hrs@allbsd.org>: > > hr> Hi, > hr> > hr> I created a patchset to add support of automatic generation of > hr> vnode-backed md(4) devices and gbde/geli geom providers to swapon(8) > hr> via /etc/fstab. We already have equivalent functionality by using > hr> rc.d scripts. This simplifies rc.d scripts and fixes a race between > hr> mdconfig/gbde/geli and swapon/swapoff by using /etc/fstab. > > A slightly revised patch is attached. I will commit this today. > > -- Hiroki > - Add vnode-backed swap space specification support. This is enabled when > device names "md" or "md[0-9]*" and a "file" option are specified in > /etc/fstab like this: > > md none swap sw,file=/swap.bin 0 0 > > - Add GBDE/GELI encrypted swap space specification support, which > rc.d/encswap supported. The /etc/fstab lines are like the following: > > /dev/ada1p1.bde none swap sw 0 0 > /dev/ada1p2.eli none swap sw 0 0 > > .eli devices accepts aalgo, ealgo, keylen, and sectorsize as options. > > swapctl(8) can understand an encrypted device in the command line > like this: > > # swapctl -a /dev/ada2p1.bde > > - "-L" flag is added to support "late" option to defer swapon until > rc.d/mountlate runs. > > - rc.d script change: > > rc.d/encswap -> removed > rc.d/addswap -> just display a warning message if is defined. > rc.d/swap1 -> renamed to rc.d/swap > rc.d/swaplate -> newly added to support "late" option > > These changes alleviate a race condition between device creation/removal > and swapon/swapoff. > > MFC after: 1 week Looks fantastic-- better than hacking around in shell scripts I suppose :) Chris -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.