Skip to content

Commit 855c22f

Browse files
dannyzakennimrod-becker
authored andcommitted
generate entropy in background after setting ntp
1 parent febb4f8 commit 855c22f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/deploy/NVA_build/first_install_diaglog.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,23 @@ function configure_networking_dialog {
199199
fi
200200
done
201201
}
202+
203+
204+
function generate_entropy(){
205+
local path
206+
local pid=()
207+
echo "Generate entropy for /dev/random (openssl and such) for 5m"
208+
for path in $(find /dev/disk/by-uuid/ -type l )
209+
do
210+
md5sum ${path} &
211+
pid+=($!)
212+
done
213+
ps -ef | grep md5 | grep -v grep
214+
sleep 300
215+
echo "killing md5sum (pid: ${pid[@]})"
216+
kill -9 ${pid[@]} 2> /dev/null
217+
}
218+
202219
function configure_ntp_dialog {
203220
local ntp_server=$(grep "server.*NooBaa Configured" /etc/ntp.conf | sed 's:.*server \(.*\) iburst.*:\1:')
204221
local tz=$(ls -la /etc/localtime | sed 's:.*/usr/share/zoneinfo/\(.*\):\1:')
@@ -361,6 +378,7 @@ is a short first install wizard to help configure \n\Z5\ZbNooBaa\Zn to best suit
361378
}
362379

363380
function end_wizard {
381+
generate_entropy &
364382
local current_ip=$(ifconfig | grep -w 'inet' | grep -v 127.0.0.1 | awk '{print $2}' | head -n 1)
365383
dialog --colors --nocancel --backtitle "NooBaa First Install" --title '\Z5\ZbNooBaa\Zn is Ready' --msgbox "\n\Z5\ZbNooBaa\Zn was configured and is ready to use.\nYou can access \Z5\Zbhttp://${current_ip}:8080\Zn to start using your system." 7 72
366384
date | sudo tee -a ${FIRST_INSTALL_MARK}

0 commit comments

Comments
 (0)