add support for the swapencrypted facter value

This commit is contained in:
robert 2013-01-17 19:14:52 +00:00
parent 4ef0883cae
commit bc93dc58c8
2 changed files with 22 additions and 5 deletions

View File

@ -1,10 +1,12 @@
# $OpenBSD: Makefile,v 1.26 2013/01/14 17:45:36 robert Exp $
# $OpenBSD: Makefile,v 1.27 2013/01/17 19:14:52 robert Exp $
SHARED_ONLY= Yes
COMMENT= Ruby library for retrieving facts from operating systems
VERSION= 1.6.17
REVISION= 0
DISTNAME= facter-${VERSION}
PKGNAME= ruby-${DISTNAME}
CATEGORIES= sysutils

View File

@ -1,7 +1,22 @@
$OpenBSD: patch-lib_facter_memory_rb,v 1.3 2012/05/05 19:29:49 robert Exp $
--- lib/facter/memory.rb.orig Sat May 5 21:25:21 2012
+++ lib/facter/memory.rb Sat May 5 21:25:35 2012
@@ -93,7 +93,7 @@ if Facter.value(:kernel) == "AIX" and Facter.value(:id
$OpenBSD: patch-lib_facter_memory_rb,v 1.4 2013/01/17 19:14:52 robert Exp $
--- lib/facter/memory.rb.orig Thu Dec 27 19:05:12 2012
+++ lib/facter/memory.rb Thu Jan 17 20:06:09 2013
@@ -58,6 +58,14 @@ Facter.add("SwapFree") do
end
Facter.add("SwapEncrypted") do
+ confine :kernel => :OpenBSD
+ setcode do
+ encrypted = !Facter::Util::Resolution.exec("/sbin/sysctl -n hw.pagesize").to_i.zero?
+ encrypted
+ end
+end
+
+Facter.add("SwapEncrypted") do
confine :kernel => :Darwin
setcode do
swap = Facter::Util::Resolution.exec('sysctl vm.swapusage')
@@ -93,7 +101,7 @@ if Facter.value(:kernel) == "AIX" and Facter.value(:id
end
if Facter.value(:kernel) == "OpenBSD"