#831 Issue closed: USB UEFI boot support

Labels: enhancement, fixed / solved / done

gozora opened issue at 2016-05-12 05:52:

Firs of all sorry for not using the template (not that I'd be a rebel or something ;-)), but this is rather a question about rear code.
After checking the issue #828 , I've thought about helping with UEFI USB boot support.

I've checked existing code for UEFI USB written by @gdha and realized that most of the work is already done. Only thing left is fill UEFI (FAT) partition with boot loader and create some fancy config for it.

For this reason I'd like to know your opinion on what is the best way to do this.

My initial question would be:
Where to put code for mounting the UEFI (FAT) partition?

In 10_mount_output_path.sh we have

...
mount_url $OUTPUT_URL $BUILD_DIR/outputfs $OUTPUT_OPTIONS
...

If I'm not wrong this mounts the main (non FAT) partition only.
Would it be OK for you add the code here?

jsmeix commented at 2016-05-12 07:37:

Offhandedly (i.e. without any thorough analysis right now)
I would prefer to implement all what is needed for that
particular functionality in one single block of code
(regardless if that block of code is added to an
existing script or added via a separated script).

For my generic reasoning why I would prefer it this way
remember how we both together achieved to greately simplify
and cleanup the code for creating an UEFI bootable iso image
during https://github.com/rear/rear/issues/810 and https://github.com/rear/rear/pull/816

Accordingly I suggest that you (at least as an initial
starting point) simply implement all what is needed
in one single block of code (or whatever else is easiest
for you to implement it). If that somehow does not work
or looks too ugly we could adapt it as needed later.

In the end I think that everybody first and foremost
greately appreciates your contribution to make
"rear format --efi" really working regardless
how exactly you implemented it.

jsmeix commented at 2016-05-12 07:41:

I assign that issue to me.
Regardless that I am not at all a UEFI expert
I will care about the issue to get it into rear
(just like https://github.com/rear/rear/pull/816).

gdha commented at 2016-05-12 07:50:

@gozora @jsmeix As far I can remember the rear format --efi works already (and is part of the format workflow). What is not yet done is as @gozora mentioned is adding boot code + and executables. New code (scripts) should be added to directory usr/share/rear/output/USB/Linux-i386/, but keep in mind that you will have 2 partitions now on the USB device (one vFAT and another ext3) - so you need to be careful where to copy where of course. And, extlinux is not required. Therefore, the current scripts could conflict with you want to achieve. This was also one of the reasons why I stopped. The effort became bigger then on the first impression.

gozora commented at 2016-05-12 08:05:

Yes, correct rear format --efi works as charm.
Yesterday I was able to manually construct UEFI bootable USB and successfully run restore. As @jsmeix mentioned I'll try to put together some code and create pull request for further discussion.

Thanks for your inputs so far!

jsmeix commented at 2016-05-13 07:39:

@gozora
many thanks for you valuable contribution https://github.com/rear/rear/pull/834

gozora commented at 2016-05-13 07:44:

No problem with that.
Can we keep this issue open until this part is done as a place where we can communicate?

jsmeix commented at 2016-05-13 08:38:

Yes, I will keep this issue here open
until we agree that it is done.

gozora commented at 2016-05-14 14:13:

So we should have now working USB EFI boot for elilo.
As always feel free to test and comment.

I'll try to put together support for both grub versions (0.97, 2.0) ...

gozora commented at 2016-05-15 19:51:

Now the commit is complete and should work regardless on bootloader version.

More testing is always welcomed ;-)

jsmeix commented at 2016-05-17 12:17:

With https://github.com/rear/rear/pull/837
I regard this issue as done.

If bugs with USB EFI boot support might be detected later
they can be handled as separated issues.

@gozora
again many thanks for your various
valuable contributions to rear!


[Export of Github issue for rear/rear.]