grub2|loopback: avoid perl for live entry creation, use temp file
this is one of the patches that was moved out of the recent big bootloader set for later resubmission.
i tweaked it slightly to remove a couple of overly cautious aspects that were unnecessary.
commit log:
instead of cramming the live entries into a string via a layer of functions for terminating entries with newlines, which we then have to run through perl to tweak the newlines for correct use with sed... let's write the entries to a temp file, then use that file in the sed replacement.
the helper functions injecting newlines to the end of entries as they were built into a long string have obviously become unnecessary and so were removed. one function was renamed for reasons of consistency and clarity.
the file is initially deleted before use for reasons of wanting to bullet
proof the codebase to work properly under conditions of recovering from
failure/cancellation, --force
re-running and such.
this removes the last use of perl.