[OmniOS-discuss] GZ BE missing libbe:uuid property after Kayak installation --> breakage
Volker A. Brandt
vab at bb-c.de
Fri Jul 1 18:24:07 UTC 2016
Volker A. Brandt writes:
> Yes, the install_help.sh is definitely where it should go. I think it
> should be in the BuildBE() shell function somewhere after the "zfs set
> mountpoint" line. I'll try to come up with something.
Some nice people put a bash-only version of a UUID generator up on
serverfault. So here is a first stab:
--8<----------------------------------------------------------------8<--
*** install_help.sh.orig Thu Apr 14 18:29:37 2016
--- install_help.sh Fri Jul 1 20:22:16 2016
***************
*** 99,104 ****
--- 99,131 ----
sleep 1
}
+ # taken from https://gist.github.com/markusfisch/6110640
+ CreateUUID() {
+ local N B C='89ab'
+
+ for (( N=0; N < 16; ++N ))
+ do
+ B=$(( $RANDOM%256 ))
+
+ case $N in
+ 6)
+ printf '4%x' $(( B%16 ))
+ ;;
+ 8)
+ printf '%c%x' ${C:$RANDOM%${#C}:1} $(( B%16 ))
+ ;;
+ 3 | 5 | 7 | 9)
+ printf '%02x-' $B
+ ;;
+ *)
+ printf '%02x' $B
+ ;;
+ esac
+ done
+
+ echo
+ }
+
BuildBE() {
BOOTSRVA=`/sbin/dhcpinfo BootSrvA`
MEDIA=`getvar install_media`
***************
*** 112,117 ****
--- 139,148 ----
curl -s $MEDIA | pv -B 128m | bzip2 -dc | zfs receive -u rpool/ROOT/omnios
zfs set canmount=noauto rpool/ROOT/omnios
zfs set mountpoint=legacy rpool/ROOT/omnios
+ UUID=`CreateUUID`
+ log "Generated UUID $UUID for BE root dataset"
+ zfs set org.opensolaris.libbe:uuid=$UUID rpool/ROOT/omnios
+ zfs set org.opensolaris.libbe:policy=static rpool/ROOT/omnios
log "Cleaning up boot environment"
beadm mount omnios /mnt
ALTROOT=/mnt
***************
*** 225,231 ****
}
RunInstall(){
! FetchConfig || bomb "Could not fecth kayak config for target"
. $ICFILE
Postboot 'exit $SMF_EXIT_OK'
ApplyChanges || bomb "Could not apply all configuration changes"
--- 256,262 ----
}
RunInstall(){
! FetchConfig || bomb "Could not fetch kayak config for target"
. $ICFILE
Postboot 'exit $SMF_EXIT_OK'
ApplyChanges || bomb "Could not apply all configuration changes"
--8<----------------------------------------------------------------8<--
Sorry about the diff; my github-fu is currently zero. Also sorry
about fixing the ancient typo in RunInstall; could not resist.
I can't test this until I have a new box to install; feel free to play
with it or ignore me until I follow up with a "confirmed working" mail.
Regards -- Volker
--
------------------------------------------------------------------------
Volker A. Brandt Consulting and Support for Oracle Solaris
Brandt & Brandt Computer GmbH WWW: http://www.bb-c.de/
Am Wiesenpfad 6, 53340 Meckenheim, GERMANY Email: vab at bb-c.de
Handelsregister: Amtsgericht Bonn, HRB 10513 Schuhgröße: 46
Geschäftsführer: Rainer J.H. Brandt und Volker A. Brandt
"When logic and proportion have fallen sloppy dead"
More information about the OmniOS-discuss
mailing list