9636 loader: colon is not supported in zfs dataset name

Review Request #1123 - Created July 1, 2018 and updated

Toomas Soome

Also fix beadm support words to allow colon in dataset name.

used be name "test:01".

Yuri Pankov

As reading the forth code makes me feel dizzy, what happens if you have several colons in the dataset name?

  1. Since we have string presented by <addr len> pair, and to detect if we have device name, we only need to test last char in the name (as device name is always ending with colon). So we have stack (addr len), we duplicate this pair, add len to address and fetch a char from the resulting address and then check if this char is colon:

    2dup + c@ [char] : <>

    This also means that we really do not care what is inside the dataset name, except for the last char.

    ok beadm list
    BE          Type    Device
    FreeBSD     chain   disk2p1:/efi/boot/bootx64.efi
    uefi-196    bootfs  rpool/ROOT/uefi-196
    uefi-197    bootfs  rpool/ROOT/uefi-197
    uefi-198    bootfs  rpool/ROOT/uefi-198
    uefi-199    bootfs  rpool/ROOT/uefi-199
    uefi-200    bootfs  rpool/ROOT/uefi-200
    uefi-201    bootfs  rpool/ROOT/uefi-201
    uefi-202    bootfs  rpool/ROOT/uefi-202
    test:01     bootfs  rpool/ROOT/test:01
    test:01-1   bootfs  rpool/ROOT/test:01-1
    test:01-1:0 bootfs  rpool/ROOT/test:01-1:0
    Current boot device: zfs:rpool/ROOT/uefi-202:
    ok beadm activate test:01-1:0 
    Loading /boot/defaults/loader.conf 
    Loading unix...
    Loading /platform/i86pc/amd64/boot_archive...
    Loading /platform/i86pc/amd64/boot_archive.hash...
    Current boot device: zfs:rpool/ROOT/test:01-1:0:
  2. Thank you!

Yuri Pankov
Ship It!
Andy Fiddaman
Ship It!