6702 libbe should support x86 installboot command

Review Request #162 — Created March 1, 2016 and submitted

tsoome
illumos-gate
6702
general

6702 libbe should support x86 installboot command

root@uefi-oi:/home/tsoome# beadm activate -v uefi-139
be_do_installboot: device mirror-0
be_do_installboot: device c3t0d0
Command: "/usr/sbin/installboot -m -f //boot/pmbr //boot/gptzfsboot /dev/rdsk/c3t0d0s1"
Errors:
bootblock version installed on /dev/rdsk/c3t0d0s1 is more recent or identical
Use -F to override or install without the -u option
be_do_installboot: device c3t1d0
Command: "/usr/sbin/installboot -m -f //boot/pmbr //boot/gptzfsboot /dev/rdsk/c3t1d0s1"
Errors:
bootblock version installed on /dev/rdsk/c3t1d0s1 is more recent or identical
Use -F to override or install without the -u option
Activated successfully
root@uefi-oi:/home/tsoome#

  • 0
  • 0
  • 1
  • 2
  • 3
Description From Last Updated
yuripv
  1. 
      
  2. usr/src/lib/libbe/common/be_activate.c (Diff revision 1)
     
     
    Not your code, but wonder why is it needed? We are leaking the original memory pointed to by path.
    1. actually there is different bug. strdup() itself is needed as the code later will modify the path by inserting '\0', so that part is ok.
      it is also ok to assign like its done on line 910, because the path is initialized by nvlist_lookup_string() and that space is released by nvlist_free(), but the bug is at line 904, that free() must not be there.

    2. Oh ok, I'm always forgetting that.

  3. usr/src/lib/libbe/common/be_activate.c (Diff revision 1)
     
     

    Why not make it } else if ... and skip re-indentation?

    Or make it look like the block starting at line 934:

    if (be_is_isa("i386")) {
    if (be_has_grub()) {
    / grub /
    } else {
    / new loader /
    }
    } else if (be_is_isa("sparc")) {
    / sparc /
    } else {
    / unsupported /
    }

    1. I like the second option better, will keep the similar logic as used before and is reasonably clean approach.

  4. 
      
tsoome
yuripv
  1. Ship It!
  2. 
      
tsoome
richlowe
  1. 
      
  2. usr/src/lib/libbe/common/be_activate.c (Diff revision 3)
     
     

    I keep thinking I'd prefer this be else if (be_has_loader()) or whatever, to make things clearer, but I'm not really sure why

    1. I don't really have any brilliant ideas about it. Tbh, I would leave it as is right now, as it does the work to distinguish between two known case, if its not good enough, can always fix later:)

  3. usr/src/lib/libbe/common/be_activate.c (Diff revision 3)
     
     

    Is there really no better way to do that?

  4. 
      
tsoome
alhazred
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...