summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdinstall/scripts
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2013-10-11 20:28:30 +0000
committerdes <des@FreeBSD.org>2013-10-11 20:28:30 +0000
commit0a01cb310b8b31bbeba6c1846d20b7f8a46c810f (patch)
tree3aa44c9a295225d504c33e31e265188dd77c6c58 /usr.sbin/bsdinstall/scripts
parenta5887bef7be52a549e5ba37139605164cac63e08 (diff)
downloadFreeBSD-src-0a01cb310b8b31bbeba6c1846d20b7f8a46c810f.zip
FreeBSD-src-0a01cb310b8b31bbeba6c1846d20b7f8a46c810f.tar.gz
MFH (r256338): store some entropy after installation
Approved by: re (gjb)
Diffstat (limited to 'usr.sbin/bsdinstall/scripts')
-rw-r--r--usr.sbin/bsdinstall/scripts/Makefile6
-rwxr-xr-xusr.sbin/bsdinstall/scripts/auto3
-rw-r--r--usr.sbin/bsdinstall/scripts/entropy29
-rwxr-xr-xusr.sbin/bsdinstall/scripts/jail2
-rwxr-xr-xusr.sbin/bsdinstall/scripts/script1
5 files changed, 38 insertions, 3 deletions
diff --git a/usr.sbin/bsdinstall/scripts/Makefile b/usr.sbin/bsdinstall/scripts/Makefile
index bcfafc0..8429e37 100644
--- a/usr.sbin/bsdinstall/scripts/Makefile
+++ b/usr.sbin/bsdinstall/scripts/Makefile
@@ -1,8 +1,8 @@
# $FreeBSD$
-SCRIPTS= auto adduser checksum config docsinstall hostname jail keymap \
- mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 rootpass \
- script services time umount wlanconfig
+SCRIPTS= auto adduser checksum config docsinstall entropy hostname jail \
+ keymap mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 \
+ rootpass script services time umount wlanconfig
BINDIR= /usr/libexec/bsdinstall
NO_MAN= true
diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto
index fe4e041..a609e06 100755
--- a/usr.sbin/bsdinstall/scripts/auto
+++ b/usr.sbin/bsdinstall/scripts/auto
@@ -222,5 +222,8 @@ if [ $? -eq 0 ]; then
chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1
fi
+bsdinstall entropy
+bsdinstall umount
+
echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG
diff --git a/usr.sbin/bsdinstall/scripts/entropy b/usr.sbin/bsdinstall/scripts/entropy
new file mode 100644
index 0000000..add6f30
--- /dev/null
+++ b/usr.sbin/bsdinstall/scripts/entropy
@@ -0,0 +1,29 @@
+#!/bin/sh
+#-
+# Copyright (c) 2013 Dag-Erling Smørgrav
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
+dd if=/dev/random of=$BSDINSTALL_CHROOT/entropy bs=4096 count=1
diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail
index 78fd4c8..af7a00e 100755
--- a/usr.sbin/bsdinstall/scripts/jail
+++ b/usr.sbin/bsdinstall/scripts/jail
@@ -110,5 +110,7 @@ bsdinstall config || error
cp /etc/resolv.conf $1/etc
cp /etc/localtime $1/etc
+bsdinstall entropy
+
echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG
diff --git a/usr.sbin/bsdinstall/scripts/script b/usr.sbin/bsdinstall/scripts/script
index 58ae6e9..244f345 100755
--- a/usr.sbin/bsdinstall/scripts/script
+++ b/usr.sbin/bsdinstall/scripts/script
@@ -83,6 +83,7 @@ if [ -f /tmp/bsdinstall-installscript-ab ]; then
rm $BSDINSTALL_CHROOT/tmp/installscript
fi
+bsdinstall entropy
bsdinstall umount
echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG
OpenPOWER on IntegriCloud