Skip to content

Commit

Permalink
Use dialogue for more progress messages during installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus-it committed Mar 21, 2018
1 parent 0637065 commit 96c5bec
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions install_help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,22 @@ log() {
echo "[$TS] $*" 1>&4
echo "[$TS] $*"
}
slog() {
if [ -n "$USE_DIALOG" ]; then
echo "[$TS] $*" 1>&4
d_info "$@"
else
log "$@"
fi
}
bomb() {
log
log ======================================================
log "$*"
log ======================================================
if [[ -n "$INSTALL_LOG" ]]; then
log "For more information, check $INSTALL_LOG"
log ======================================================
log "For more information, check $INSTALL_LOG"
log ======================================================
fi
exit 1
}
Expand Down Expand Up @@ -113,7 +121,7 @@ BE_Receive_Image() {
local _bename="${4:?bename}"
local _media="${5:?media}"

log "Receiving image: $MEDIA"
slog "Preparing to install ZFS image"
pv="pv -B 128m"
[ "$_grab" = cat ] && pv+=" -s `ls -lh $_media | awk '{print $5}'`"

Expand All @@ -135,7 +143,7 @@ BE_Mount() {
local _root=${3:?root}
local _method${4:-beadm}

log "Mounting BE $_bename on $_root"
slog "Mounting BE $_bename on $_root"

if [ "$_method" = beadm ]; then
beadm mount $_bename $_root
Expand All @@ -150,7 +158,7 @@ BE_Umount() {
local _root=${2:?root}
local _method${3:-beadm}

log "Unmounting BE $_bename"
slog "Unmounting BE $_bename"
if [ "$_method" = beadm ]; then
beadm umount $_bename
else
Expand All @@ -166,15 +174,15 @@ BE_SetUUID() {
local uuid=`LD_LIBRARY_PATH=$_root/lib:$_root/usr/lib \
$_root/usr/bin/uuidgen`

log "Setting BE $_bename UUID: $uuid"
slog "Setting BE $_bename UUID: $uuid"
zfs set org.opensolaris.libbe:uuid=$uuid $_rpool/ROOT/$_bename
zfs set org.opensolaris.libbe:policy=static $_rpool/ROOT/$_bename
}

BE_SeedSMF() {
local _root=${1:?root}

log "Seeding SMF database"
slog "Seeding SMF database"
cp $_root/lib/svc/seed/global.db $_root/etc/svc/repository.db
chmod 0600 $_root/etc/svc/repository.db
chown root:sys $_root/etc/svc/repository.db
Expand Down Expand Up @@ -242,7 +250,7 @@ FetchConfig(){
MakeBootable(){
local _rpool=${1:-rpool}
local _bename=${2:-omnios}
log "Making boot environment bootable"
slog "Making boot environment bootable"
zpool set bootfs=$_rpool/ROOT/$_bename $_rpool
# Must do beadm activate first on the off chance we're bootstrapping from
# GRUB.
Expand Down

0 comments on commit 96c5bec

Please sign in to comment.