From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: bug-grub@gnu.org, The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] grub-install: add search-file option for load.cfg
Date: Mon, 27 Feb 2012 02:24:40 +0100 [thread overview]
Message-ID: <4F4ADB58.20606@gmail.com> (raw)
In-Reply-To: <1326509962-12614-1-git-send-email-jon@ringle.org>
I had to rewrite it because of several problems involving lack of
fallback if UUID is unavailable, lack of documentation and so on.
Committed my version
On 14.01.2012 03:59, Jon Ringle wrote:
> Signed-off-by: Jon Ringle<jon@ringle.org>
> ---
> util/grub-install.in | 26 +++++++++++++++++++++-----
> 1 files changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/util/grub-install.in b/util/grub-install.in
> index ff8bea8..20a3b7d 100644
> --- a/util/grub-install.in
> +++ b/util/grub-install.in
> @@ -245,6 +245,9 @@ do
> --debug-image=*)
> debug_image="`echo "$option" | sed 's/--debug-image=//'`" ;;
>
> + --search-file)
> + set_search_file=yes ;;
> +
> -f | --force)
> setup_force="--force" ;;
>
> @@ -534,12 +537,25 @@ if [ "x${devabstraction_module}" = "x" ] ; then
> echo "UUID needed with cross-disk installs, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
> fi
>
> - exit 1
> + set_search_file=yes
> + fi
> +
> + if [ "x${set_search_file}" = xyes ]; then
> + search_file=$(mktemp "${grubdir}/XXXXXXXXXXXXXXXXXXXXXXXXX.uuid")
> + search_file="$("${grub_mkrelpath}" "${search_file}")"
> + fi
> +
> + if [ "x${search_file}" = "x" ] ; then
> + echo "search.fs_uuid ${uuid} root ">> "${grubdir}/load.cfg"
> + echo 'set prefix=($root)'"${relative_grubdir}">> "${grubdir}/load.cfg"
> + config_opt="-c ${grubdir}/load.cfg "
> + modules="$modules search_fs_uuid"
> + else
> + echo "search.file ${search_file} root ">> "${grubdir}/load.cfg"
> + echo 'set prefix=($root)'"${relative_grubdir}">> "${grubdir}/load.cfg"
> + config_opt="-c ${grubdir}/load.cfg "
> + modules="$modules search_fs_file"
> fi
> - echo "search.fs_uuid ${uuid} root ">> "${grubdir}/load.cfg"
> - echo 'set prefix=($root)'"${relative_grubdir}">> "${grubdir}/load.cfg"
> - config_opt="-c ${grubdir}/load.cfg "
> - modules="$modules search_fs_uuid"
> elif [ "x$platform" = xefi ] || [ "x$platform" = xpc ]; then
> # we need to hardcode the partition number in the core image's prefix.
> if [ x"$grub_partition" = x ]; then
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
parent reply other threads:[~2012-02-27 1:24 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1326509962-12614-1-git-send-email-jon@ringle.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F4ADB58.20606@gmail.com \
--to=phcoder@gmail.com \
--cc=bug-grub@gnu.org \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.