#657 PR merged: ebiso support added

Labels: enhancement

gozora opened issue at 2015-09-18 07:40:

Hello guys,
Yesterday, I've release a small tool called ebiso (https://github.com/gozora/ebiso), which is capable of creating bootable UEFI ISO image (basically just to cover gap on SLES11).

This patch integrates ebiso to rear, so maybe you can find it useful ...

I've did the testing on SLES11SP3 (with elilo) and Centos 6.7 (with GRUB).

Hope it helps.

Best regards

Vlado

schlomo commented at 2015-09-18 09:35:

Hi,

thanks - this is a very interesting thing. Could I kindly ask you to change a few things to be more ReaR-like?

  • Use $() instead of backticks
  • Create a function somewhere in lib/that will wrap your check if ebiso should be used? That we we need to change only one place in order to modify that detection code.
  • Improve the documentation to hint people with UEFI systems that they should install ebiso to get better results.
  • Add some info to default.conf to point out how to enable ebiso support.

Another thought: Maybe the code will be easier to maintain if you have a variable called for example ISO_USE_EBISO or something like that. IMHO the code would be more explicit that way and you could also fail properly if the user enables that feature but fails to install ebiso. It would also make it really simple to auto-enable ebiso if the tool is installed.

What do you think?

Kind Regards,
Schlomo

gozora commented at 2015-09-18 10:40:

Hello,

No problem adapting backticks ...

For the detection point, my idea was to manually set variable ISO_MKISOFS_BIN in /etc/rear (either local.conf or site.conf) to <path_to_ebiso>/ebiso to trigger its use. But maybe I've just misunderstood use of this variable ...
Separate variable sounds alluring, but I think it might interfere with existing ISO_MKISOFS_BIN.
However you know much better anatomy of ReaR than I do, so can do the implementation in whatever way you'd recommend.

I'll add some additional documentation directly to ebisio git site in couple of days (didn't had much time for it until now) and I can add information to rear docu as well.
Is it OK for you if I add information about ebiso to 05-integration.adoc?

Best regards

Vlado

schlomo commented at 2015-09-18 15:28:

I think the man page would be a good place. I did not find any good place in the adoc files. I think in Configuration it would fit better but I think that you can put it where you think it best.

About your other question: Looking at the code around UEFI_BOOTLOADER I find it very complex (meaning that by reading it I don't understand exactly what goes on there). That means that in any case I cannot really judge your change and would kindly ask @gdha to take a look and to take the final decision. He is much more EFI expert than me.

gozora commented at 2015-09-18 16:06:

man CONFIGURATION section looks reasonable , but first we should decide how to integrate ebiso ;-).

Just to summarize for @gdha, to activate current implementation of patch user needs manually specify in /etc/rear/site.conf or /etc/rear/local.conf:
ISO_MKISOFS_BIN=<path_to_ebiso>/ebiso

V.

gozora commented at 2015-09-18 16:25:

I guess you have following section on your mind:

if [[ $(basename ${UEFI_BOOTLOADER}) = "elilo.efi" ]]; then
      pushd $TMP_DIR/isofs/boot >&8
      $ISO_MKISOFS_BIN -o $ISO_DIR/$ISO_PREFIX.iso -e efiboot.img .
   else
      pushd $TMP_DIR/isofs >&8
      $ISO_MKISOFS_BIN -o $ISO_DIR/$ISO_PREFIX.iso -e boot/efiboot.img .
 fi

The idea behind is quite simple. By contrast to GRUB, elilo is not smart enough to find kernel and initrd outside ISO virtual volume, so in 25_polulate_efibootimg.sh, I've created one more copy of kernel and initrd inside $TMP_DIR/mnt/EFI/BOOT/ if elilo is used on system.
And root directory shift is done just to avoid copy "useless" data which are not used during ISO boot.

Hope it clarifies ...

V.

gozora commented at 2015-09-18 16:26:

That thing with back-ticks was already addressed by @schlomo.
I've already taken it into account ...

schlomo commented at 2015-09-18 16:29:

@gozora Thanks for the clarification. If this is just to optimize a few MB then I personally would rather optimize for code simplicity.

If elilo is "stupid" then I would - for the same reason of code simplicity - tend to setup the stupid directory structure and use that for both elilo and grub.

Just my 2ct of "code is written once and read many times" wisdom :-) Meaning that if that optimization is important for somebody (having a real-life use case for why those MB are worth to save), then of course we should save them.

gozora commented at 2015-09-18 16:36:

@schlomo actually that shifted ROOT dir save 50% of ISO size, as not shifting it would cause to have exact copy of initrd and kernel in two separate places in ISO.
But maybe I can adapt 80_create_isofs.sh to avoid coping of kernel/initrd if ebiso is used?
That would allow to have non shifted ROOT dir and save space as well.

gozora commented at 2015-09-18 16:40:

@gdha OK, man page will stay untouched for now, and I'll add some info to default.conf instead.
That fight around mkisofs/genisoimage is something that could be filmed in the future :-)

gozora commented at 2015-09-20 09:14:

Hope the patch it is better now!

gdha commented at 2015-09-21 13:48:

@gozora Looks very good - thanks.

gozora commented at 2015-09-21 13:49:

No problem ...


[Export of Github issue for rear/rear.]