[OmniOS-discuss] Fix for no UUID in Kayak-installed BE?

Peter Tribble peter.tribble at gmail.com
Fri May 26 10:02:31 UTC 2017


On Wed, May 24, 2017 at 6:00 PM, Dan McDonald <danmcd at kebe.com> wrote:

> Given the "uuidgen" binary has WAY too many libraries, and the uniqueness
> of the UUID doesn't need to be super-special for the installed BE, I put
> together this patch using the existing miniroot tools:
>
>
> diff --git a/install_help.sh b/install_help.sh
> index 7ad5ab1..7095536 100644
> --- a/install_help.sh
> +++ b/install_help.sh
> @@ -115,6 +115,11 @@ BuildBE() {
>    $GRAB $MEDIA | pv -B 128m -w 78 | $DECOMP | zfs receive -u
> $RPOOL/ROOT/omnios
>    zfs set canmount=noauto $RPOOL/ROOT/omnios
>    zfs set mountpoint=legacy $RPOOL/ROOT/omnios
> +  # Generate UUID for BE using existing tools...
> +  prtconf -v | md5sum | awk '{print $1}' > /tmp/bits
> +  echo "`cut -b1-8 < /tmp/bits`-`cut -b9-12 < /tmp/bits`-`cut -b13-16 <
> /tmp/bits`-`cut -b17-20 < /tmp/bits`-`cut -b21-32 < /tmp/bits`" > /tmp/uuid
> +  zfs set org.opensolaris.libbe:uuid=`cat /tmp/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
>
>
> I initially tested by invoking the prtconf & echo commands, to make sure
> the resultant UUID looked correct.  I am spinning a bloody ISO as I type
> this to try and make sure it ACTUALLY works.
>

ptrconf -v isn't terribly random - it looks like you get a fairly small set.

My version (lifted from Tribblix) would look like

head -c 32 /dev/urandom | md5sum | awk '{print $1}' > /tmp/bits
echo "`cut -b1-8 < /tmp/bits`-`cut -b9-12 < /tmp/bits`-5`cut -b14-16 <
/tmp/bits`-9`cut -b18-20 < /tmp/bits`-`cut -b21-32 < /tmp/bits`" > /tmp/uuid

-- 
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://omniosce.org/ml-archive/attachments/20170526/45d6462d/attachment.html>


More information about the OmniOS-discuss mailing list